Wt 3.1.10
|
Abstract base class for MVC-based charts. More...
#include <Wt/Chart/WAbstractChart>
Public Member Functions | |
virtual | ~WAbstractChart () |
Destructor. | |
void | setModel (WAbstractItemModel *model) |
Set the model. | |
WAbstractItemModel * | model () const |
Returns the model. | |
void | setBackground (const WBrush &background) |
Sets a background for the chart. | |
const WBrush & | background () const |
Returns the background of the chart. | |
void | setPalette (WChartPalette *palette) |
Set a palette for the chart. | |
WChartPalette * | palette () const |
Returns the palette for the chart. | |
void | setPlotAreaPadding (int padding, WFlags< Side > sides=All) |
Set an internal margin for the main plot area. | |
int | plotAreaPadding (Side side) const |
Returns the internal margin for the main plot area. | |
void | setTitle (const WString &title) |
Set a chart title. | |
const WString & | title () const |
Return the chart title. | |
void | setTitleFont (const WFont &titleFont) |
Set the font for the chart title. | |
const WFont & | titleFont () const |
Returns the font for the chart title. | |
virtual void | paint (WPainter &painter, const WRectF &rectangle=WRectF()) const =0 |
Paint the chart in a rectangle of the given painter. | |
Private Member Functions | |
virtual void | modelChanged () |
Method called whenever the entire model was changed. | |
virtual void | modelReset () |
Method called whenever the entire model was reset. | |
virtual void | modelColumnsInserted (const WModelIndex &parent, int start, int end)=0 |
Method called when colums have been inserted in the model. | |
virtual void | modelColumnsRemoved (const WModelIndex &parent, int start, int end)=0 |
Method called when colums have been removed from the model. | |
virtual void | modelRowsInserted (const WModelIndex &parent, int start, int end)=0 |
Method called when rows have been inserted from the model. | |
virtual void | modelRowsRemoved (const WModelIndex &parent, int start, int end)=0 |
Method called when rows have been removed from the model. | |
virtual void | modelDataChanged (const WModelIndex &topLeft, const WModelIndex &bottomRight)=0 |
Method called when data has been changed in the model. |
Abstract base class for MVC-based charts.
This is an abstract class and should not be used directly.
As an abstract base for MVC-based charts, this class manages the model setModel() and provides virtual methods that listen to model changes. In addition, it gives access to generic chart properties such as the title setTitle() and title font setTitleFont(), the chart palette setPalette(), plot area padding setPlotAreaPadding(), and the background fill color setBackground().
Styling through CSS is not applicable.
const WBrush& Wt::Chart::WAbstractChart::background | ( | ) | const |
Returns the background of the chart.
WAbstractItemModel* Wt::Chart::WAbstractChart::model | ( | ) | const |
Returns the model.
void Wt::Chart::WAbstractChart::modelChanged | ( | ) | [private, virtual] |
Method called whenever the entire model was changed.
Reimplemented in Wt::Chart::WCartesianChart, and Wt::Chart::WPieChart.
virtual void Wt::Chart::WAbstractChart::modelColumnsInserted | ( | const WModelIndex & | parent, |
int | start, | ||
int | end | ||
) | [private, pure virtual] |
Method called when colums have been inserted in the model.
Implemented in Wt::Chart::WCartesianChart, and Wt::Chart::WPieChart.
virtual void Wt::Chart::WAbstractChart::modelColumnsRemoved | ( | const WModelIndex & | parent, |
int | start, | ||
int | end | ||
) | [private, pure virtual] |
Method called when colums have been removed from the model.
Implemented in Wt::Chart::WCartesianChart, and Wt::Chart::WPieChart.
virtual void Wt::Chart::WAbstractChart::modelDataChanged | ( | const WModelIndex & | topLeft, |
const WModelIndex & | bottomRight | ||
) | [private, pure virtual] |
Method called when data has been changed in the model.
Implemented in Wt::Chart::WCartesianChart, and Wt::Chart::WPieChart.
void Wt::Chart::WAbstractChart::modelReset | ( | ) | [private, virtual] |
Method called whenever the entire model was reset.
Bound to the WAbstractItemModel::modelReset() and WAbstractItemModel::layoutChanged() signals.
Reimplemented in Wt::Chart::WCartesianChart, and Wt::Chart::WPieChart.
virtual void Wt::Chart::WAbstractChart::modelRowsInserted | ( | const WModelIndex & | parent, |
int | start, | ||
int | end | ||
) | [private, pure virtual] |
Method called when rows have been inserted from the model.
Implemented in Wt::Chart::WCartesianChart, and Wt::Chart::WPieChart.
virtual void Wt::Chart::WAbstractChart::modelRowsRemoved | ( | const WModelIndex & | parent, |
int | start, | ||
int | end | ||
) | [private, pure virtual] |
Method called when rows have been removed from the model.
Implemented in Wt::Chart::WCartesianChart, and Wt::Chart::WPieChart.
virtual void Wt::Chart::WAbstractChart::paint | ( | WPainter & | painter, |
const WRectF & | rectangle = WRectF() |
||
) | const [pure virtual] |
Paint the chart in a rectangle of the given painter.
Paints the chart inside the painter, in the area indicated by rectangle. When rectangle is a null rectangle, the entire painter window is used.
Implemented in Wt::Chart::WCartesianChart, and Wt::Chart::WPieChart.
WChartPalette* Wt::Chart::WAbstractChart::palette | ( | ) | const |
Returns the palette for the chart.
int Wt::Chart::WAbstractChart::plotAreaPadding | ( | Side | side | ) | const |
Returns the internal margin for the main plot area.
void Wt::Chart::WAbstractChart::setBackground | ( | const WBrush & | background | ) |
Sets a background for the chart.
Set the background color for the main plot area.
The default is a completely transparent background.
void Wt::Chart::WAbstractChart::setModel | ( | WAbstractItemModel * | model | ) |
Set the model.
The model is used by the chart to get its data. Ownership of the model is not transferred, and if a previous model was set it is not deleted.
The default model is a 0 model.
void Wt::Chart::WAbstractChart::setPalette | ( | WChartPalette * | palette | ) |
Set a palette for the chart.
A palette is used to provide the style information to render the chart series. Ownership of the palette is transferred to the chart.
The default palette is dependent on the chart type.
Set an internal margin for the main plot area.
This configures the area (in pixels) around the plot area that is available for axes, labels, and titles. You need to set this appropriately so that labels fit inside these margins.
The default is dependent on the chart type.
void Wt::Chart::WAbstractChart::setTitle | ( | const WString & | title | ) |
Set a chart title.
The title is displayed on top of the chart, using the titleFont().
The default title is an empty title ("").
void Wt::Chart::WAbstractChart::setTitleFont | ( | const WFont & | titleFont | ) |
Set the font for the chart title.
Changes the font for the chart title.
The default title font is a 15 point Sans Serif font.
const WFont& Wt::Chart::WAbstractChart::titleFont | ( | ) | const |
Returns the font for the chart title.