Modifying Chart and Map Properties

Troubleshooting

graphics/troubleshooting_icon.jpg

I want to create a chart based on changing a specific field but don't know how.

Select the On Change Of charting option and then specify the field or fields to break the chart sections on by selecting any of the fields in the available fields listing. Unlike the drop-down box under the Group layout, you can select any of the available report fields in this interface, dynamically order them with the Order button, or restrict their display on the report to a specified Top or Bottom N with the Top N button.

Crystal Reports in the Real WorldComplex Charts

Charts can be particularly useful when they display data that is different but complementary. Although it is certainly possible to show data in multiple charts, showing complementary data in the same chart allows direct comparison of information and more efficient use of space. The following steps will walk through a good example of this:

  1. Start by opening the report Chap8BarChart.rpt. In the chart that will be added, bars represent the individual stores and a line shows the running total across all stores.
     
  2. With the report open, right-click on the field Order Sales and choose Insert, Running Total. When the Create Running Total Field window opens, give the running total a name like Total Sales and leave the remaining values as defaults similar to Figure 8.18. Click OK to close the window.
     

    Figure 8.18. Creating this Running Total field will help present a creative use of charts.

    graphics/08fig18.jpg  
  3. From the Insert menu, select Chart. Without making any changes, go to the Data tab and click the Advanced button. Select the Customer Name field and use the upper arrow (>) button to move the field to the On Change Of window. To make this Chart consistent with the rest of the report, you will also need to Specify that you only want to display the Top 10 Customers based on their sales through use of the Top N button. Finally, select the Order Amount and Total Sales fields and add them to the Show Values window using the lower arrow (>) button. The results of this step should resemble Figure 8.19.
     

    Figure 8.19. Creating an advanced chart with a two summary fields will enable some creative charting.

    graphics/08fig19.jpg

     
  4. Select the Customer Name field in the On Change Of window and click the Top N button. When the Group Sort Expert window opens, select All from the list box and choose Descending. Click OK to close the window.
     
  5. Click the Text tab. Uncheck all the Auto-Text boxes and type Comparison Chart into the Chart Title text box. Click OK to close the window and return to the report.
     
  6. Using the handles on the chart object, stretch the chart to fit the page width. Right-click the legend text #Total Sales and select Edit Axis Label. Remove the # symbol, do the same with the text Sum of Orders.Order Amount, and change the text to Sales. This makes the text more readable. Figure 8.20 provides a good benchmark.
     

    Figure 8.20. Bars representing both Individual Client Sales and Total Cumulative Sales are displayed on the same chart, effectively communicating multiple pieces of information in one chart.

    graphics/08fig20.jpg  
  7. Notice that because the Total Sales becomes such a large value, the contrast between individual sales values appears quite small using this scale. To change this, the report will be changed to use a split axis. This enables you to show both sets of values while still highlighting the contrast between individual elements within a set. To change the chart to a split axis, right-click anywhere in the chart and choose Chart Options, Template. Click on the Dual Axes box, and then click OK.
     
  8. Click any of the individual Total Sales bars to select it, and then right-click the bar and select Chart Options, Series. Change the list box from Default for Chart Type to Line and click OK to close.
     
  9. Save the report as Chap8BarChartComparison.rpt.
     

TIP

The preceding example provided a great example of displaying different data sets in the same chart. Another great practical use of this functionality to consider is displaying averages (or running total calculations) over time in the line chart to complement the other bar chart sums by some specified time period (such as a month). Essentially, you could create a chart that represents a moving average laid on top of the monthly sums.

 

Figure 8.21. Bars represent Individual Client Sales and a line represents Total Cumulative Sales with two separate numeric scales displayed.

graphics/08fig21.jpg




Special Edition Using Crystal Reports 10
Special Edition Using Crystal Reports 10
ISBN: 0789731134
EAN: 2147483647
Year: 2003
Pages: 341
Simiral book on Amazon

Flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net