Problem/Motivation
The $chart element has a temporary '#chart_definition' property used to hold the specific configuration options generated by the active charting library plugin (e.g., Google Charts, Highcharts). This definition array is then JSON-encoded and passed to the frontend as a data-chart HTML attribute, which the client-side JavaScript reads to actually draw the chart.
Currently, we are a bit restrictive and have the module populate that property, which ensures that all the necessary elements are provided, but it also prevents a user from using a chart type (for example) that's not supported by the rest of the Charts module code.
Proposed resolution
If we refactor how we handle that property, we can enable a user to pass a chart definition generated outside of the Charts module, opening the module up to many more chart types being supported (and other properties not currently supported by the Charts module).
Remaining tasks
1) Refactor
2) Test, including ensuring that the property value remains sanitized.
User interface changes
None.
API changes
TBD.
Issue fork charts-3555482
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 #3
andileco commentedComment #4
andileco commentedComment #7
bspeare commentedI've tested this in 5.1.x-dev on a few of my highcharts charts and I'm not noticing any issues or regressions with my charts.