Skip to content

Can't Pass Existing Chart Options & Data Using defaultChartOptions #218

@spaceninja

Description

@spaceninja

We're using the Chart Editor in a CMS as a custom field. The CMS displays a "create chart" button, which opens a popup window containing the Highcharts Editor. When that window is closed, it sends the results of editor.getEmbeddableJSON() back to the CMS, where it's saved and used to display a preview. That much is working perfectly.

However, there's no way to edit a chart once it's created. Looking at the documentation, it looks like we can pass that JSON config back to the Chart Editor as the defaultChartOptions, but when I do this, I see the chart momentarily display and then disappear. The data never displays in the data table, and some options are never applied (eg, our example was a pie chart, but it displayed in the editor as a line chart).

The "chart displays and then disappears" behavior is also described in #186

The data not showing up is described in #161, but the solution described doesn't work. I'm assuming because the solution was applied to v0.2.1, and I'm using v0.3.0?

Expected behaviour

I should be able to pass the JSON config object for a chart previously created with the Chart Editor back to the Chart Editor (via defaultChartOptions or some other means) to allow my users to edit that chart.

Actual behaviour

Passing the JSON config object back to the defaultChartOptions does not apply all the chart configuration, and does not preserve the chart's data.

Reproduction steps

https://jsfiddle.net/spaceninja00/8nuq60o9/3/

Editor version

highcharts-editor.complete.js v0.3.0

Affected browser(s)

All

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions