I have a multi‑series chart where each series represents a user. I want every user to have a clearly distinct and stable color, regardless of filters or data order.
My question: How can I correctly modify the Highcharts config in ODC to assign a unique color per user (per series)?
I'm assuming you would have a place to attach a color to each user (like in a user_settings table or something like that) ?
From the dataAction fetching the chart datapoints, add as extra export a list of a structure {seriesname, color} for the users that have datapoints in your current chart (or for all if you always want to see all users in your legend)
add a list widget with in there a ChartSeries block in the addon section of your chart.
Hey @Michal Konwerski
How many series you have? are they fixed or dynamic?
Thanks,
Sudip
Hey @Sudip Pal
I have a dynamic number of series.
Each series represents a user, and the list of users changes depending on filters.
So the number of series is not fixed and the order also changes.
What I need is:
each user should always have a distinct and stable color, even when the number of users or their order changes.
Michał
@Michal Konwerski
How many series is possible? Do the users have their ID?
I can create a logic which can take care of 50-200 series after filtering. But if you need more than that then colors will look like similar visually, but hex code will be different.
@Sudip Pal
We can have about 35 series now, but the number is not fixed. It depends on which users are selected in the filters. Yes, every user has a unique ID.
Have a look on the below OML. If you need any help let me know.
@Sudip Pal ,
coloring a whole series is not done by coloring all individual data points.
I think simply you should attach one color with each user, It may be done at entity level. While creating series you just need to pass the color code with each user. If don't want to add color with user then at the time of data series creation you can pass color code.
May be you can create a client action as function and call that function here to assign some color code to user it may be random.