While the series data is being combined correctly the categories from the chart attachment displays are being appended to the primary display. Since the categories are identical this results in a situation where the x axis of the chart is repeated a few times with blank data.
E.g. I have a stacked bar chart with year categories. It has three attachment displays with the same years but different data which needs to be stacked on the primary chart. It ends up looking like this:
d
c d
b c d
b b c
a a b
a a a
2018 2019 2020 2018 2019 2020 2018 2019 2020when it should look like this:
d
c d
b c d
b b c
a a b
a a a
2018 2019 2020The reason seems to be the removal of this line in the template_preprocess_views_view_charts() function of the charts.module:
$categories = array_unique($categories);
For now I'm attaching a patch that just re-adds that line. However, It has a dedicated commit:
commit dc5bdf351ded5b3b9e552c11dc9c633b8ec7207d
Author: Daniel Cothran
Date: Sat May 5 11:09:13 2018 -0400remove array_unique on the categories variable
so I'm guessing this was done for a reason and I'm not sure my patch is the best solution.
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | 3001248-2-empty-categories.patch | 732 bytes | dylan donkersgoed |
Comments
Comment #2
dylan donkersgoed commentedPatch attached.
Comment #3
andileco commentedThanks also for this one, and thanks for the great explanation. I think this one may need an if statement around it. I think in certain instances it was removing legitimate duplicates, and on charts without attachments, it wasn't being used. I'll do some testing to try to determine what those circumstances were...
Comment #5
andileco commentedI couldn't find a reason not to put this back. Thanks for digging through the history to figure out where the issue was.