Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JSON import incorrectly parses labels with HTML entities #210

Open
nk9 opened this issue Jun 12, 2020 · 0 comments
Open

JSON import incorrectly parses labels with HTML entities #210

nk9 opened this issue Jun 12, 2020 · 0 comments

Comments

@nk9
Copy link

nk9 commented Jun 12, 2020

Expected behaviour

When you import a .json file saved by Highcharts, I expect the chart to be recreated as it was when the chart was saved.

Actual behaviour

If the saved data contains semicolons in the labels (for example if HTML entities are used), the data will be parsed incorrectly and the graph will not be reproduced as it was when it was saved.

Reproduction steps

  • Visit the Highcharts editor.
  • Press the Open button in the toolbar.
  • Import this json as a file:
{"template":{"chart":{"type":"line"}},"options":{"series":[{"data":[["a",4],["b–b",5],["c",6]],"name":"col1, thx","turboThreshold":0},{"data":[["a",4],["b–b",4],["c",3]],"name":"col2","turboThreshold":0},{"data":[["a",3],["b–b",5],["c",7]],"name":"col3","turboThreshold":0}],"data":{"csv":"\"null\";\"col1, thx\";\"col2\";\"col3\"\n\"a\";4;4;3\n\"b–b\";5;4;5\n\"c\";6;3;7"},"yAxis":[{}],"pane":{"background":[]},"responsive":{"rules":[]},"tooltip":{"useHTML":true},"xAxis":[{"title":{"useHTML":true},"labels":{"useHTML":true}}]},"customCode":"/*\n// Sample of extending options:\nHighcharts.merge(true, options, {\n    chart: {\n        backgroundColor: \"#bada55\"\n    },\n    plotOptions: {\n        series: {\n            cursor: \"pointer\",\n            events: {\n                click: function(event) {\n                    alert(this.name + \" clicked\\n\" +\n                          \"Alt: \" + event.altKey + \"\\n\" +\n                          \"Control: \" + event.ctrlKey + \"\\n\" +\n                          \"Shift: \" + event.shiftKey + \"\\n\");\n                }\n            }\n        }\n    }\n});\n*/","theme":false,"settings":{"constructor":"Chart","dataProvider":{"csv":"\"null\";\"col1, thx\";\"col2\";\"col3\"\n\"a\";4;4;3\n\"b–b\";5;4;5\n\"c\";6;3;7","googleSpreadsheet":false,"liveData":false}}}

Editor version

Whatever is live on the website.

Affected browser(s)

All, this isn't a browser issue.

Images

Before round trip:
Screenshot 2020-06-12 at 12 08 22

After round trip:
Screenshot 2020-06-12 at 12 10 44

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant