BIRT 2.6 Data Analysis and Reporting

October 9, 2010

Java

«»

Pie chart with explosions


While the pie chart we saw in the preceding section is nice, it would be a little easier
to view if the slices were exploded, and if the slices had an outline. Let’s take a look
at how to modify some of the chart’s properties to do this.


  1. Double-click on the chart in the report design. This will reopen the
    chart dialog. Another option is to right-click on the chart and choose
    Format Chart….


  2. Open the Format Chart… tab.

  3. Open the Value Series section.


  4. Under the Slice section, change the By Distance value to 6.

  5. For Slice Outline, choose the color black from the palette.


  6. Save the chart and preview it. The following screenshot shows what the chart
    looks like with the explosion and slice outline added.



Pie charts—working with percentages


Things are starting to look better. But let’s say we want to change the chart to display
percentages instead of numbers and add a little interactivity to the chart to display
the sales numbers when a section is clicked on.



  1. Double-click on the chart to edit it.

  2. Select the Value Series section.

  3. Click on the Labels button.


  4. Under Values, remove the Value Data option.


  5. Under Values, add Percentile Value Data.


  6. Click the Interactivity button.


  7. Choose Mouse Click from the Event listbox.


  8. From the Action listbox, choose Invoke Script.


  9. Click the Expression Editor button.


  10. Using the editor, click on the Variables | Chart Data Point | Value Data
    option to insert the valueData variable into the editor. Surround it with an
    alert() method call. It should look like the next screenshot:


  11. Click OK. Now click on the << arrows in the Series Interactivity window.


  12. Click Finish in the Chart Editor.


When we preview the report, the chart pops up, formatted in the manner we want.
If we click on one of the pie slices, an alert window will pop up showing the value
for that series.


BIRT Articles

email

«»

Comments

comments