Skip to content

Annotation integration #65

@akrish70

Description

@akrish70

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions