Home › forums › Feature Requests & Feedback › define color in the options
This topic contains 4 replies, has 2 voices, and was last updated by Daniel Silva 3 years, 11 months ago.
I’m building a simple chart editor and having a problem when reading the color of the series.
I don’t define a color for all series and they are retrieved from the colorSet. In this cases I cant later read the used color.
Is possible to alter the chart.options.data to include this value?
color = dataPoints[i].color ? dataPoints[i].color : dataSeries._colorSet[i % dataSeries._colorSet.length];
You can read the used colors which are explicitly given to data. By default color retrieved from the colorSet cant be read as of now.
Only if the color is defined when building the chart, automatic colors are not displayed,
Yes, you can only read colors when you set them explicitly. Default colors are not exposed yet.
But we do have a workaround where you can assign a custom colorSet and determine dataPoint’s color from it – dataPoints are assigned color in a sequential order. Checkout this example.
You must be logged in to reply to this topic.