kchart
KDChartPiePainter Class Reference
#include <KDChartPiePainter.h>

Detailed Description
A chart painter implementation that can paint pie charts.PENDING(kalle) Write more documentation.
Definition at line 37 of file KDChartPiePainter.h.
Protected Member Functions | |
KDChartPiePainter (KDChartParams *params) | |
virtual | ~KDChartPiePainter () |
virtual void | paintData (QPainter *painter, KDChartTableDataBase *data, bool paint2nd, KDChartDataRegionList *regions=0) |
virtual void | drawOnePie (QPainter *painter, KDChartTableDataBase *data, uint dataset, uint pie, uint chart, uint threeDPieHeight, KDChartDataRegionList *regions=0) |
virtual void | draw3DEffect (QPainter *painter, const QRect &drawPosition, uint dataset, uint pie, uint chart, uint threeDPieHeight, bool explode, QRegion *region=0) |
void | drawStraightEffectSegment (QPainter *painter, const QRect &rect, uint dataset, uint pie, uint chart, int threeDHeight, int angle, QRegion *region=0) |
void | drawArcEffectSegment (QPainter *painter, const QRect &rect, uint dataset, uint pie, uint chart, int threeDHeight, int startAngle, int endAngle, QRegion *region=0) |
virtual QString | fallbackLegendText (uint dataset) const |
virtual uint | numLegendFallbackTexts (KDChartTableDataBase *data) const |
uint | findPieAt (int angle) |
uint | findLeftPie (uint pie) |
uint | findRightPie (uint pie) |
Protected Attributes | |
QMemArray< int > | _startAngles |
QMemArray< int > | _angleLens |
QRect | _position |
int | _size |
int | _numValues |
Friends | |
class | KDChartPainter |
Constructor & Destructor Documentation
KDChartPiePainter::KDChartPiePainter | ( | KDChartParams * | params | ) | [protected] |
Constructor.
Sets up internal data structures as necessary.
- Parameters:
-
params the KDChartParams structure that defines the chart
Definition at line 54 of file KDChartPiePainter.cpp.
KDChartPiePainter::~KDChartPiePainter | ( | ) | [protected, virtual] |
Member Function Documentation
void KDChartPiePainter::paintData | ( | QPainter * | painter, | |
KDChartTableDataBase * | data, | |||
bool | paint2nd, | |||
KDChartDataRegionList * | regions = 0 | |||
) | [protected, virtual] |
Paints the actual data area.
- 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.
Definition at line 81 of file KDChartPiePainter.cpp.
void KDChartPiePainter::drawOnePie | ( | QPainter * | painter, | |
KDChartTableDataBase * | data, | |||
uint | dataset, | |||
uint | pie, | |||
uint | chart, | |||
uint | threeDPieHeight, | |||
KDChartDataRegionList * | regions = 0 | |||
) | [protected, virtual] |
Internal method that draws one of the pies in a pie chart.
- Parameters:
-
painter the QPainter to draw in dataset the dataset to draw the pie for pie the pie to draw the chart to draw the pie in regions a pointer to a list of regions that will be filled with regions representing the data segments, if not null
Definition at line 305 of file KDChartPiePainter.cpp.
void KDChartPiePainter::draw3DEffect | ( | QPainter * | painter, | |
const QRect & | drawPosition, | |||
uint | dataset, | |||
uint | pie, | |||
uint | chart, | |||
uint | threeDHeight, | |||
bool | explode, | |||
QRegion * | region = 0 | |||
) | [protected, virtual] |
Internal method that draws the shadow creating the 3D effect of a pie.
- Parameters:
-
painter the QPainter to draw in rect the position to draw at dataset the dataset to draw the pie for pie the pie to draw the shadow for the chart to draw the pie in threeDHeight the height of the shadow regions a 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 483 of file KDChartPiePainter.cpp.
void KDChartPiePainter::drawStraightEffectSegment | ( | QPainter * | painter, | |
const QRect & | rect, | |||
uint | dataset, | |||
uint | pie, | |||
uint | chart, | |||
int | threeDHeight, | |||
int | angle, | |||
QRegion * | region = 0 | |||
) | [protected] |
Internal method that draws a segment with a straight 3D effect.
- Parameters:
-
painter the QPainter to draw in rect the position to draw at threeDHeight the height of the shadow angle the angle of the segment regions a pointer to a list of regions that will be filled with regions representing the data segments, if not null
Definition at line 681 of file KDChartPiePainter.cpp.
void KDChartPiePainter::drawArcEffectSegment | ( | QPainter * | painter, | |
const QRect & | rect, | |||
uint | dataset, | |||
uint | pie, | |||
uint | chart, | |||
int | threeDHeight, | |||
int | startAngle, | |||
int | endAngle, | |||
QRegion * | region = 0 | |||
) | [protected] |
Internal method that draws a segment with an arc 3D effect.
- Parameters:
-
painter the QPainter to draw in rect the position to draw at threeDHeight the height of the shadow startAngle the starting angle of the segment endAngle the ending angle of the segment regions a pointer to a list of regions that will be filled with regions representing the data segments, if not null
Definition at line 713 of file KDChartPiePainter.cpp.
QString KDChartPiePainter::fallbackLegendText | ( | uint | dataset | ) | const [protected, virtual] |
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:
-
uint dataset 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 813 of file KDChartPiePainter.cpp.
uint KDChartPiePainter::numLegendFallbackTexts | ( | KDChartTableDataBase * | data | ) | const [protected, virtual] |
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 828 of file KDChartPiePainter.cpp.
uint KDChartPiePainter::findPieAt | ( | int | angle | ) | [protected] |
Internal method that finds the pie that is located at the position specified by angle
.
- Parameters:
-
angle the angle at which to search for a pie
- Returns:
- the number of the pie found
Definition at line 750 of file KDChartPiePainter.cpp.
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:
-
pie the pie to start the search from
- Returns:
- the number of the pie to the left of
pie
Definition at line 772 of file KDChartPiePainter.cpp.
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:
-
pie the pie to start the search from
- Returns:
- the number of the pie to the right of
pie
Definition at line 792 of file KDChartPiePainter.cpp.
The documentation for this class was generated from the following files: