I want to see dollar sign along with the Y-Axis scale data. I am using ChartJS Version 2.1.0 for rendering graph. I looked into this LINK but I could not understand. I know I need to change my ScaleLabel but I am not able to do so. Kindly guide me. so scale 2000 should show as $2000
Below is what I have till now.
define(['backbone'], function(Backbone) {
var firstSubViewModel = Backbone.View.extend({
template: _.template($('#myChart-template').html()),
render: function() {
$(this.el).html(this.template());
var ctx = $(this.el).find('#lineChart')[0];
var lineChart = new Chart(ctx, {
type: 'line',
data: {
labels: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"],
datasets: {
label: "This Year",
data: this.model.attributes.incThisYear
}
},
options: {
scales: {
yAxes: [{
scaleLabel: {
display: true
}
}]
}
}
});
},
initialize: function() {
this.render();
}
});
return firstSubViewModel;
});
Image:
EDIT
My options looks like this now:
options: {
scales: {
yAxes: [{
scaleLabel: function (incValue){ return '$ '+ incValue.value; }
}]
}
}
My suggestion is to add the following to the options:
It is working in this example