Open FineTralfazz opened 5 years ago
You can change the color of the control line by adding ui.chartOptions
to the options object of the control wrapper as below.
I stumbled onto this whilst struggling with the same issue and found the solution in the guides here.
Hope this helps!
let safetyControl = new google.visualization.ControlWrapper({
controlType: 'ChartRangeFilter',
containerId: 'control-div',
options: {
filterColumnIndex: 0,
ui: {
chartType: 'LineChart',
'chartOptions': {
series: {
0: { color: '#ffc107' },
},
},
},
}
});
I'm using Google Charts to render a line chart with custom line colors, and I'm using a
ChartRangeFilter
to allow users to zoom in and out easily. However, the filter shows the default Google Charts colors instead of the custom ones: I've tried supplying a color array in theControlWrapper
's options array like I do in theChartWrapper
, but that didn't help. I've also tried calling thedraw()
method on theDashboard
object again manually in case this was the result of some sort of race condition, which didn't work either.