You must be logged in to post your query.
Home › Forums › Chart Support › Remove suffix on indexLabel
Tagged: indexLabel suffix
Hello,
I have the following setting in the axisY tag:
axisY: { includeZero: true, title: ‘Productivity’, suffix: ‘hh/hp’ valueFormatString: “#0.000” }
At the moment I’m defining the indexLabel tag in dataPoint as “indexLabel: value”, but I’d like to use “indexLabel: ‘{y}'” because it looks more elegant, but using that way the suffix appears for each indexLabel and pollutes the graph.
I would like to know if there is any elegant way to remove the suffix from indexLabel when using “indexLabel: ‘{y}'” in dataPoint?
Or should I continue using “indexLabel: value”?
Thanks in advance.
@nessler,
Setting indexLabel: "{y}" seems to be working fine i.e. it shows only y-value in indexLabel and not suffix. Please take a look at this JSFiddle.
indexLabel: "{y}"
Can you kindly create JSFiddle reproducing the issue you are facing so that we can look into your code, understand your scenario better and help you out?
— Vishwas R Team CanvasJS
@Vishwas,
I was creating JSFiddle and found the error, in the “data” tag is set “yValueFormatString: “#.000hh/hp””. This is creating the suffix in the indexLabel.
I have not seen this before because the array of dataPoints is created in another part of the code. I removed the “yValueFormatString: “#.000hh/hp”” from the “data” and put “yValueFormatString: “#.000” in “axisY” and it worked perfectly.
JSFiddle
Sorry for my mistake and thanks for your help!
Glad that you figured it out and made it work according to your requirement :)
yValueFormatString formats the values to be displayed in indexLabel and toolTip.
You must be logged in to reply to this topic. Login/Register