kchart

KDChartAxesPainter Class Referenceabstract

#include <KDChartAxesPainter.h>

Inheritance diagram for KDChartAxesPainter:
KDChartPainter KDChartBWPainter KDChartBarPainter KDChartHiLoPainter KDChartLinesPainter KDChartAreaPainter

Static Public Member Functions

static void calculateAbscissaInfos (const KDChartParams &params, const KDChartTableDataBase &data, uint datasetStart, uint datasetEnd, double logWidth, const TQRect &dataRect, abscissaInfos &infos)
 
static bool calculateAbscissaAxisValue (const TQVariant &value, abscissaInfos &ai, int colNumber, double &xValue)
 
static void saveDrawLine (TQPainter &painter, TQPoint pA, TQPoint pZ, TQPen pen)
 
static void calculateLabelTexts (TQPainter *painter, const KDChartTableDataBase &data, const KDChartParams &params, uint axisNumber, double averageValueP1000, double delimLen, KDChartAxisParams::AxisPos &basicPos, TQPoint &orig, TQPoint &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, TQDateTime &dtLow, TQDateTime &dtHigh, KDChartAxisParams::ValueScale &dtDeltaScale, bool adjustTheValues=false, double trueDelta=0.0, double trueDeltaPix=0.0)
 
static void calculateBasicTextFactors (double nTxtHeight, const KDChartAxisParams &para, double averageValueP1000, KDChartAxisParams::AxisPos basicPos, const TQPoint &orig, double delimLen, uint nLabels, double &pDelimDelta, double &pTextsX, double &pTextsY, double &pTextsW, double &pTextsH, int &textAlign)
 
static TQString truncateBehindComma (const double nVal, const int behindComma, const double nDelta, int &trueBehindComma)
 
static TQString applyLabelsFormat (const double nVal, int divPow10, int behindComma, double nDelta, int &trueBehindComma, KDChartEnums::NumberNotation notation, const TQString &decimalPoint, const TQString &thousandsPoint, const TQString &prefix, const TQString &postfix, int totalLen, const TQChar &padFill, bool blockAlign)
 
static void calculateOrdinateFactors (const KDChartAxisParams &para, bool bLogarithmic, double &nDist, double &nDivisor, double &nRound, double &nDelta, double &nSubDelimFactor, double &nLow, double &nHigh, bool findNextRound=false)
 
static void dtAddSecs (const TQDateTime &org, const int secs, TQDateTime &dest)
 
static void dtAddDays (const TQDateTime &org, const int days, TQDateTime &dest)
 
static void dtAddMonths (const TQDateTime &org, const int months, TQDateTime &dest)
 
static void dtAddYears (const TQDateTime &org, const int years, TQDateTime &dest)
 
- Static Public Member Functions inherited from KDChartPainter
static KDChartPainter * create (KDChartParams *params, bool make2nd=false)
 
static void registerPainter (const TQString &painterName, KDChartPainter *painter)
 
static void unregisterPainter (const TQString &painterName)
 
static void drawMarker (TQPainter *painter, int style, const TQColor &color, const TQPoint &p, const TQSize &size, uint align=TQt::AlignCenter)
 

Protected Member Functions

 KDChartAxesPainter (KDChartParams *params)
 
virtual ~KDChartAxesPainter ()
 
virtual void paintAxes (TQPainter *painter, KDChartTableDataBase *data)
 
virtual void paintData (TQPainter *painter, KDChartTableDataBase *data, bool paint2nd, KDChartDataRegionList *regions)
 
virtual bool isNormalMode () const =0
 
virtual int clipShiftUp (bool normalMode, double areaWidthP1000) const =0
 
