1π
Is this what you are looking for?
var data = {
labels: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"],
datasets: [
{
label: "My First dataset",
fillColor: "#FFC069",
strokeColor: "rgba(220,220,220,1)",
pointColor: "rgba(220,220,220,1)",
pointStrokeColor: "#FF9C85",
data: [45, 39, 40, 31, 26, 45, 10, 36, 25, 30, 2, 10]
}
]
};
var ctx = document.getElementById("myChart").getContext("2d");
var myLineChart = new Chart(ctx).Line(data, {
// adjusting your scale labels
scaleLabel: "<%=value/10%>M",
// adjusting your scale
scaleOverride: true,
scaleSteps: 5,
scaleStepWidth: 10,
scaleStartValue: 0,
// ajusting tooltips
tooltipTemplate: "<%if (label){%><%=label%>: <%}%><%= value / 10 %>M",
});
Fiddle β http://jsfiddle.net/t0o07xbf/
0π
you can add this properties into your code:
scaleOverride : true,
scaleSteps : 5,
scaleStepWidth : 5,
scaleStartValue : 0,
- Chartjs-How to remove percentage calculation on top of bar in ng2-chart bar chart
- Chartjs-Chart JS Custom Labels don't work
Source:stackexchange.com