Commit 486138326f82076aaa735713eb5b37eebbbeb221

Authored by hitier
1 parent b87db710

Fix legend keys order

Showing 1 changed file with 2 additions and 2 deletions   Show diff stats
app/main/static/js/charges.js
... ... @@ -142,7 +142,7 @@ function build_chart(div_selector, data_url, entity_name, category_type) {
142 142 var addlegend = function (color_scale) {
143 143  
144 144 // add horizontal legend
145   - let reverse_keys = color_scale.domain().reverse();
  145 + let legend_keys = color_scale.domain();
146 146 var legendSpacing = 5;
147 147  
148 148 var legendWrap = svg.append('g')
... ... @@ -150,7 +150,7 @@ function build_chart(div_selector, data_url, entity_name, category_type) {
150 150 .attr('class', 'legendwrap');
151 151  
152 152 var legend = svg.select('.legendwrap').selectAll('.legend')
153   - .data(reverse_keys)
  153 + .data(legend_keys)
154 154 .enter()
155 155 .append('g')
156 156 .attr('class', 'legend');
... ...