Reference documentation
Public Member Functions | List of all members
RadialAxis Class Reference

The Thistle::RadialAxis class provides a coordinate system for Thistle::RadialChart. More...

Inheritance diagram for RadialAxis:
AbstractAxis

Public Member Functions

 RadialAxis ()
 Constructs a RadialAxis instance.
 
 ~RadialAxis ()
 Destructor.
 
qreal centerHoleDiam () const
 Returns the diameter of the center hole. More...
 
virtual QPointF origin () const
 Returns the origin of the coordinate system.
 
virtual void paintBack (QPainter &painter) const
 Paints the background of the axis such as ticks.
 
virtual void paintFront (QPainter &painter) const
 Paints the foreground of the axis such as labels.
 
qreal startAngle () const
 Returns the angle used for the first value.
 
virtual qreal stepSize () const
 Returns the distance in pixel between two steps.
 
virtual void update ()
 Updates the mathematical equation used to calculate the coordinates.
 
virtual QPointF valueToPoint (qreal value, int axisNumber) const
 Returns the coordinates as a QPointF for the given value. More...
 
virtual QRect valueToRect (qreal value) const
 Returns the coordinates as a QRect for the given value. More...
 
- Public Member Functions inherited from AbstractAxis
QPen axisPen () const
 Returns the QPen used to paint the axis.
 
void calculateBounds ()
 Calculates the model data bounds. More...
 
long calculateOrder (qreal value) const
 Calculates the order of the given value.
 
QRect & chartRect ()
 Returns the bounding rect where the whole chart should be painted.
 
QFont font () const
 Returns the font using to write labels on axis.
 
qreal max () const
 Returns the maximum value in the model data.
 
qreal maxBound () const
 Returns the maximum bound for model data.
 
qreal min () const
 Returns the minimum value in the model data.
 
qreal minBound () const
 Returns the minimum bound for model data.
 
QAbstractItemModel * model () const
 Returns the QAbstractItemModel used by the chart.
 
int nbDigits () const
 Returns the number of digits allowed to paint the Y-axis values.
 
int nbTicks () const
 Returns the number of ticks.
 
long order () const
 Returns the values order.
 
void setAxisPen (const QPen &p)
 Sets the QPen used to draw axis.
 
void setChartRect (const QRect &r)
 Sets the bounding rect where the whole chart should be painted.
 
void setFont (const QFont &f)
 Sets the QFont used to write the labels.
 
void setMax (qreal b)
 Sets the maximum value in the model data.
 
void setMaxBound (qreal b)
 Sets the maximum bound of the model data.
 
void setMin (qreal b)
 Sets the minimum value in the model data.
 
void setMinBound (qreal b)
 Sets the minimum bound of the model data.
 
void setModel (QAbstractItemModel *m)
 Sets the QAbstractItemModel to use. More...
 
void setNbDigits (int n)
 Sets the number of digits for the labels on the Y axis.
 
void setNbTicks (int n)
 Sets the mumber of ticks to paint.
 
void setOrder (long o)
 Sets the order of the model data.
 
void setTextPen (const QPen &p)
 Sets the QPen used to write labels.
 
void setTickPen (const QPen &p)
 Sets the QPen used to draw the ticks.
 
void setTickSize (qreal t)
 Sets the tick size on Y-axis.
 
void setValuesRect (const QRect &r)
 Sets the bounding rect where the items should be painted.
 
void setXLabelsLength (int l)
 Sets the maximum length allowed to paint the labels on the X-axis.
 
void setYLabelsLength (int l)
 Sets the maximum length allowed to paint the labels on the X-axis.
 
QPen textPen () const
 Returns the QPen used to write labels.
 
QPen tickPen () const
 Returns the QPen used to paint the ticks.
 
qreal tickSize () const
 Returns the tick size on Y-axis.
 
QRect & valuesRect ()
 Returns the bounding rect where the items should be painted.
 
qreal xLabelsLength () const
 Returns the maximum length allowed to paint the labels on the X-axis.
 
qreal yLabelsLength () const
 Returns the maximum length in pixels allowed to paint the labels on the Y-axis.
 

Detailed Description

The Thistle::RadialAxis class provides a coordinate system for Thistle::RadialChart.

The Thistle::RadialAxis class provides a coordinate system that specifies each point uniquely in a Thistle::RadialChart by (X,Y) coordinates. It also paints the axis in the view.

Member Function Documentation

qreal centerHoleDiam ( ) const

Returns the diameter of the center hole.

See the Thistle::RadialChart representation.

QPointF valueToPoint ( qreal  value,
int  axisNumber 
) const
virtual

Returns the coordinates as a QPointF for the given value.

The axisNumber identifier specifies the axis to use (a Thistle::RadialChart uses an axis by row ).

Implements AbstractAxis.

QRect valueToRect ( qreal  value) const
virtual

Returns the coordinates as a QRect for the given value.

This QRect will be used to paint an ellipse.