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

Annotation integration #65

Open
akrish70 opened this issue Sep 5, 2023 · 0 comments
Open

Annotation integration #65

akrish70 opened this issue Sep 5, 2023 · 0 comments

Comments

@akrish70
Copy link

akrish70 commented Sep 5, 2023

Hi Team,

I'm using angular 14 and chartjs 4.4.0, kind of achieved the charts based on requirement with help of angular2-chartjs.
but I'm not able to integrate or add plugins, trying to include the https://www.chartjs.org/chartjs-plugin-annotation/latest/guide/
annotation with angular2-chartjs but I'm not sure what is happening inside I'm not seeing any errors also I'm not able to see the annotations reflecting in the charts.

Registered the plugin in app.module,ts

import * as annotationPlugin from 'chartjs-plugin-annotation';
declare var Chart;
Chart.pluginService.register(annotationPlugin);

also added the annotations in the options

plugins: {
annotation: {
annotations: {
label1: {
type: 'label',
xValue: 2.5,
yValue: 60,
backgroundColor: 'red',
content: ['This is my text', 'This is my text, second line'],
font: {
size: 18
}
}
}
}
}

I have been stuck in this issue for a long time, help me on this. If not able to achieve it i have to scrap the entire work and start it fresh again in some other chatjs library provided in angular. Thanks

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