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

Donut Chart invisible until after HMR #453

Closed
menasheh opened this issue Jan 10, 2024 · 3 comments
Closed

Donut Chart invisible until after HMR #453

menasheh opened this issue Jan 10, 2024 · 3 comments
Assignees

Comments

@menasheh
Copy link

menasheh commented Jan 10, 2024

Highcharts seems to show an empty chart until you edit main.jsx. Saving with an extra space is enough to trigger the chart to load, but by default it won't load.

Minimal repro:
highcharts-issue.zip

@menasheh
Copy link
Author

menasheh commented Jan 10, 2024

Discovered it can be fixed by adding [] around series in donut chart options. However, why does HMR make it work, if the series was the wrong structure? That's quite odd. Also there is no error message at all about the problem, took about a day to discover.

@KamilKubik KamilKubik self-assigned this Jan 11, 2024
@KamilKubik
Copy link
Contributor

Hello menasheh,

Thanks for contacting us!

In general, defininig series as an array of objects is the only supported way to create a chart, and you should stick to that. The reason for this is that you can create many series. Feel free to explore the series as a definition and in our API.

I debugged your code, and it seems the rerender causes the correct chart's load. I think the reason for this behavior is that on the first render, the chart instance is created, and Highcharts handles the incorrect series format, but the chart isn't rendered at some point. Then, having the correctly formatted data, the chart is rendered after the rerender occurs.

I agree that if there's any error, the information should be returned to avoid misleading. Therefore, it would be reasonable to add such a statement, and feel free to report it here. Note that the error handling functionality currently exists, and you can test it, e.g., by defining a wrong series type.

Kind Regards!

@ppotaczek
Copy link
Contributor

Closed due to inactivity.

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

3 participants