score:0
Accepted answer
we hit a similar problem and needed to make sure we globally register the annotation plugin in our project root.
without this, the annotation silently fails just as you are describing:
import { chart } from 'chart.js';
import annotationplugin from 'chartjs-plugin-annotation';
chart.register(annotationplugin);
also, just referencing the annotation in your options object is enough. no need for the plugins
argument to the chart component itself here:
<chart
type="line"
:data="data"
:options="options"
:plugins="annotationplugin"
/>
Source: stackoverflow.com
Related Query
- Can't Draw Horizontal Line on Graph Using ChartJS Annotation Plugin and Primevue Chart
- Draw stacked horizontal bar chart with Average line using ChartJS
- Draw a horizontal and vertical line on mouse hover in chart js
- How to draw Horizontal line on Bar Chart Chartjs
- how to draw line graph with line animation from left to right using chartjs?
- How to set dynamic value for horizontal line in annotation plugin for Chart.js
- How to only draw the graph and the Xaxis gridlines using chart.js
- Chart.js annotation horizontal line on double y-axis graph
- ChartJS Draw grid line X-Axis and Y-Axis
- How to create a bar and a line in a same graph using chart.js in React?
- Dynamically update value for horizontal line in annotation plugin for Chart.js in Angular 5
- Chartjs draw line chart where line go back and forth (by chronological order)
- Chartjs 3 how to draw a horizontal line starting at a specific yAxis value
- How to draw multiple color bars in a bar chart along a Horizontal Line using chart.js
- I am using chart js to draw a chart. I did everything right but i don't know why the x axis and y axis label is not comming in chart. code below
- how to draw Line chart using chart.js and datalabels should be shown
- Chartjs annotation plugin colored box colors get summed after switching back and forth
- ChartJS: Is this horizontal stacked bar and line graph multiaxis chart even possible?
- How to shrink the height and increase the line width of a custom Chartjs horizontal line?
- Plotting Dashed Vertical and Horizontal lines on line graph for single point
- Creating a real time line chart using chartjs and firebase realtime db
- How do I draw horizontal bars with a label using either ChartJS or D3?
- How to display data from database into line graph using php and mysql?
- How to add vertical line in bar chart using chartJs and ng2-charts?
- Show and plot zero values on ChartJS line graph when no data
- Draw horizontal line on chart in chart.js on v2
- Chart.js creating a line graph using dates
- Chart.js - draw horizontal line
- Display line chart with connected dots using chartJS
- Chartjs 2 - Stacked bar and unstacked line on same chart with same y axis
More Query from same tag
- chart.js substitute tooltipItems
- Tooltips not working in chart.js. Any ideas?
- How to change chart js data on button click
- Charts.js graph not displaying
- Chart.js - Getting data from HTML
- Chart.js How to invert (swap) axes?
- Javascript : ""Uncaught TypeError: Cannot read property 'x' of undefined"" in canvasjs.min.js
- Making angular-chartjs responsive with UI-Grid
- How to display different datasets from different ajax calls in the same ChartJS?
- Draw horizontal lines in Chart.js 2.0
- Put sum of values in center of doughnut chart?
- How to add an extra tick on top of the highest bar in Chart.js v2.9.4 (grace)?
- Error trying to switch between different charts
- Chartkick cumulative chart by date never descending
- Add data dynamically to chart
- How change all dates in array into date without time - laravel
- update my chartjs form without refreshing page
- How to save Chart JS charts as image without black background using blobs and filesaver?
- Grouped Bar Chart ChartJS
- Creat Chart Bar using ChartJS
- Why i only get one value after executing "for loop" to display "datasets.data" in ChartJS
- js devexpress PieChart Series color runtime
- ChartJS glitches
- How to Render Chart Datasets in Vue?
- Add Labels to Chart.js Bar Chart
- How To get keys(index) of collection in laravel
- Chartjs bar-chart does not render when values are equal
- How to set the xAxes min and max values of time cartesian chart in Chart.js
- Stacked areachart with percents values on the y axis using Charts.js and Angular 8
- Chart.JS - Fill Donut