Ok, so the cool feature of chart, is the color selection, automatic color selection that is per data set on said chart. The question is, is that color value somewhere some place, that a node or script can query? I have a dynamic table, that I want to add the line colors into. Maybe make the entire row of the table the same color as the line on the chart? But I would rather not override the automatic color selection, if possible. I will not be surprised if this is not possible, but it would be cool if it was!
You can control the line colours by, on startup, injecting null values with all the line topics. The order of the injection will control the line colours. Or is that what you meant you do not want to do?
Nope, I want the automatic color selection to happen! I don't want to have to manage the color selection. I just did not know of a way to get the color value. What i need, if possible, is to get the color value, once selected. Given the color selection follows a pattern, if I inject, as you suggest, I can look up the colors via matching snapshots of the colors, and build a lookup list, to set the table row color for each row. Just thought that having the table row for a data series match the line color was a nice presentation idea.
the defaults for the ones you can set are
['#1F77B4', '#AEC7E8', '#FF7F0E', '#2CA02C', '#98DF8A', '#D62728', '#FF9896', '#9467BD', '#C5B0D5']
after that it uses the random ones allocated automatically by chart.js
Ok, so there is no technical way to capture the color used, as used, once the random selection comes into play. I guess will come up with something to mimic colorization, not a big deal. I remember somewhere I saw some code that used primary, then secondary, then, tertiary colors. If I diverge from a 50-50 ratio mix, or tones/shades, I could define a theme based selection. This is going to be interesting.
Well chart.js may use a list as well, but I'll let you search the source.
Yup, no problem.
This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.