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

plugin doesn't work with @napi-rs/canvas@0.1.40, chart.js@4.2.1 #378

Open
Mikarrori opened this issue Apr 24, 2023 · 3 comments
Open

plugin doesn't work with @napi-rs/canvas@0.1.40, chart.js@4.2.1 #378

Mikarrori opened this issue Apr 24, 2023 · 3 comments

Comments

@Mikarrori
Copy link

Tried chart.registry(datalabels) and plugins: [datalabels], no errors throwed and nothing happens.

Any hints or tips are appreciated.

@Mikarrori
Copy link
Author

it seems that this plugin doesn't like data of which the structure is an object, as i inspected the value args of the formatter option, it was undefined when the data structure is an object.
Problem solved by:

formatter: (value, context) => {
                            let keys = Object.keys(context.dataset.data)
                            let key = keys[context.dataIndex]
                            return context.dataset.data[key]
                        }

not a good solution though

@florind12
Copy link

Ty, I was running through the same scenario as you.

@simonbrunel
Copy link
Member

@Mikarrori Can't really help without a way to debug your issue. Since it's an old ticket, I hope you fixed your problem. If not, please provide a codepen that reproduces your use case.

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

No branches or pull requests

3 participants