Home forums Using CanvasJS Indexlabel inside and Indexlabel total outside

This topic contains 5 replies, has 2 voices, and was last updated by  Indranil Deo 5 months, 1 week ago.

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #18618

    daipham
    Member

    Hi,
    I’m creating a stacked column chart. How can I add indexlabel in per stacked column and a indexlabel total at top of column?
    Thanks for your helping and sorry for my bad english :(

    #18621

    Indranil Deo
    Member

    @daipham,

    Please take a look at this jsfiddle.

    ___________
    Indranil Deo,
    Team CanvasJS

    #18622

    daipham
    Member

    Thank you so much, Indranil Deo.
    But I want to add one more question.
    When I calculate total of column, result will display inside column if the column is too high.
    You can see my promblem is this example: https://canvasjs.com/docs/charts/chart-options/data/indexlabel/.
    How can I make the result always on top and outside the column.
    Best Regards.

    #18627

    Indranil Deo
    Member

    @daipham,

    You can work-around this by setting axisY maximum a bit higher than the y-value of the largest dataPoint. Please take a look at this documentation page on axisY.maximum.

    ___________
    Indranil Deo,
    Team CanvasJS

    #18629

    daipham
    Member

    Thank you so much.
    My English is not good so I didn’t read document well.
    Please help me last question.
    I follow this tutorial to custoom tooltip content.

    contentFormatter


    I got y value as well but I don’t know how to take the percent of y value . Does canvasjs provide it or I have to callculate it myself.
    Best regards

    #18652

    Indranil Deo
    Member

    @daipham,

    In case of stacked, pie and doughnut data-series you can use special keywords like #percent & #total. However, for other chart types, you will have to calculate percent values yourself.

    Please take a look at toolTip content for more information.

    ___________
    Indranil Deo,
    Team CanvasJS

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

You must be logged in to reply to this topic.