TargetProcess/tauCharts

Define legend ordering

Closed this issue · 2 comments

I have a line graph with numbers plotted over time. As far as I can tell, the order of items in the legend is done earliest-first highest-first (i.e. render the left most time top-to-bottom, then proceed to the next time, top-to-bottom, etc.). This doesn't necessarily produce the most usable legend for my users. I would like to be able to either (a) specify a way in which the legend ordering should be determined (in this case, highest value at any point would be most appropriate), or (b) specify an absolute legend ordering (as, in this case, I'm rendering a chart with static data; I can generate the legend order in the same way as I'm generating the data).

What type of dimension do you use for color? Is it number or category values?
If you use category type you can set order property for color dimensions. Some example https://jsfiddle.net/n9aknof0/93/

Yep, exactly what I was looking for. Thanks!

(As this has a documentation tag on it, I haven't closed it, but I'd be happy for it to be closed from my POV.)