kchart

#include <KDChartPiePainter.h>

Inheritance diagram for KDChartPiePainter:
KDChartPainter

Protected Member Functions

 KDChartPiePainter (KDChartParams *params)
 
virtual ~KDChartPiePainter ()
 
virtual void paintData (TQPainter *painter, KDChartTableDataBase *data, bool paint2nd, KDChartDataRegionList *regions=0)
 
virtual void drawOnePie (TQPainter *painter, KDChartTableDataBase *data, uint dataset, uint pie, uint chart, uint threeDPieHeight, KDChartDataRegionList *regions=0)
 
virtual void draw3DEffect (TQPainter *painter, const TQRect &drawPosition, uint dataset, uint pie, uint chart, uint threeDPieHeight, bool explode, TQRegion *region=0)
 
void drawStraightEffectSegment (TQPainter *painter, const TQRect &rect, uint dataset, uint pie, uint chart, int threeDHeight, int angle, TQRegion *region=0)
 
void drawArcEffectSegment (TQPainter *painter, const TQRect &rect, uint dataset, uint pie, uint chart, int threeDHeight, int startAngle, int endAngle, TQRegion *region=0)
 
virtual TQString fallbackLegendText (uint dataset) const
 
virtual uint numLegendFallbackTexts (KDChartTableDataBase *data) const
 
uint findPieAt (int angle)
 
uint findLeftPie (uint pie)
 
uint findRightPie (uint pie)
 
- 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 paintAxes (TQPainter *painter, KDChartTableDataBase *data)
 
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
 
const KDChartParams * params () const
 
virtual bool calculateAllAxesLabelTextsAndCalcValues (TQPainter *painter, KDChartTableDataBase *data, double areaWidthP1000, double areaHeightP1000, double &delimLen)
 
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)
 

Protected Attributes

TQMemArray< int > _startAngles
 
TQMemArray< int > _angleLens
 
TQRect _position
 
int _size
 
int _numValues
 
- 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]
 

Friends

class KDChartPainter
 

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 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)
 
- 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)
 

Detailed Description

A chart painter implementation that can paint pie charts.

PENDING(kalle) Write more documentation.

Definition at line 37 of file KDChartPiePainter.h.

Constructor & Destructor Documentation

◆ KDChartPiePainter()

KDChartPiePainter::KDChartPiePainter ( KDChartParams *  params)
protected

Constructor.

Sets up internal data structures as necessary.

Parameters
paramsthe KDChartParams structure that defines the chart

Definition at line 54 of file KDChartPiePainter.cpp.

◆ ~KDChartPiePainter()

KDChartPiePainter::~KDChartPiePainter ( )
protectedvirtual

Destructor.

Definition at line 65 of file KDChartPiePainter.cpp.

Member Function Documentation

◆ draw3DEffect()

void KDChartPiePainter::draw3DEffect ( TQPainter *  painter,
const TQRect &  drawPosition,
uint  dataset,
uint  pie,
uint  chart,
uint  threeDHeight,
bool  explode,
TQRegion *  region = 0 
)
protectedvirtual

Internal method that draws the shadow creating the 3D effect of a pie.

Parameters
painterthe TQPainter to draw in
rectthe position to draw at
datasetthe dataset to draw the pie for
piethe pie to draw the shadow for
thechart to draw the pie in
threeDHeightthe height of the shadow
regionsa pointer to a list of regions that will be filled with regions representing the data segments, if not null

starts and ends in first quadrant, less than 1/4

starts and ends in first quadrant, more than 3/4

starts in first quadrant, ends in second quadrant, less than 1/2

starts in first quadrant, ends in third quadrant

starts in first quadrant, ends in fourth quadrant, more than 3/4

starts in second quadrant, ends in second quadrant, less than 1/4

starts in second quadrant, ends in second quadrant, more than 1/4

starts in third quadrant, ends in third quadrant, less than 1/4

starts in third quadrant, ends in third quadrant, more than 3/4

starts in fourth quadrant, ends in fourth quadrant, less than 1/4

starts in fourth quadrant, ends in fourth quadrant, more than 3/4

Definition at line 477 of file KDChartPiePainter.cpp.

◆ drawArcEffectSegment()

void KDChartPiePainter::drawArcEffectSegment ( TQPainter *  painter,
const TQRect &  rect,
uint  dataset,
uint  pie,
uint  chart,
int  threeDHeight,
int  startAngle,
int  endAngle,
TQRegion *  region = 0 
)
protected

Internal method that draws a segment with an arc 3D effect.

