Home forums Using CanvasJS Negative value

Tagged: 

This topic contains 3 replies, has 2 voices, and was last updated by  Sunil Urs 2 years, 8 months ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #6125

    Meuhmeuh
    Participant

    Hello,

    Is it possible to format negative value in order to have absolute value ?

    And is it possible for indexLabel and label ?

    #6127

    Sunil Urs
    Keymaster

    Is it possible to format negative value in order to have absolute value ?

    Am afraid this is not possible.

    And is it possible for indexLabel and label ?

    Though you can use xValueFormatString & yValueFormatString to format values inside labels, you can format them to show absolute values.

    #6130

    Meuhmeuh
    Participant

    I don’t see how i can use the format string in order to draw absolute value of the axis :/

    To explain a little bit, i want to do a population chart, something like this :
    Population chart

    So what i’ve done, i have 2 series (Male and Female) one with negative value and i stack the two. I put the option minimum and maximum of my Y axis of the bigest value of any serie .

    axisY : {
    minimum : -maxValue(),
    maximum : maxValue()
    }

    Here is what i have for the moment :
    watiwant

    I didn’t prettify it, …
    In circle the element i want to change.

    • This reply was modified 2 years, 8 months ago by  Meuhmeuh.
    #6133

    Sunil Urs
    Keymaster

    Sorry, that was a typo. I meant to say “you can’t format them to show absolute values”. As a workaround you can set indexLabel property of each dataPoint to its absolute value and it should work fine as show here. But labels on the axis would remain the same.

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

You must be logged in to reply to this topic.