Chart Attachment not showing up

Created on 26 May 2025, 3 months ago

Problem/Motivation

Attach a chart attachment to other display but it is not showing up.

Steps to reproduce

- Create a views
- Add a page display
- Add a chart attachment then attach it to the page display.
- View the page, verify that the chart attachment not showing up.

Proposed resolution

- Remove attachTo function in the ChartsPluginDisplayChart class because it doesn't return anything.

Remaining tasks

User interface changes

API changes

Data model changes

πŸ› Bug report
Status

Active

Version

5.1

Component

Views integration

Created by

πŸ‡ΊπŸ‡ΈUnited States hungdo

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @hungdo
  • πŸ‡ΊπŸ‡ΈUnited States andileco

    This feature has been in place a long time and is still working. I think there's just a misconfiguration with your view. Please play around with your configurations a bit more or send a video or view export for support. Thank you!

  • πŸ‡ΊπŸ‡ΈUnited States andileco
  • Status changed to Postponed: needs info 11 days ago
  • πŸ‡ΊπŸ‡ΈUnited States redeight

    I'm also not able to figure out how to get the two charts to show up together. I've got the fields and display set the same for both of them, but the filter on the attachment is overridden to get different view results.

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

    Can one of you share which library you are using and what chart types you are wanting? Then I can make a video showing what to do.

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

    I've tried various combinations of line and area charts. Each chart works fine on its own in the preview β€” and on a page if I duplicate the display β€” regardless of chart type, but the chart attachment never shows up on the main chart. I'm using Chart.js, but i'm willing to switch if another worked.

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

    OK, I've added a video of how to make a chart with a chart attachment. Apologies for the lack of voice in the video. Let me outline the steps:

    1. Add a view of Charts Usage Statistics content type, with the initial display being a page.
    2. Add a field to hold the value (in this case, I choose "7.x")
    3. In the Format section, select a chart with "Title" as the label and "7.x" as the data provider.
    4. Preview to make sure it works
    5. Now add a "Chart attachment" display. I chose to "Clone as chart attachment" to save a little time.
    6. Configure your chart attachment as needed, remembering to select "This display" for everything, INCLUDING the format (the form where you select "Chart" versus "Table" or "Unformatted list). In my case, I added an "8.x" field and in the chart settings selected that as the data provider. I also used a column for this display instead of a line.
    7. Make sure you "Attach" your attachment to the Page display.
    8. Preview your attachment to make sure it works.
    9. Toggle to the Page display: you should see both your main chart and the chart attachment.

    If you follow these directions and still have an issue, can you either post a video here like I did (I made this with Slack) or send me a DM (@andileco) on the Drupal Slack workspace?

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

    Could it be because I'm using aggregation on data fields, contextual filters, and custom fields as the grouping field?? I followed the steps shown in the video β€” very clear what you were doing even without the audio, thank you. And I still can't get the attachment in the same chart. If I duplicate the chart attachment and make it a regular attachment it works fine. I know the label field is the same between the two though the fields for the attachment are set to "this attachment" like you showed in the video. And the chart itself is also set to "this attachment". I'll shoot you a message via the drupal slack.

Production build 0.71.5 2024