2👍
Charts doesn’t support this feature officially. But you can customize tooltip with your data like this in case of LineChart.
first, make chart with datasets and options
var chart = new Chart(ctx).Line(dataset, opt);
and, add properties what you want show in tooltip
var points = chart.datasets[0].points;
for (var i = 0; i < points.length; i++) {
// Add properties in here like this
// points[i].time = '2015-04-23 13:06:24';
}
then, you can use these properties like this.
tooltipTemplate: "<%=time%> : <%=value%>"
I hope this is helpful to someone. 😀
- [Chartjs]-Display Bar chart values in the graph – ChartJS
- [Chartjs]-Chart.js Bar Chart – how to chart bars from 0
1👍
You should go:
var options = {
tooltipTemplate: "<%= label + '-' + %> <%= description %>"
};
- [Chartjs]-Remove the label and show only value in tooltips of a bar chart
- [Chartjs]-Chart.js stacked graph that overlaps
0👍
It’s not a solution really, but I solved it by adding just the description inside the label…
label: "Label 2 - Description",
Source:stackexchange.com