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

Command icon 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

andileco created an issue. See original summary.

andileco’s picture

Status: Active » Needs review
andileco’s picture

Status: Needs review » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

bspeare’s picture

I'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.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.