Rogue Wave banner
Previous fileTop of DocumentContentsIndex pageNext file
Objective Chart User's Guide
Rogue Wave web site:  Home Page  |  Main Documentation Page

15.4 Histogram Chart

The OCHistogram class creates a bar chart that counts the distribution of values in a given set of data.

The Histogram chart performs the data analysis in two stages. During the first stage, data is scanned to determine the overall range of the data values. This range is divided into a number of subdivisions or slots. The number of data slots may be programmed using the SetDataDivisions() function. During the second stage, counters for these slots are incremented once for each data value that falls within a particular slot range.

15.4.1 Using the Histogram Chart

Data is supplied to the chart item by item. First the whole data set or the range of data is sent to the AddToScan() function. This sets up the scale. Then the data is sent one value at a time to the AddData() function which sorts the values into their correct slots. Once this data is scaled and sorted, the chart is drawn in the normal way by calling the DrawComponentList() function via the Paint() function in the OCUTItem class.

Figure 133 and the code example following it show how the histogram chart is used to generate a histogram of the colors in an image stored in a resource bitmap.

Figure 133: Image analyzed by Histogram chart



Previous fileTop of DocumentContentsNo linkNext file

Copyright © Rogue Wave Software, Inc. All Rights Reserved.

The Rogue Wave name and logo, and Stingray, are registered trademarks of Rogue Wave Software. All other trademarks are the property of their respective owners.
Provide feedback to Rogue Wave about its documentation.