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

15.5 Statistical Chart

The Statistical chart analyzes the user's data and then graphically displays the data distribution. The user provides the raw data. The OCUT performs the analysis and draws the chart according the user's settings. The Statistical chart is encapsulated in the OCStatistic class in the OCUT library.

Internally, the Statistical chart maintains five groups of data. The first group is the raw input data. The second and the third groups are the results of the analysis of the input data, which is performed in the function OCStatistic::ProcessData(). These two groups are used to draw the chart on the display area. The data values in the fourth and fifth groups describe a Normal distribution with mean and standard deviation equal to the mean and standard deviation of the input data. These last two groups are used to draw a reference curve for comparison with the distribution of the input data. The appearance of this reference curve is controlled by the function SetShowNormal().

Because the Statistical chart is typically used to analyze a large quantity of input data, OCStatistic uses the Structure data storage model. However, the complexities of the Structure data model are hidden from the user by this class. Just put the input data in a buffer and pass a pointer to the buffer to the SetData() function.

You don't even have to create the input data buffer. Just tell SetData() how big the data buffer needs to be, and use SRGraph::SetValue() to supply the data values to the internal SRGraph object. In this case, all the data buffers are handled entirely by the class.

By default, the chart of the data distribution is drawn as a bar graph with an XYScatter axis. The Normal reference curve is drawn as a line. The width of the bars is specified by the value of m_dStep times the standard deviation (STD) of the data. The default value of m_dStep is 1.0. A different (usually smaller) value can be specified by calling SetStep().

The number of bars on each side of the mean is specified by m_nDivision, which is specified by SetDataDivision(). Therefore the range covered by the Statistical chart is 2*m_nDivision*m_dStep*STD.

15.5.1 Using the Statistical Chart

To set up a Statistical chart:

  1. Create an OCStatistic object somewhere.

  2. Create a data buffer (optional).

  3. Initialize the data buffer with your data.

  4. Call SetData() to put the data into your OCStatistic instance.

  5. Call SetupComponent() to create the default component for the internal SRGraph instance.

  6. Call SetStep() to set m_dStep.

  7. Call SetDataDivision() to set the number of divisions for the histogram.

  8. Finally, call ProcessData() to perform the analysis.

  9. In your OnDraw() function call the DrawComponentList() function of OCStatistic's internal SRGraph object.

For example:

Figure 134 shows an example of a Statistical chart.

Figure 134: Sample Statistical 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.