0👍
I found I could do what I was after by now adding a chart title.
First I add title to the register..
Chart.register(LineController, PointElement, Tooltip, Legend, Title /* <-- add this **/, TimeScale, LinearScale, CategoryScale, LinearScale, LineElement);
Next I add the title to the plugings…
const options: ChartOptions = {
plugins: {
legend: {
display: false, <---- HIDE THIS
position: 'bottom',
labels: {
padding: 10,
}
},
title: {
display: true, <---- SHOW THIS
position: 'bottom',
text: ''
},
},
And now I can set the title at runtime…
this.chart.config.options.plugins.title.text = 'hello';
In my case, this is all I am after…
- Chartjs-Convert csv to json for javascript plotting library chartjs in Python or PHP
- Chartjs-Can't find the chart.js v2 docs
Source:stackexchange.com