jondot/graphene

Sorting Labels

qgrasso opened this issue · 3 comments

sort_labels = order labels will be sorted
label_formatter = and a formatter, as before.

I'm having issues trying to figure out how to use these two options for timeseries graphs,

Problem I'm having is my graphs randomly have the 2 labels swapped around on a page. say download and upload on one graph its correct next graph its swapped around and this happens throughout the page on the other graphs.

Any ideas on how i may go about resolving this?

Thanks,

hey @qgrasso I'll take a look at it this week, since I'll be building several new dashboards with Graphene for myself. will update here.

@qgrasso I looked more deeply into this during the week - this is the intended behavior. Graphene will sort and display the labels based on which graph has the max/min values of all over each update of the data. So it would sort ascending, and desc is another value for the order.

This helps when you want to pick up the "strongest" graph of all, in one glance (it should be the first, or last - depending on sort order)

As depicted here:

   data = _.sortBy(data, (d)-> order*d.ymax)

It looks like you were expecting alphabetical order (or that sort of thing) if you still prefer it, let me know.

This should be resolved now due to a recent fix. Automatic sorting is now opt-in. Default behavior will leave all labels as-is (they will not reorder as data refreshes).
Hope this helps.

Thanks!