Parameters
painterthe TQPainter to draw in
rectthe position to draw at
threeDHeightthe height of the shadow
startAnglethe starting angle of the segment
endAnglethe ending angle of the segment
regionsa pointer to a list of regions that will be filled with regions representing the data segments, if not null

Definition at line 707 of file KDChartPiePainter.cpp.

◆ drawOnePie()

void KDChartPiePainter::drawOnePie ( TQPainter *  painter,
KDChartTableDataBase *  data,
uint  dataset,
uint  pie,
uint  chart,
uint  threeDPieHeight,
KDChartDataRegionList *  regions = 0 
)
protectedvirtual

Internal method that draws one of the pies in a pie chart.

Parameters
painterthe TQPainter to draw in
datasetthe dataset to draw the pie for
piethe pie to draw
thechart to draw the pie in
regionsa pointer to a list of regions that will be filled with regions representing the data segments, if not null

Definition at line 299 of file KDChartPiePainter.cpp.

◆ drawStraightEffectSegment()

void KDChartPiePainter::drawStraightEffectSegment ( TQPainter *  painter,
const TQRect &  rect,
uint  dataset,
uint  pie,
uint  chart,
int  threeDHeight,
int  angle,
TQRegion *  region = 0 
)
protected

Internal method that draws a segment with a straight 3D effect.

Parameters
painterthe TQPainter to draw in
rectthe position to draw at
threeDHeightthe height of the shadow
anglethe angle of the segment
regionsa pointer to a list of regions that will be filled with regions representing the data segments, if not null

Definition at line 675 of file KDChartPiePainter.cpp.

◆ fallbackLegendText()

TQString KDChartPiePainter::fallbackLegendText ( uint  dataset) const
protectedvirtual

This method is a specialization that returns a fallback legend text appropriate for pies that do not have more than one dataset.

This method is only used when automatic legends are used, because manual and first-column legends do not need fallback texts.

Parameters
uintdataset the dataset number for which to generate a fallback text
Returns
the fallback text to use for describing the specified dataset in the legend

Reimplemented from KDChartPainter.

Definition at line 807 of file KDChartPiePainter.cpp.

◆ findLeftPie()

uint KDChartPiePainter::findLeftPie ( uint  pie)
protected

Internal method that finds the pie that is located to the left of the pie specified by pie.

Parameters
piethe pie to start the search from
Returns
the number of the pie to the left of pie

Definition at line 766 of file KDChartPiePainter.cpp.

◆ findPieAt()

uint KDChartPiePainter::findPieAt ( int  angle)
protected

Internal method that finds the pie that is located at the position specified by angle.

Parameters
anglethe angle at which to search for a pie
Returns
the number of the pie found

Definition at line 744 of file KDChartPiePainter.cpp.

◆ findRightPie()

uint KDChartPiePainter::findRightPie ( uint  pie)
protected

Internal method that finds the pie that is located to the right of the pie specified by pie.

Parameters
piethe pie to start the search from
Returns
the number of the pie to the right of pie

Definition at line 786 of file KDChartPiePainter.cpp.

◆ numLegendFallbackTexts()

uint KDChartPiePainter::numLegendFallbackTexts ( KDChartTableDataBase *  data) const
protectedvirtual

This methods returns the number of elements to be shown in the legend in case fallback texts are used.

This method is only used when automatic legends are used, because manual and first-column legends do not need fallback texts.

Returns
the number of fallback texts to use

Reimplemented from KDChartPainter.

Definition at line 822 of file KDChartPiePainter.cpp.

◆ paintData()

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

Paints the actual data area.

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.

Definition at line 81 of file KDChartPiePainter.cpp.

Friends And Related Symbol Documentation

◆ KDChartPainter

friend class KDChartPainter
friend

Definition at line 39 of file KDChartPiePainter.h.

Member Data Documentation

◆ _angleLens

TQMemArray< int > KDChartPiePainter::_angleLens
protected

Definition at line 76 of file KDChartPiePainter.h.

◆ _numValues

int KDChartPiePainter::_numValues
protected

Definition at line 80 of file KDChartPiePainter.h.

◆ _position

TQRect KDChartPiePainter::_position
protected

Definition at line 78 of file KDChartPiePainter.h.

◆ _size

int KDChartPiePainter::_size
protected

Definition at line 79 of file KDChartPiePainter.h.

◆ _startAngles

TQMemArray< int > KDChartPiePainter::_startAngles
protected

Definition at line 75 of file KDChartPiePainter.h.


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