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

Class is not JSON Serializable #3

Open
keithii opened this issue Jan 4, 2024 · 5 comments
Open

Class is not JSON Serializable #3

keithii opened this issue Jan 4, 2024 · 5 comments

Comments

@keithii
Copy link

keithii commented Jan 4, 2024

In creating an example similar to the multi-line chart at the end of the Readme, the settings in class option need to be moved to class pluginOptions to work with updates to chart.js. However, an error occurs that the classes (e.g., class Title) are not serializable.

The correction seems to be the need to add 'General' as the second argument of ChartUtils.cleanClass on line 72 of pychartjs.py under 'def getPluginOptions'

@Iridium-IO
Copy link
Member

Which version of chart.js are you using? I'll admit I haven't checked the compatibility in a while.

@keithii
Copy link
Author

keithii commented Jan 4, 2024 via email

@Iridium-IO
Copy link
Member

Weird, I last tested it for 3.9.1 and I'm pretty sure it worked fine then. I'll have another look, I might not have checked the multiline :)

@keithii
Copy link
Author

keithii commented Jan 4, 2024 via email

@keithii
Copy link
Author

keithii commented Jan 5, 2024

Looks like to fix the legend location, "Bottom" needs to be "bottom" and the error being received back from chart.js regarding invalid scale configuration was due to the [] around _yScales.

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

2 participants