Provide a way to identify chart attachment added to chart render array

Created on 26 November 2024, 2 months ago

Problem/Motivation

Sometimes when altering the render array produced by the charts views style we might want to identify which chart data came from chart attachment. It will be good to provide a way to identify chart attachment added to chart render array as chart_data element type.

Steps to reproduce

For example, if a module implement a hook_chart_alter() and try to only process chart element children of type chart_data and were built from chart_attachment. It can not easily identify the chart attachment.

Proposed resolution

Add a '#chart_views_attachment' property that has the view id and view display id of the attachment.

Remaining tasks

The code.

User interface changes

N/A

API changes

Adding a '#chart_views_attachment' for chart render array generated by the views charts style.

Data model changes

N/A

✨ Feature request
Status

Active

Version

5.1

Component

Code

Created by

πŸ‡¨πŸ‡¦Canada nikathone Ontario

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

Merge Requests

Comments & Activities

Production build 0.71.5 2024