5π
I think that chart.js youβre using has an error
try this one:
<script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.4.0/Chart.min.js"></script>
3π
On Laravel mix use:
window.Chart = require('chart.js/auto').default;
- [Chartjs]-How to disable chartjs legendclick
- [Chartjs]-Adding Chart.js line chart to Jinja2/Flask html page from JS file
1π
Do this and it should work
import Chart from 'chart.js/auto';
https://www.chartjs.org/docs/latest/getting-started/integration.html
0π
If you are using Chart.js v3 or higher:
import Chart from 'chart.js/auto';
If you are using Chart.js v2:
import Chart from "chart.js";
- [Chartjs]-ChartJS β Donut charts with multiple rings
- [Chartjs]-How to add images as labels to Canvas Charts using chart.js
Source:stackexchange.com