kchart
KDChartAxesPainter Class Reference
#include <KDChartAxesPainter.h>
Inheritance diagram for KDChartAxesPainter:

Detailed Description
A common base class for classes that implement chart painters for chart types ith axes.
Definition at line 42 of file KDChartAxesPainter.h.
Static Public Member Functions | |
static void | calculateAbscissaInfos (const KDChartParams ¶ms, const KDChartTableDataBase &data, uint datasetStart, uint datasetEnd, double logWidth, const QRect &dataRect, abscissaInfos &infos) |
static bool | calculateAbscissaAxisValue (const QVariant &value, abscissaInfos &ai, int colNumber, double &xValue) |
static void | saveDrawLine (QPainter &painter, QPoint pA, QPoint pZ, QPen pen) |
static void | calculateLabelTexts (QPainter *painter, const KDChartTableDataBase &data, const KDChartParams ¶ms, uint axisNumber, double averageValueP1000, double delimLen, KDChartAxisParams::AxisPos &basicPos, QPoint &orig, QPoint &dest, double &pXDeltaFactor, double &pYDeltaFactor, double &pXDelimDeltaFaktor, double &pYDelimDeltaFaktor, double &nSubDelimFactor, double &pDelimDelta, double &nTxtHeight, double &pTextsX, double &pTextsY, double &pTextsW, double &pTextsH, int &textAlign, bool &isLogarithmic, bool &isDateTime, bool &autoDtLabels, QDateTime &dtLow, QDateTime &dtHigh, KDChartAxisParams::ValueScale &dtDeltaScale, bool adjustTheValues=false, double trueDelta=0.0, double trueDeltaPix=0.0) |
static void | calculateBasicTextFactors (double nTxtHeight, const KDChartAxisParams ¶, double averageValueP1000, KDChartAxisParams::AxisPos basicPos, const QPoint &orig, double delimLen, uint nLabels, double &pDelimDelta, double &pTextsX, double &pTextsY, double &pTextsW, double &pTextsH, int &textAlign) |
static QString | truncateBehindComma (const double nVal, const int behindComma, const double nDelta, int &trueBehindComma) |
static QString | applyLabelsFormat (const double nVal, int divPow10, int behindComma, double nDelta, int &trueBehindComma, const QString &decimalPoint, const QString &thousandsPoint, const QString &prefix, const QString &postfix, int totalLen, const QChar &padFill, bool blockAlign) |
static void | calculateOrdinateFactors (const KDChartAxisParams ¶, bool bLogarithmic, double &nDist, double &nDivisor, double &nRound, double &nDelta, double &nSubDelimFactor, double &nLow, double &nHigh, bool findNextRound=false) |
static void | dtAddSecs (const QDateTime &org, const int secs, QDateTime &dest) |
static void | dtAddDays (const QDateTime &org, const int days, QDateTime &dest) |
static void | dtAddMonths (const QDateTime &org, const int months, QDateTime &dest) |
static void | dtAddYears (const QDateTime &org, const int years, QDateTime &dest) |
Protected Member Functions | |
KDChartAxesPainter (KDChartParams *params) | |
virtual | ~KDChartAxesPainter () |
virtual void | paintAxes (QPainter *painter, KDChartTableDataBase *data) |
virtual void | paintData (QPainter *painter, KDChartTableDataBase *data, bool paint2nd, KDChartDataRegionList *regions) |
virtual bool | isNormalMode () const =0 |
virtual int | clipShiftUp (bool normalMode, double areaWidthP1000) const =0 |
virtual void | specificPaintData (QPainter *painter, const QRect &ourClipRect, KDChartTableDataBase *data, KDChartDataRegionList *regions, const KDChartAxisParams *axisPara, bool bNormalMode, uint chart, double logWidth, double areaWidthP1000, double logHeight, double axisYOffset, double minColumnValue, double maxColumnValue, double columnValueDistance, uint chartDatasetStart, uint chartDatasetEnd, uint datasetStart, uint datasetEnd)=0 |
virtual bool | calculateAllAxesLabelTextsAndCalcValues (QPainter *painter, KDChartTableDataBase *data, double areaWidthP1000, double areaHeightP1000, double &delimLen) |
Classes | |
struct | abscissaInfos |
Constructor & Destructor Documentation
KDChartAxesPainter::KDChartAxesPainter | ( | KDChartParams * | params | ) | [protected] |
Constructor.
Sets up internal data structures as necessary.
- Parameters:
-
params the KDChartParams structure that defines the chart
Definition at line 64 of file KDChartAxesPainter.cpp.
KDChartAxesPainter::~KDChartAxesPainter | ( | ) | [protected, virtual] |
Member Function Documentation
void KDChartAxesPainter::calculateBasicTextFactors | ( | double | nTxtHeight, | |
const KDChartAxisParams & | para, | |||
double | averageValueP1000, | |||
KDChartAxisParams::AxisPos | basicPos, | |||
const QPoint & | orig, | |||
double | delimLen, | |||
uint | nLabels, | |||
double & | pDelimDelta, | |||
double & | pTextsX, | |||
double & | pTextsY, | |||
double & | pTextsW, | |||
double & | pTextsH, | |||
int & | textAlign | |||
) | [static] |
Calculates some label text factors needed by function calculateLabelTexts()
.
- Note:
- When calling this function the actual area size for this axis must be set, this means you may only call it when
KDChartPainter::setupGeometry()
has been called before.
- Parameters:
-
nTxtHeight the text height to be used for calculating the return values para the KDChartAxisParams that were specified for this axis averageValueP1000 (average height+width of the prtbl. area) / 1000 basicPos the basic axis position returned by KDChartAxisParams::basicAxisPos() orig the axis start point delimLen the length of one delimiter mark nLabels the number of labels to be shown at this axis (all others) the reference parameters to be returned by this function
Definition at line 3486 of file KDChartAxesPainter.cpp.
void KDChartAxesPainter::calculateLabelTexts | ( | QPainter * | painter, | |
const KDChartTableDataBase & | data, | |||
const KDChartParams & | params, | |||
uint | axisNumber, | |||
double | averageValueP1000, | |||
double | delimLen, | |||
KDChartAxisParams::AxisPos & | basicPos, | |||
QPoint & | orig, | |||
QPoint & | dest, | |||
double & | pXDeltaFactor, | |||
double & | pYDeltaFactor, | |||
double & | pXDelimDeltaFaktor, | |||
double & | pYDelimDeltaFaktor, | |||
double & | nSubDelimFactor, | |||
double & | pDelimDelta, | |||
double & | nTxtHeight, | |||
double & | pTextsX, | |||
double & | pTextsY, | |||
double & | pTextsW, | |||
double & | pTextsH, | |||
int & | textAlign, | |||
bool & | isLogarithmic, | |||
bool & | isDateTime, | |||
bool & | autoDtLabels, | |||
QDateTime & | dtLow, | |||
QDateTime & | dtHigh, | |||
KDChartAxisParams::ValueScale & | dtDeltaScale, | |||
bool | adjustTheValues = false , |
|||
double | trueDelta = 0.0 , |
|||
double | trueDeltaPix = 0.0 | |||
) | [static] |
Calculates the actual label texts for one axis.
- Note:
- When calling this function the actual area size for this axis must be set, this means you may only call it when
KDChartPainter::setupGeometry()
has been called before.
- Parameters:
-
painter the QPainter onto which the chart should be painted data the data that will be displayed as a chart params the KDChartParams that were specified globally axisNumber the number of this axis (used in some params structures) averageValueP1000 (average height+width of the prtbl. area) / 1000 basicPos the basic axis position returned by KDChartAxisParams::basicAxisPos() orig the axis start point delimLen the length of one delimiter mark (all others) the reference parameters to be returned by this function
Definition at line 1988 of file KDChartAxesPainter.cpp.
void KDChartAxesPainter::calculateOrdinateFactors | ( | const KDChartAxisParams & | para, | |
bool | isLogarithmic, | |||
double & | nDist, | |||
double & | nDivisor, | |||
double & | nRound, | |||
double & | nDelta, | |||
double & | nSubDelimFactor, | |||
double & | nLow, | |||
double & | nHigh, | |||
bool | findNextRound = false | |||
) | [static] |
Calculates the factors to be used for calculating ordinate labels texts.
- Note:
- This function is reserved for internal use.
Definition at line 3709 of file KDChartAxesPainter.cpp.
void KDChartAxesPainter::paintAxes | ( | QPainter * | painter, | |
KDChartTableDataBase * | data | |||
) | [protected, virtual] |
Paints the actual axes areas.
- Parameters:
-
painter the QPainter onto which the chart should be painted data the data that will be displayed as a chart
Reimplemented from KDChartPainter.
Definition at line 368 of file KDChartAxesPainter.cpp.
void KDChartAxesPainter::paintData | ( | QPainter * | painter, | |
KDChartTableDataBase * | data, | |||
bool | paint2nd, | |||
KDChartDataRegionList * | regions | |||
) | [protected, virtual] |
Paints the actual data area and registers the region for the data points if regions is not 0.
- Parameters:
-
painter the QPainter onto which the chart should be painted data the data that will be displayed as a chart paint2nd specifies whether the main chart or the additional chart is to be drawn now regions a pointer to a list of regions that will be filled with regions representing the data segments, if not null
Implements KDChartPainter.
Reimplemented in KDChartAreaPainter, and KDChartLinesPainter.
Definition at line 4272 of file KDChartAxesPainter.cpp.
QString KDChartAxesPainter::truncateBehindComma | ( | const double | nVal, | |
const int | behindComma, | |||
const double | nDelta, | |||
int & | trueBehindComma | |||
) | [static] |
Takes double nVal
and returns a QString showing the amount of digits behind the comma that was specified by behindComma
(or calculated automatically by removing trailing zeroes, resp.
). To make sure the resulting string looks fine together with other strings of the same label row please specify nDelta
indicating the step width from one label text to the other. To prevent the function from having to re-calculate the number of digits to keep behind the comma, provide it with a temporary helper variable "trueBehindComma" that has to be initialized with a value smaller than zero.
- Note:
- This function is reserved for internal use.
Definition at line 3593 of file KDChartAxesPainter.cpp.
The documentation for this class was generated from the following files: