Page 1 of 1
How display percentage in Pie Chart
Posted: Fri Sep 19, 2008 6:36 am
by Badhusha
hai,
I created the Pie Chart in StimulSoft version 2006.4 .. It displays pie chart with Amount(Value Type).. But i need to display the percentage....
How to do it?? Urgent......
How display percentage in Pie Chart
Posted: Fri Sep 19, 2008 9:49 am
by Edward
Hello, Badhusha.
Please set the Format property of the in the Series designer in 'P2' .
Argument and Value properties allow you define expressions in the series.
First of all you need to calculate a result value of required Column. In 2006.4 version please place a DataBand with a zero height in very beginning of your report and in the BeforePrintEvent of that band please calculate required sum using of variables. Let result is stored in 'GlobalSum' variable (name might be any).
So you have to write the following expression in the Value column in the Series Designer of Pie chart:
{Math.Round(MyDataSource.MyDataColumn*10000/GlobalSum)/100}
In 2008.1 version you could use Totals:
{Math.Round(Categories.CategoryID*10000/Totals.Sum(Categories,Categories.CategoryID))/100}
Also do not forget to set DataSource property of the chart according to the name of the chart's datasource.
There is a sample chart to illustrate this post. It has been created in 2008.1 version. The only difference from 2006.4 - using Totals instead of calculating sum via bands in script.
Thank you.