Skip to content

Class is not JSON Serializable #3

Open
@keithii

Description

@keithii

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'

Activity

Iridium-IO

Iridium-IO commented on Jan 4, 2024

@Iridium-IO
Member

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

keithii

keithii commented on Jan 4, 2024

@keithii
Author
Iridium-IO

Iridium-IO commented on Jan 4, 2024

@Iridium-IO
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

keithii commented on Jan 4, 2024

@keithii
Author
keithii

keithii commented on Jan 5, 2024

@keithii
Author

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

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

        Participants

        @Iridium-IO@keithii

        Issue actions

          Class is not JSON Serializable · Issue #3 · IridiumIO/pyChart.js