Simple Bar Charts

It is common to use charts to display a series of simple values, like product prices. This type of chart is useful because it shows the relative magnitude of each value in a quick and effective way.

The main characteristic of this type of chart is that each point conveys only one piece of information. When creating these charts, the value being displayed is assigned to the Y values of the series. The X values only provide constant spacing between the points, and usually display labels attached to each data point.

The recommended chart types for this type of information are Bar and Pie charts.

The following illustration shows a simple bar chart with product prices (Beverages from the NorthWind product list).

 

Note that the bars are displayed horizontally, in order to provide room for the product names along the vertical axis. This is done using the Inverted property.

The following code creates the bar chart in the preceding graphic. The data is used from the Beverages table in the NorthWind product list which can be found in the C:\Program Files\ComponentOne\Studio for Winforms\Common folder. In actual applications, the code would be even simpler because some properties would be set at design time.

      Visual Basic

      C#

It is common to show more than one data series on a chart, and that is easy to do with C1Chart. The code would look similar to the above, except you would add additional lists to the ChartDataSeriesCollection.


Send us comments about this topic.
Copyright © GrapeCity, inc. All rights reserved.