Mixing labels for parent chart and subchart

Created on 2 August 2014, almost 11 years ago
Updated 11 March 2025, about 2 months ago

Apologies if this is already fixed in dev or should be discussed elsewhere.

If I create a chart and a chart add-on in views, and set them to share an y-axis, a bug manifests:

In charts_plugin_style_chart.inc, when render() is called, first the parent chart is rendered. Then the chart add-on is rendered. The resulting output of both views are combined and rendered by the respective chart engine.

The way render() is written means that the combined chart is limited by the parent chart values and labels.

Here is an example:
Parent chart
label - value
1 - 10
2 - 11
3 - 12
4 - 13

Chart add-on
label - value
2 - 10
3 - 11
5 - 14

One would assume the combined chart would merge the labels as such: 1, 2, 3, 4, 5 and output each line ( or whatever chart type chosen ) according to which labels it has a value for.

Instead, the combined chart uses only the parent chart labels: 1, 2, 3, 4 and outputs the parent chart line correctly. The chart add-on line throws away its labels and instead just use the parent chart labels. Thus, the chart add-on line outputs 1:10, 2:11, 3:14 when it should really output 2:10, 3:11, 5:14

I hope this makes sense.

πŸ› Bug report
Status

Closed: outdated

Component

Views integration

Created by

πŸ‡©πŸ‡°Denmark Roensby

Live updates comments and jobs are added and updated live.
  • views

    Involves, uses, or integrates with views. In Drupal 8 core, use the β€œVDC” tag instead.

Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • πŸ‡ΊπŸ‡ΈUnited States bluegeek9

    Thank you for your contributions to this issue. As Drupal 7 has reached its End of Life and is no longer supported, we are closing this issue. We encourage you to upgrade to a supported version of Drupal.

Production build 0.71.5 2024