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
Issue fork charts-3490047
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #4
andileco commentedI added two properties, as I think this would be more helpful for users when separated:
Comment #5
andileco commentedComment #6
nikathoneWe do have
$chart['#view']. The users can get the view ID from it. We might also need to document this at https://git.drupalcode.org/project/charts/-/blob/5.1.x/charts.api.php?re....Comment #8
andileco commented