Hi
I have that method in my code:
private static parseSettings(dataView: DataView): VisualSettings { return VisualSettings.parse(dataView) as VisualSettings; }
Also the enumerate object instances method:
public enumerateObjectInstances(options: EnumerateVisualObjectInstancesOptions): VisualObjectInstance[] { let objectName: string = options.objectName; let objectEnumeration: VisualObjectInstance[] = []; switch( objectName ) { case 'colorPicker': objectEnumeration.push({ objectName: objectName, properties: { "firstColor":{ "type": { "fill": { "solid": { "color": this.viewModel.minColor } } } }, "secondColor":{ "type": { "fill": { "solid": { "color": this.viewModel.midColor } } } }, "thirdColor":{ "type": { "fill": { "solid": { "color": this.viewModel.maxColor } } } } }, selector: null }); break; }; return objectEnumeration; }
And at the beginnning of my visualTransform method (takes VisualUpdateOptions and updates the viewmodel):
public visualTransform(options: VisualUpdateOptions){ this.viewModel = { dataPoints: [], dataIndex: {}, dataMin: 0, dataMax: 1, highlighted: true, categoryName: '', minColor: this.settings.colorPicker.firstColor, midColor: this.settings.colorPicker.secondColor, maxColor: this.settings.colorPicker.thirdColor }; more code
And my objects element in capabilites json:
"objects": { "colorPicker": { "displayName": "Gradient", "properties": { "firstColor":{ "displayName" : "Min value", "type": { "fill": { "solid": { "color": true } } } }, "secondColor":{ "displayName" : "Mid value", "type": { "fill": { "solid": { "color": true } } } }, "thirdColor":{ "displayName" : "Max value", "type": { "fill": { "solid": { "color": true } } } } } } }
Basically, I can use the three color pickers and the visual gets updated with the selected color... but the app updates the color to gray in the selector (it does display the selected color for a bit amount of time, and the switches back to gray).
My version of API is 2.6.0.
Thanks for your help