class KPlotWidget


Table of contents
Modules
kdeui Classes
All Classes
Module kdeui
Namespace global
Class KPlotWidget
Inherits QFrame

KPlotWidget

Generic data plotting widget.

Widget for drawing plots. The basic idea behind KPlotWidget is that you don't have to worry about any transformation from your data's natural units to screen pixel coordinates; this is handled internally by the widget.

Data to be plotted are represented by one or more instances of KPlotObject. KPlotObject contains a list of QPointFs to be plotted (again, in the data's natural units), as well as information about how the data are to be rendered in the plot (i.e., as separate points or connected by lines? With what color and point style? etc). See KPlotObject for more information.

KPlotWidget automatically adds axis labels with tickmarks and tick labels. These are encapsulated in the KPlotAxis class. All you have to do is set the limits of the plotting area in data units, and KPlotWidget wil figure out the optimal positions and labels for the tickmarks on the axes.

Example of usage:

kpw = new KPlotWidget( parent );
// setting our limits for the plot
kpw->setLimits( 1.0, 5.0, 1.0, 25.0 );

// creating a plot object whose points are connected by red lines ... kpo = new KPlotObject( Qt.red, KPlotObject.Lines ); // ... adding some points to it ... for ( float x = 1.0; x <= 5.0; x += 0.1 ) x );

// ... and adding the object to the plot widget kpw->addPlotObject( kpo );

KPlotWidget will take care of the objects added to it, so when clearing the objects list (eg with removeAllPlotObjects()) any previous reference to a KPlotObject already added to a KPlotWidget will be invalid.

Author Jason Harris Version: 1.1



enums

enum details

methods