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.
- 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
- Open the Format Chart… tab.
- Open the Value Series section.
- Under the Slice section, change the By Distance value to 6.
- For Slice Outline, choose the color black from the palette.
- 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.
- Double-click on the chart to edit it.
- Select the Value Series section.
- Click on the Labels button.
- Under Values, remove the Value Data option.
- Under Values, add Percentile Value Data.
- Click the Interactivity button.
- Choose Mouse Click from the Event listbox.
- From the Action listbox, choose Invoke Script.
- Click the Expression Editor button.
- 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:
- Click OK. Now click on the << arrows in the Series Interactivity window.
- 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.