Wt: Wt::Chart::WAbstractChart Class Reference

Wt 3.3.0

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes

- Class List
- Class Hierarchy
- Class Members

Public Member Functions | Private Member Functions
Wt::Chart::WAbstractChart Class Reference
Charts (Wt::Chart) | Model/view system

Abstract base class for MVC-based charts. More...

`#include <Wt/Chart/WAbstractChart>`

Inheritance diagram for Wt::Chart::WAbstractChart:
[legend]

List of all members.

## 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.

## Detailed Description

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

### CSS

Styling through CSS is not applicable.

See also:
  WCartesianChart, WPieChart

## Member Function Documentation

const WBrush& Wt::Chart::WAbstractChart::background | ( |  | ) | const

Returns the background of the chart.

See also:
  setBackground(const WBrush&)

WAbstractItemModel* Wt::Chart::WAbstractChart::model | ( |  | ) | const

Returns the model.

See also:
  setModel(WAbstractItemModel *)

void Wt::Chart::WAbstractChart::modelChanged | ( |  | ) | `[private, virtual]`

Method called whenever the entire model was changed.

See also:
  setModel(WAbstractItemModel *)

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.

See also:
  WAbstractItemModel::columnsInserted

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.

See also:
  WAbstractItemModel::columnsRemoved

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.

See also:
  WAbstractItemModel::dataChanged

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.

See also:
  WAbstractItemModel::rowsInserted

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.

See also:
  WAbstractItemModel::rowsRemoved

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.

See also:
  setPalette(WChartPalette *palette)

int Wt::Chart::WAbstractChart::plotAreaPadding | ( | Side | side | ) | const

Returns the internal margin for the main plot area.

See also:
  setPlotAreaPadding(int, WFlags<Side>)

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.

See also:
  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.

See also:
  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.

See also:
  palette()

void Wt::Chart::WAbstractChart::setPlotAreaPadding | ( | int | padding,
|  | WFlags< Side > | sides = `All`
| ) |  |

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 ("").

See also:
  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.

See also:
  titleFont(), setTitle(const WString&)

const WString& Wt::Chart::WAbstractChart::title | ( |  | ) | const

Return the chart title.

See also:
  title()

const WFont& Wt::Chart::WAbstractChart::titleFont | ( |  | ) | const

Returns the font for the chart title.

See also:
  setTitleFont(const WFont&)

All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator