Chapter 13, "Optimizing Performance," discussed how to optimize chart performance in detail, but this chapter briefly looks at why those optimizations work.
Turn off feedback logging when it's not needed. This stops the system from creating and destroying feedback objects. A big performance drop can be seen when the chart system reclaims these areas before the draw cycle begins. If you have large amounts of data and still need to use feedback to manipulate the data, consider only turning on chart feedback once the chart has been zoomed in to show at most a few hundred items.
Set a maximum and minimum data range for your chart. For most graph types, fixed range settings prevent the data from being scanned before each draw cycle. For example, if your application measures water temperature at atmospheric pressures, you are unlikely to need a data range greater than from zero to one hundred degrees Celsius.
Use data culling. Specifically aimed at Line charts, data culling limits how much data is displayed according to how many pixels are available across the screen. For example, if a window is only 500 pixels wide but the chart has 2000 data indices, then only one out of four data points are plotted when data culling is enabled. The non-displayed data values appear as the display is zoomed in and the number of points to be plotted (in scope) becomes less than the number of pixels.
Turn off background drawing. This is not in fact the most problematical or time-consuming operation but it does involve the CPU in shifting many thousands of bytes of image data from place to place. Background drawing eliminates flicker and usually provides a more pleasing visual effect. Turn off background drawing only if your application is very time-critical.
Use the Dynamic or Structure data storage models. These data models use direct access to data via pointers and avoid the list access overhead incurred by the Standard data model.
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.