Wt  3.3.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator
Public Member Functions | Protected Member Functions
Wt::Chart::WAbstractChart Class Reference

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

#include <Wt/Chart/WAbstractChart>

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

List of all members.

Public Member Functions

virtual ~WAbstractChart ()
 Destructor.
void setModel (WAbstractItemModel *model)
 Set the model.
WAbstractItemModelmodel () const
 Returns the model.
void setBackground (const WBrush &background)
 Sets a background for the chart.
const WBrushbackground () const
 Returns the background of the chart.
void setPalette (WChartPalette *palette)
 Set a palette for the chart.
WChartPalettepalette () 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 setAutoLayoutEnabled (bool enabled=true)
 Configures the chart layout to be automatic.
bool isAutoLayoutEnabled () const
 Returns whether chart layout is computed automatically.
void setTitle (const WString &title)
 Set a chart title.
const WStringtitle () const
 Return the chart title.
void setTitleFont (const WFont &titleFont)
 Set the font for the chart title.
const WFonttitleFont () 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.

Protected 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.
virtual void modelHeaderDataChanged (Orientation orientation, int start, int end)=0
 Method called when header 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

Returns the background of the chart.

See also:
setBackground(const WBrush&)

Returns whether chart layout is computed automatically.

See also:
setAutoLayoutEnabled()

Returns the model.

See also:
setModel(WAbstractItemModel *)
void Wt::Chart::WAbstractChart::modelChanged ( ) [protected, 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 
) [protected, 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 
) [protected, 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 
) [protected, 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.

virtual void Wt::Chart::WAbstractChart::modelHeaderDataChanged ( Orientation  orientation,
int  start,
int  end 
) [protected, pure virtual]

Method called when header data has been changed in the model.

See also:
WAbstractItemModel::headerDataChanged

Implemented in Wt::Chart::WCartesianChart, and Wt::Chart::WPieChart.

void Wt::Chart::WAbstractChart::modelReset ( ) [protected, 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 
) [protected, 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 
) [protected, 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.

Returns the palette for the chart.

See also:
setPalette(WChartPalette *palette)

Returns the internal margin for the main plot area.

This is either the paddings set through setPlotAreaPadding() or computed using setAutoLayoutEnabled()

See also:
setPlotAreaPadding(int, WFlags<Side>)
void Wt::Chart::WAbstractChart::setAutoLayoutEnabled ( bool  enabled = true)

Configures the chart layout to be automatic.

This configures the plot area so that the space around it is suited for the text that is rendered (axis labels and text, the title, and legend).

The default value is false, and the chart layout is set manually using values set in setPlotAreaPadding().

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

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

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.

The default is dependent on the chart type.

Alternatively, you can configure the chart layout to be computed automatically using setAutoLayoutEnabled().

See also:
setAutoLayoutEnabled()

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

Return the chart title.

See also:
title()

Returns the font for the chart title.

See also:
setTitleFont(const WFont&)
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator

Generated on Tue Mar 22 2016 for the C++ Web Toolkit (Wt) by doxygen 1.7.6.1