Thursday, May 26, 2011

How to Draw a Pie Chart out of your Data using DataDynamics Reports

One of the different charting types provided in the DataDynamics Report is the Pie chart. Essentially,a pie chart would be used to display a summary of your
data in a pie . For instance, you have a Table with Country, Sales1, Sales2, Sales3 as columns of data. Now you might want to draw a pie chart out of the Sum of Sales1, Sum of Sales2,Sum of Sales3. You may follow the below mentioned steps to implement the same.

1) Drop in a Chart reportitem to the body of the report.
2) Chage the ChartType by right click on the chart->ChartType->pie->
3) For each column that you want to add to the pie chart,right click on the section(at the top)that says Drop Data Fields here and click on add.
4) Now you will need to assign values to this Data Fields that you have added.Set the value of the data field(->right click on the data field->edit->value)
to something as =Sum(Field!Sales1.Value),=Sum(Field!Sales3.Value),=Sum(Field!Sales3.Value)

Now if you preview the RDLX you would see the pie chart drawn.But it will lack the data values being displayed in the chart. In order to show them as well you will need to use the series labels. For this once again:-

1) Right click on the data fields added->edit->Series Values Labels->check the cross mark that says Show point labels
2) For the Data Label that has become editable now use expression as =Sum([Sales1] for the first data field. Repeat this for all the data fields added to the chart.
3) You will also find a Format Code property just below the Data label one. You can use this to change the format of the data displayed within the regions of the pie chart.

At times you may want to display percentage values within the pie chart as how much of total does one section of the pie represent.In order to do this, you will need to use step 1 as in the previous case. But steps 2 and 3 would be a little different.

2) Set the Data Label for the Series Values-Labels as something like  =Sum([Sales1]/(Sum([Sales1]+Sum([Sales2]+Sum([Sales3]) for the Series that represents Sales1 and similar with the other 2
3) Change the Format Code to percent.

You may also change the position property in the same window to change where exactly you want the Series Value Label to be placed. Please find a very simple RDLX at this link demonstrating the same.

No comments:

Post a Comment