Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
Creating Pie chart for aggregate data
arun87
Hi,
I am creating a report with a pie chart using BIRT and currently stuck with this problem. I am using a XML file as the DataSource and it looks like the one given below.
<Disk>
<Name>10K</Name>
<locatedSpace>5.46 GB</locatedSpace>
<FreeSpace>4.69 GB</FreeSpace>
</Disk>
<Disk>
<Name>Legacy SAN</Name>
<locatedSpace>2.46 GB</locatedSpace>
<FreeSpace>5.2 GB</FreeSpace>
</Disk>
I need to create a pie chart that represents the sum(locatedSpace) and sum(Free_Space) in the same chart as sectors and group the chart by the Name. How do I achieve this? I created two column bindings that represent the sum of locatedSpace and the sum of FreeSpace. But the 'Slice Size Definition' in the 'Select Data' tab accepts only column. I am not sure how to proceed after this. Report should look the one in the image attached with this message. Thanks in advance.
Find more posts tagged with
Comments
Hans_vd
Hi Arun,
Do you have a root element in the XML?
Did you manage to create the data set?
What data needs to be summed? From you example, I don't see why you would need to aggregate the data?
Regards
Hans
arun87
Hi Hans,
I have a root element in the XML and am able to created the data set. I am trying to do this. For each names I would like to create a pie chart for the sum of locatedSpace vs Freespace. Consider this example. My XML file is
<compxml>
<Title>A_DiskClass</Title>
<Disk_Class>
<Disk>
<Name>10K</Name>
<locatedSpace>5.46 GB</locatedSpace>
<FreeSpace>4.69 GB</FreeSpace>
</Disk>
<Disk>
<Name>Legacy SAN</Name>
<locatedSpace>2.46 GB</locatedSpace>
<FreeSpace>5.2 GB</FreeSpace>
</Disk>
<Disk>
<Name>10K</Name>
<locatedSpace>4.8 GB</locatedSpace>
<FreeSpace>2.6 GB</FreeSpace>
</Disk>
<Disk>
<Name>Legacy SAN</Name>
<locatedSpace>1.4 GB</locatedSpace>
<FreeSpace>2.8</FreeSpace>
</Disk>
</Disk_Class>
</compxml>
I want to create separate pie charts for the Name 'Legacy SAN' and '10K' as follows.
Pie Chart for 'Legacy SAN'
Sum of FreeSpace and the sum of locatedSpace should be the Sectors of the pie chart.
For the above case, the Sectors will be locatedSpace - 3.86(1.4+2.46) and FreeSpace - 8(2.8+5.2).
Same will be the case for the Name '10K'.
How can I do this? For your reference please see the image attached with the previous message. Can I enter two columns in the 'Slice Size Definition' in the 'select Data' tab?
Thanks for the reply.
Arun
Hans_vd
Hi Arun,
First of all: you need to create a created column of data type float to be able to do a sum aggregation on it.
To create a pie chart for each disk, do this:
- create a table on the rerport and bind it to your data set
- add a group on the Name field
- remove the detail row from the table
- add the pie chart in the group footer row
Regards
Hans
arun87
Hans,
Thanks for your suggestion. I did exactly what you mentioned. It works but still I have one more issue. I am not able to force the pie chart to represent the sum of locatedSpace and the sum of Freespace as sectors. Is there a workaround to enter two values in the 'Slice Size Definition' field.
Thanks,
Arun
Hans_vd
What do you mean by "secors"?
Is it that you want a space between the parts of the pie chart? I'm not sure if that's possible in BIRT...