Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I'm adding the ability to select a custom color for each measure in my extension.
So far everything is working.. I see the color picker, I can select a color and that color is reported in the hypercube.
The problem I'm having is setting the initial value in the picker itself, it always displays as blank. Here's my code:
measures: {
uses: "measures",
min: 1,
max: 6,
type:"items",
items: {
VisualType: {
type: "string",
component:"dropdown",
label: "Visual Type",
ref: "qDef.visualType",
options: [{
value: "BAR",
label: "Bar"
},{
value: "LINE",
label: "Line"
},{
value: "POINT",
label: "Point"
}],
defaultValue: "BAR"
},
VisualColor: {
type:"object",
component:"color-picker",
label:"Visual Color",
ref: "qDef.visualColor",
defaultValue: {
color: "ff5866",
index: "-1"
}
}
},
paint: function($element,layout) {
$element.css("background-color",layout.qDef.visualColor);
}
},
Thanks in advance for any help,
Steve
I think the problem is that the example I took my code from specifies a default value of "ff5866" when in fact it should have been "#ff5866".