Home Forums Chart Support Remove suffix on indexLabel

Remove suffix on indexLabel

Viewing 4 posts - 1 through 4 (of 4 total)
  • #22730

    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.

    #22732

    @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.

    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

    #22740

    @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!

    • This reply was modified 5 years, 7 months ago by Nessler.
    #22751

    @nessler,

    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.


    Vishwas R
    Team CanvasJS

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.