Chart attachment displays don't seem to inherit arguments. So, e.g., if you:

1. Create a chart view
2. Configure it as a line chart and edit the grouping field, label field, data fields etc.
3. Add a contextual filter
4. Add another chart attachment display to add a second line to the chart and configure it
5. Configure the other display to inherit arguments
6. Go back to the first display

The first display will display the chart with two lines *but* the second line won't be filtered by the contextual filter.

I'm sure I had this working at some point. However, it seems to be broken on all my chart views now. I'm not sure what went wrong - if it's a regression due to a chart upgrade or due to views changes (I did upgrade to 8.5.x since configuring the charts) or what. I don't see anything in the code that *should* apply the inherited arguments - seems like normally it's done in the attachTo() method of the views display plugin but that's overridden for charts.

Anyway, I'm attaching a patch that should fix it.

Comments

Dylan Donkersgoed created an issue. See original summary.

dylan donkersgoed’s picture

Status: Active » Needs review
StatusFileSize
new1.03 KB

Patch attached.

andileco’s picture

Status: Needs review » Fixed

Thanks for figuring that out--it was really bugging me, but I thought it was a Views bug. I've committed.

Any future readers, you may need to re-save "Inherit contextual filters" in each of your Chart Attachments in order for this fix to work.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.