Skip to main content

Chart View Tutorial. Step 3: Customizing The View

  • 3 minutes to read

The previous topic finished with creating the Chart View series and designating the categories. The result is shown in the following screenshot:

This topic explains how to customize the layout and the appearance of Chart Views using the properties of the Chart View elements.

Unlike the other Views, a Chart View’s appearance depends entirely upon its elements and their options. Thus to customize the appearance aspects of the Chart View’s we need to address the elements of the View. In the previous topic we learned how to access the properties of the categories and data series. When a specific Chart View is selected within the Structure Navigator or the Component Editor, all the other elements (diagrams, chart legend and chart title) and their corresponding options can be accessed via the Object Inspector.

First, let’s modify the manner in which the data in the Chart View is visualized (i.e. change the currently active column diagram to the bar diagram). There are three possible ways to accomplish this. Select the chvCars View using the Structure Navigator. Now you can right-click the Chart View box within the Structure Navigator and select the “Bar Diagram“ item within the dropdown menu.

In the Object Inspector you can select either a “Bar Diagram“ item from the list of available diagrams provided by the ActiveDiagram property or expand the DiagramBar property and set the Active property to True within the Object Inspector as shown in the following screenshot.

Note that the diagram which is currently active is checked within the invoked dropdown menu. Here is the result of activating the bar diagram:

To arrange the chart legend horizontally under the active diagram and plot the border around it, expand the Legend property and set the Border and Position properties as shown in the image below:

As you can see, the chart’s plot area widens since the chart legend is now located under the diagram. The orientation of the chart legend is changed according to the new Position property’s value. The chart legend will be displayed using these settings in all the diagrams which will be activated unless the settings are modified within a specific diagram.

To specify the title which will be displayed on the top of the Chart View (the default position of the title), expand the Title property and assign the title text to the Text property as follows:

To systematize the data displayed within the Chart View and to simplify the process of comparing series values, we’ll sort the data by the values of the chvCarsSeriesLiter series. Select the chvCarsSeriesLiter series and set the SortOrder property to soAscending as shown in the following screenshot.

The result is shown below:

The categories, data series, chart legend and chart title are elements which are common to all the diagrams, that’s why their properties can be set independently of the context of the diagrams within the Chart View. All the properties of these elements which are specific to a diagram can be accessed via the corresponding properties of the diagram and override the settings of the corresponding properties assigned within the View. See the next topic for the base information on customizing chart diagrams.

See Also