virtual void specificPaintData (TQPainter *painter, const TQRect &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 (TQPainter *painter, KDChartTableDataBase *data, double areaWidthP1000, double areaHeightP1000, double &delimLen)
 
- Protected Member Functions inherited from KDChartPainter
 KDChartPainter (KDChartParams *)
 
virtual void paintArea (TQPainter *painter, uint area, KDChartDataRegionList *regions=0, uint dataRow=0, uint dataCol=0, uint data3rd=0)
 
virtual void paintDataRegionAreas (TQPainter *painter, KDChartDataRegionList *regions)
 
virtual void paintAreaWithGap (TQPainter *painter, TQRect rect, const KDChartParams::KDChartFrameSettings &settings)
 
virtual void paintCustomBoxes (TQPainter *painter, KDChartDataRegionList *regions)
 
virtual void paintDataValues (TQPainter *painter, KDChartTableDataBase *data, KDChartDataRegionList *regions)
 
virtual void paintLegend (TQPainter *painter, KDChartTableDataBase *data)
 
virtual void paintHeaderFooter (TQPainter *painter, KDChartTableDataBase *data)
 
virtual bool axesOverlapping (int axis1, int axis2)
 
virtual void findChartDatasets (KDChartTableDataBase *data, bool paint2nd, uint chart, uint &chartDatasetStart, uint &chartDatasetEnd)
 
virtual void calculateAllAxesRects (TQPainter *painter, bool finalPrecision, KDChartTableDataBase *data)
 
virtual TQPoint calculateAnchor (const KDChartCustomBox &box, KDChartDataRegionList *regions=0) const
 
virtual TQRect calculateAreaRect (bool &allCustomBoxes, uint area, uint dataRow, uint dataCol, uint data3rd, KDChartDataRegionList *regions) const
 
virtual TQString fallbackLegendText (uint dataset) const
 
virtual uint numLegendFallbackTexts (KDChartTableDataBase *data) const
 
const KDChartParams * params () const
 
virtual void drawExtraLinesAndMarkers (KDChartPropertySet &propSet, const TQPen &defaultPen, const KDChartParams::LineMarkerStyle &defaultMarkerStyle, int myPointX, int myPointY, TQPainter *painter, const KDChartAxisParams *abscissaPara, const KDChartAxisParams *ordinatePara, const double areaWidthP1000, const double areaHeightP1000, bool bDrawInFront=false)
 

Additional Inherited Members

- Public Member Functions inherited from KDChartPainter
virtual ~KDChartPainter ()
 
virtual void setupGeometry (TQPainter *painter, KDChartTableDataBase *data, const TQRect &rect)
 
virtual void paint (TQPainter *painter, KDChartTableDataBase *data, bool paintFirst, bool paintLast, KDChartDataRegionList *regions=0, const TQRect *rect=0, bool mustCalculateGeometry=true)
 
virtual TQRect outermostRect () const
 
- Static Protected Member Functions inherited from KDChartPainter
static TQPoint pointOnCircle (const TQRect &rect, double angle)
 
static void makeArc (TQPointArray &points, const TQRect &rect, double startAngle, double angles)
 
static KDChartDataRegion * drawMarker (TQPainter *painter, const KDChartParams *params, double areaWidthP1000, double areaHeightP1000, int deltaX, int deltaY, int style, const TQColor &color, const TQPoint &p, uint dataset, uint value, uint chart, KDChartDataRegionList *regions=0, int *width=0, int *height=0, uint align=TQt::AlignCenter)
 
- Protected Attributes inherited from KDChartPainter
TQRect _outermostRect
 
TQRect _innermostRect
 
TQRect _dataRect
 
TQRect _axesRect
 
TQRect _legendRect
 
int _legendEMSpace
 
int _legendSpacing
 
int _legendHeight
 
int _legendLeading
 
KDChartTextPiece * _legendTitle
 
int _numLegendTexts
 
int _logicalWidth
 
int _logicalHeight
 
double _areaWidthP1000
 
double _areaHeightP1000
 
TQMap< int, TQString > _legendTexts
 
internal__KDChart__CalcValues calcVal [KDCHART_MAX_AXES]
 

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.

Constructor & Destructor Documentation

◆ KDChartAxesPainter()

KDChartAxesPainter::KDChartAxesPainter ( KDChartParams *  params)
protected

Constructor.

Sets up internal data structures as necessary.

Parameters
paramsthe KDChartParams structure that defines the chart

Definition at line 64 of file KDChartAxesPainter.cpp.

◆ ~KDChartAxesPainter()

KDChartAxesPainter::~KDChartAxesPainter ( )
protectedvirtual

Destructor.

Definition at line 75 of file KDChartAxesPainter.cpp.

Member Function Documentation

◆ applyLabelsFormat()

TQString KDChartAxesPainter::applyLabelsFormat ( const double  nVal,
int  divPow10,
int  behindComma,
double  nDelta,
int &  trueBehindComma,
KDChartEnums::NumberNotation  notation,
const TQString &  decimalPoint,
const TQString &  thousandsPoint,
const TQString &  prefix,
const TQString &  postfix,
int  totalLen,
const TQChar &  padFill,
bool  blockAlign 
)
static

Definition at line 3669 of file KDChartAxesPainter.cpp.

◆ calculateAbscissaAxisValue()

bool KDChartAxesPainter::calculateAbscissaAxisValue ( const TQVariant &  value,
abscissaInfos &  ai,
int  colNumber,
double &  xValue 
)
static

Definition at line 4231 of file KDChartAxesPainter.cpp.

◆ calculateAbscissaInfos()

void KDChartAxesPainter::calculateAbscissaInfos ( const KDChartParams &  params,
const KDChartTableDataBase &  data,
uint  datasetStart,
uint  datasetEnd,
double  logWidth,
const TQRect &  dataRect,
abscissaInfos &  infos 
)
static

Definition at line 4034 of file KDChartAxesPainter.cpp.

◆ calculateAllAxesLabelTextsAndCalcValues()

bool KDChartAxesPainter::calculateAllAxesLabelTextsAndCalcValues ( TQPainter *  painter,
KDChartTableDataBase *  data,
double  areaWidthP1000,
double  areaHeightP1000,
double &  delimLen 
)
protectedvirtual

Reimplemented from KDChartPainter.

Definition at line 135 of file KDChartAxesPainter.cpp.

◆ calculateBasicTextFactors()

void KDChartAxesPainter::calculateBasicTextFactors ( double  nTxtHeight,
const KDChartAxisParams &  para,
double  averageValueP1000,
KDChartAxisParams::AxisPos  basicPos,
const TQPoint &  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
nTxtHeightthe text height to be used for calculating the return values
parathe KDChartAxisParams that were specified for this axis
averageValueP1000(average height+width of the prtbl. area) / 1000
basicPosthe basic axis position returned by KDChartAxisParams::basicAxisPos()
origthe axis start point
delimLenthe length of one delimiter mark
nLabelsthe number of labels to be shown at this axis
(allothers) the reference parameters to be returned by this function

Definition at line 3489 of file KDChartAxesPainter.cpp.

◆ calculateLabelTexts()

void KDChartAxesPainter::calculateLabelTexts ( TQPainter *  painter,
const KDChartTableDataBase &  data,
const KDChartParams &  params,
uint  axisNumber,
double  averageValueP1000,
double  delimLen,
KDChartAxisParams::AxisPos &  basicPos,
TQPoint &  orig,
TQPoint &  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,
TQDateTime &  dtLow,
TQDateTime &  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
painterthe TQPainter onto which the chart should be painted
datathe data that will be displayed as a chart
paramsthe KDChartParams that were specified globally
axisNumberthe number of this axis (used in some params structures)
averageValueP1000(average height+width of the prtbl. area) / 1000
basicPosthe basic axis position returned by KDChartAxisParams::basicAxisPos()
origthe axis start point
delimLenthe length of one delimiter mark
(allothers) the reference parameters to be returned by this function

Definition at line 1967 of file KDChartAxesPainter.cpp.

◆ calculateOrdinateFactors()

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 3753 of file KDChartAxesPainter.cpp.

◆ dtAddDays()

void KDChartAxesPainter::dtAddDays ( const TQDateTime &  org,
const int  days,
TQDateTime &  dest 
)
static

Definition at line 3955 of file KDChartAxesPainter.cpp.

◆ dtAddMonths()

void KDChartAxesPainter::dtAddMonths ( const TQDateTime &  org,
const int  months,
TQDateTime &  dest 
)
static

Definition at line 3993 of file KDChartAxesPainter.cpp.

◆ dtAddSecs()

void KDChartAxesPainter::dtAddSecs ( const TQDateTime &  org,
const int  secs,
TQDateTime &  dest 
)
static

Definition at line 3920 of file KDChartAxesPainter.cpp.

◆ dtAddYears()

void KDChartAxesPainter::dtAddYears ( const TQDateTime &  org,
const int  years,
TQDateTime &  dest 
)
static

Definition at line 4019 of file KDChartAxesPainter.cpp.

◆ paintAxes()

void KDChartAxesPainter::paintAxes ( TQPainter *  painter,
KDChartTableDataBase *  data 
)
protectedvirtual

Paints the actual axes areas.

Parameters
painterthe TQPainter onto which the chart should be painted
datathe data that will be displayed as a chart

Reimplemented from KDChartPainter.

Definition at line 335 of file KDChartAxesPainter.cpp.

◆ paintData()

void KDChartAxesPainter::paintData ( TQPainter *  painter,
KDChartTableDataBase *  data,
bool  paint2nd,
KDChartDataRegionList *  regions 
)
protectedvirtual

Paints the actual data area and registers the region for the data points if regions is not 0.

Parameters
painterthe TQPainter onto which the chart should be painted
datathe data that will be displayed as a chart
paint2ndspecifies whether the main chart or the additional chart is to be drawn now
regionsa 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 4330 of file KDChartAxesPainter.cpp.

◆ saveDrawLine()

void KDChartAxesPainter::saveDrawLine ( TQPainter &  painter,
TQPoint  pA,
TQPoint  pZ,
TQPen  pen 
)
static

Definition at line 3903 of file KDChartAxesPainter.cpp.

◆ specificPaintData()

virtual void KDChartAxesPainter::specificPaintData ( TQPainter *  painter,
const TQRect &  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 
)
protectedpure virtual

Implemented in KDChartBWPainter, and KDChartLinesPainter.

◆ truncateBehindComma()

TQString KDChartAxesPainter::truncateBehindComma ( const double  nVal,
const int  behindComma,
const double  nDelta,
int &  trueBehindComma 
)
static

Takes double nVal and returns a TQString 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 3596 of file KDChartAxesPainter.cpp.


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