grafana / piechart-panel

Pie Chart Panel Plugin
MIT License
151 stars 101 forks source link

Change color after sorting legend #180

Open gsahbi opened 5 years ago

gsahbi commented 5 years ago

After sorting the legend by a certain column, changing the color of one serie applies to a different one.. I tracked down the js responsible to be the way the index of the serie is saved and retrieved :

legend.js 219 html += '" data-series-index="' + i + '">'; .... 113 var el = $(e.currentTarget).find(".fa-minus"); 114 var index = getSeriesIndexForElement(el); 115 var series = seriesList[index];

After sorting index no longer corresponds to the real element

jars99 commented 4 years ago

+1 for this issue

andrasg commented 4 years ago

Also seeing this issue. Workaround is to remove sorting (click the column until sorting is removed), make the color changes and then apply sorting again.