On my y axis I have value from 0 to n. I need to display this number in this style: 2 (s) 1 (s)
I just want to add "(s)" but if I do this :
data: latency+"(s)"
It doesn't work. Latency is the array where I have numbers. Thanks.
On my y axis I have value from 0 to n. I need to display this number in this style: 2 (s) 1 (s)
I just want to add "(s)" but if I do this :
data: latency+"(s)"
It doesn't work. Latency is the array where I have numbers. Thanks.
You have to set the scaleLabel
option like this :
scaleLabel : "<%=value%>(s)"
For example, you can set it in the global Chart options :
Chart.defaults.global = {
scaleLabel : "<%=value%>(s)"
};
You need to use the scaleLabel
property.
Look at this: Chart.js - Formatting Y axis
try :
scaleLabel: function (valuePayload) {
return valuePayload.value + '$';
}
Use the option
scaleLabel: "<%=value%> (s)",
if you want to change the display on the scale.
Or, if you want to change the display in the tooltip, set tooltipTemplate
or multiTooltipTemplate
depending on whether you have a single or multiple series.
tooltipTemplate: "<%if (label){%><%=label%>: <%}%><%= value %> (s)",
or
multiTooltipTemplate: "<%= value %> (s)",