Home forums Using CanvasJS Pie chart data in percentage

Tagged: ,

This topic contains 6 replies, has 4 voices, and was last updated by  yogaraj 1 year, 9 months ago.

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #4787

    nagkumar
    Participant

    Hello,
    I am using CanvasJS to display a pie chart. It looks amazing. There is one requirement where I have to display the share of each pie in terms of percentage. I wanted to know how to do it. I can either display it using the tool-tip or it can be printed over the pie. My data is in terms of whole numbers, so I want the chart to convert the data into percentage.

    Any help will be appreciated.

    #4788

    Sunil Urs
    Keymaster

    As of now the chart cannot convert values automatically to percent values… But you can achieve the same using indexLabel / toolTipContent property to show percent values (you need to calculate and assign).


    Sunil Urs

    #8040

    rahulscp
    Participant

    But its a very basic requirement and help me to set a stroke around the pies. how can i do that please help me

    #8042

    Sunil Urs
    Keymaster

    Rahul,

    Latest version of library comes with this feature. You can show percentage using #percent keyword. Here is a jsfiddle for the same.


    Sunil Urs

    #8163

    yogaraj
    Participant

    HI am using canvas JS pie chart, i need to round of the percentage. am getting percentage in the format 9.99 % i need to round of it as 10 , ho can i do it ?Please help

    #8177

    Sunil Urs
    Keymaster

    Yogaraj,

    You can do the same using percentFormatString property of dataSeries. Here is an example.


    Sunil Urs

    #8206

    yogaraj
    Participant

    Thanks… Sunil … it worked..

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

You must be logged in to reply to this topic.