Addepar / ember-charts

https://opensource.addepar.com/ember-charts/
Other
784 stars 131 forks source link

Vertical Bar Chart coloring: Bar groups lacking data points wrongly color their remaining bars #172

Closed metathinker closed 8 years ago

metathinker commented 8 years ago

I'm working on a fix for this bug already, but filing it for tracking.

Repro steps:

Apply this patch to master at 66e8bdf0ed8bed251d8ffb9b2ae31967ef8534f0: https://gist.github.com/metathinker/0988ee203c237fae9bc8b8063ce71107

The patch changes the five_ranges data set for the demo application by removing the following 2 data points, so bar group "Group Two" now lacks two bars that it previously had and that the other bar groups continue to have:

[{
  "label": "Label 3",
  "group": "Group Two",
  "value": 150
}, {
  "label": "Label 4",
  "group": "Group Two",
  "value": 160
}]

After applying the patch, open the demo app and navigate to the "Vertical Bar Chart" example, which shows five_ranges by default.

Problem 1:

The bar for "Group Two", "Label 5" should be the same color as the other bars for "Label 5", and the slice legend item for "Label 5". However, as per the below screenshots, it actually takes on the color for "Label 3" instead. (This problem also occurs when you enable stacked bars.) screen shot 2016-08-05 at 3 47 29 pm annotated screen shot 2016-08-05 at 3 47 53 pm annotated screen shot 2016-08-05 at 3 47 49 pm annotated

Problem 2:

When you mouse over "Label 5" in the bar legend, the bar for "Group Two", "Label 5" should be one of the highlighted bars. But it is not. In fact, as per the below screenshots, this bar is highlighted only when you mouse over "Label 3" instead. (This problem does not also occur when you enable stacked bars.) screen shot 2016-08-05 at 4 01 20 pm annotated screen shot 2016-08-05 at 4 01 24 pm annotated screen shot 2016-08-05 at 4 01 26 pm annotated