Home › forums › Using CanvasJS › Pie chart data in percentage
Tagged: percentage, stroke
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.
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).
But its a very basic requirement and help me to set a stroke around the pies. how can i do that please help me
Latest version of library comes with this feature. You can show percentage using #percent keyword. Here is a jsfiddle for the same.
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
You can do the same using percentFormatString property of dataSeries. Here is an example.
Thanks… Sunil … it worked..
You must be logged in to reply to this topic.