I'm working of Chart.js library. I wanted to add data-pointer on bar charts. attaching the example image here.. 
Tried a lot to implement this. But couldn't get option in chart js. Can anyone please help me out here ?
Two options with Chart.js:
1. using data labels plugin:
plugins: {
datalabels: {
color: 'red',
align: 'top',
anchor: 'end',
formatter: function(value, context) {
console.log(context)
if (value>70)
return "("+context.dataIndex + '): ' + value;
else
return "";
}
}
}
example: http://jsfiddle.net/beaver71/wo2cd3jf/
2. using annotation plugin:
annotation: {
drawTime: 'afterDatasetsDraw',
annotations: annotations_array
}
example: https://jsfiddle.net/beaver71/esnjuqzv/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With