kchart

#include <KDChart.h>

Static Public Member Functions

static bool setupGeometry (TQPainter *painter, KDChartParams *params, KDChartTableDataBase *data, const TQRect &drawRect)
static bool painterToDrawRect (TQPainter *painter, TQRect &drawRect)
static void paint (TQPainter *, KDChartParams *, KDChartTableDataBase *, KDChartDataRegionList *regions=0, const TQRect *rect=0, bool mustCalculateGeometry=true)
static void print (TQPainter *, KDChartParams *, KDChartTableDataBase *, KDChartDataRegionList *regions=0, const TQRect *rect=0, bool mustCalculateGeometry=true)

Friends

void cleanupPainter ()

Detailed Description

Provides a single entry-point to the charting engine for applications that wish to provide their own TQPainter.

It is not useful to instantiate this class as it contains static methods only.

Note
If for some reason you are NOT using the KDChartWidget class but calling the painting methods of KDChart directly, you probably will also use the KDChartDataRegionList class: This class is derived from TQPtrList, so all of the TQt documentation for this class is valid for KDChartDataRegionList too, e.g. freeing of the pointers stored can either be done automatically or manually - so PLEASE take the time to read the reference information for this class!
See also
KDChartWidget, KDChartDataRegionList

Definition at line 55 of file KDChart.h.

Member Function Documentation

◆ paint()

void KDChart::paint ( TQPainter * painter,
KDChartParams * paraParams,
KDChartTableDataBase * paraData,
KDChartDataRegionList * regions = 0,
const TQRect * rect = 0,
bool mustCalculateGeometry = true )
static

Paints a chart with the specified parameters on the specified painter.

Note
If you are passing regions pointer, KD Chart will call the clear() method on it, to delete any regions that might still be registered from previous painting. Make sure to copy any regions information into your own, private data structure, in case you need to keep track of region information, that was valid for such previous times.
Parameters
painterthe TQPainter onto which the chart should be painted
paramsthe parameters defining the chart
datathe data that should be displayed as a chart
regionsif not null, this points to a KDChartDataRegionList that will be filled with the regions of the data segments. This information is needed internally for both recognizing the data segment when reporting mouse clicks and for finding the correct position to draw the respective data value texts.
rectthe position and size of the drawing area to be used, if this parameter is zero the painter's device metrics will be used.
mustCalculateGeometrymay be set to false if paint() is called immediately after a previous call of setupGeometry() to save some time in case you have specified a lot of data cells.

Definition at line 256 of file KDChart.cpp.

◆ painterToDrawRect()

bool KDChart::painterToDrawRect ( TQPainter * painter,
TQRect & drawRect )
static

Calculates the drawing area from a given TQPainter.

Use this function to get a TQRect that you may pass to KDChart::setupGeometry() if you need to know the positions and sizes of the axis areas and/or the data area before drawing the chart. After calling KDChart::setupGeometry() you may use KDChartParams::axisArea() and/or KDChartParams::dataArea() to retrieve the desired information.

Returns
True if the painter was valid and the drawing area could be calculated successfully, else false.

Definition at line 122 of file KDChart.cpp.

◆ print()

void KDChart::print ( TQPainter * painter,
KDChartParams * params,
KDChartTableDataBase * data,
KDChartDataRegionList * regions = 0,
const TQRect * rect = 0,
bool mustCalculateGeometry = true )
static

Paints a chart with the specified parameters on the specified painter which should use a TQPrinter as it's output device.

This method is provided for your convenience, it behaves like the paint() method described above but additionally it takes care for the output mode flag: Before painting is started the internal optimizeOutputForScreen flag is set to false and after painting is done it is restored to it's previous value.

See also
paint

Definition at line 354 of file KDChart.cpp.

◆ setupGeometry()

bool KDChart::setupGeometry ( TQPainter * painter,
KDChartParams * params,
KDChartTableDataBase * data,
const TQRect & drawRect )
static

Calculates the axis and data area rects of a chart with the specified parameters on the specified painter.

Note
Call this function if you need to know the positions and sizes of the axis areas and/or the data area before drawing the chart. After calling this function you may use KDChartParams::axisArea() and/or KDChartParams::dataArea() to retrieve the desired information.

To get the right drawing area from a given TQPainter please use the static method KDChart::painterToDrawRect().

Parameters
painterthe painter that is eventually to be used for drawing
paramsthe parameters defining the chart
datathe data that should be displayed as a chart
drawRectthe position and size of the drawing area to be used

Definition at line 156 of file KDChart.cpp.

◆ cleanupPainter

void cleanupPainter ( )
friend

A global function that cleans up possible KDChartPainter objects at application shutdown.

Definition at line 375 of file KDChart.cpp.


The documentation for this class was generated from the following files: