Wt  4.10.4
Public Member Functions | List of all members
Wt::Chart::WAbstractChartModel Class Referenceabstract

An abstract model for use with Wt's charts. More...

#include <Wt/Chart/WAbstractChartModel.h>

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

Public Member Functions

 WAbstractChartModel ()
 Creates a new chart model.
 
virtual double data (int row, int column) const =0
 Returns data at a given row and column. More...
 
virtual WString displayData (int row, int column) const
 Returns display data at a given row and column. More...
 
virtual WString headerData (int column) const
 Returns the given column's header data. More...
 
virtual WString toolTip (int row, int column) const
 Returns the tooltip text to use on a given row and column. More...
 
virtual WFlags< ItemFlagflags (int row, int column) const
 Returns the item flags for the given row and column. More...
 
virtual WLinklink (int row, int column) const
 Returns the link for a given row and column. More...
 
virtual const WColormarkerPenColor (int row, int column) const
 Returns the marker pen color to use for a given row and column. More...
 
virtual const WColormarkerBrushColor (int row, int column) const
 Returns the marker brush color to use for a given row and column. More...
 
virtual const MarkerTypemarkerType (int row, int column) const
 Returns the marker type to use for a given row and column. More...
 
virtual const WColorbarPenColor (int row, int column) const
 Returns the bar pen color to use for a given row and column. More...
 
virtual const WColorbarBrushColor (int row, int column) const
 Returns the bar brush color to use for a given row and column. More...
 
virtual const double * markerScaleFactor (int row, int column) const
 Returns the marker scale factor to use for a given row and column. More...
 
virtual int columnCount () const =0
 Returns the number of columns. More...
 
virtual int rowCount () const =0
 Returns the number of rows. More...
 
virtual Signalchanged ()
 A signal that notifies of any change to the model. More...
 
- Public Member Functions inherited from Wt::WObject
void addChild (std::unique_ptr< WObject > child)
 Add a child WObject whose lifetime is determined by this WObject.
 
template<typename Child >
Child * addChild (std::unique_ptr< Child > child)
 Add a child WObject, returning a raw pointer. More...
 
std::unique_ptr< WObjectremoveChild (WObject *child)
 Remove a child WObject, so its lifetime is no longer determined by this WObject.
 
template<typename Child >
std::unique_ptr< Child > removeChild (Child *child)
 Remove a child WObject, so its lifetime is no longer determined by this WObject. More...
 
virtual const std::string id () const
 Returns the (unique) identifier for this object. More...
 
virtual void setObjectName (const std::string &name)
 Sets an object name. More...
 
virtual std::string objectName () const
 Returns the object name. More...
 
void resetLearnedSlots ()
 Resets learned stateless slot implementations. More...
 
template<class T >
void resetLearnedSlot (void(T::*method)())
 Resets a learned stateless slot implementation. More...
 
template<class T >
WStatelessSlot * implementStateless (void(T::*method)())
 Declares a slot to be stateless and learn client-side behaviour on first invocation. More...
 
template<class T >
WStatelessSlot * implementStateless (void(T::*method)(), void(T::*undoMethod)())
 Declares a slot to be stateless and learn client-side behaviour in advance. More...
 
void isNotStateless ()
 Marks the current function as not stateless. More...
 
template<class T >
WStatelessSlot * implementJavaScript (void(T::*method)(), const std::string &jsCode)
 Provides a JavaScript implementation for a method. More...
 
- Public Member Functions inherited from Wt::Core::observable
 observable () noexcept
 Default constructor.
 
virtual ~observable ()
 Destructor. More...
 
template<typename... Args, typename C >
auto bindSafe (void(C::*method)(Args...)) noexcept
 Protects a method call against object destruction. More...
 
template<typename... Args, typename C >
auto bindSafe (void(C::*method)(Args...) const) const noexcept
 Protects a const method call against object destruction. More...
 
template<typename Function >
auto bindSafe (const Function &function) noexcept
 Protects a function against object destruction. More...
 

Additional Inherited Members

- Public Types inherited from Wt::WObject
typedef void(WObject::* Method) ()
 Typedef for a WObject method without arguments.
 
- Protected Member Functions inherited from Wt::WObject
virtual WStatelessSlot * getStateless (Method method)
 On-demand stateless slot implementation. More...
 

Detailed Description

An abstract model for use with Wt's charts.

This abstract model is used by WAbstractChart as data model.

Member Function Documentation

◆ barBrushColor()

const WColor * Wt::Chart::WAbstractChartModel::barBrushColor ( int  row,
int  column 
) const
virtual

Returns the bar brush color to use for a given row and column.

This is used as the color of the brush used when drawing a SeriesType::Bar. The default is null, indicating that the default color, as determined by WDataSeries::brush(), should be used.

See also
WDataSeries::setBrush()

Reimplemented in Wt::Chart::WStandardChartProxyModel.

◆ barPenColor()

const WColor * Wt::Chart::WAbstractChartModel::barPenColor ( int  row,
int  column 
) const
virtual

Returns the bar pen color to use for a given row and column.

This is used as the color of the outline of bars when drawing a SeriesType::Bar. The default is null, indicating that the default color, as determined by WDataSeries::pen(), should be used.

See also
WDataSeries::setPen()

Reimplemented in Wt::Chart::WStandardChartProxyModel.

◆ changed()

virtual Signal& Wt::Chart::WAbstractChartModel::changed ( )
virtual

A signal that notifies of any change to the model.

Implementations should trigger this signal in order to update the chart.

◆ columnCount()

virtual int Wt::Chart::WAbstractChartModel::columnCount ( ) const
pure virtual

Returns the number of columns.

See also
rowCount()

Implemented in Wt::Chart::WStandardChartProxyModel.

◆ data()

virtual double Wt::Chart::WAbstractChartModel::data ( int  row,
int  column 
) const
pure virtual

Returns data at a given row and column.

This value determines the position of a data point on the chart.

Implemented in Wt::Chart::WStandardChartProxyModel.

◆ displayData()

WString Wt::Chart::WAbstractChartModel::displayData ( int  row,
int  column 
) const
virtual

Returns display data at a given row and column.

This value should be a textual representation of the value returned by data(). This defaults to the string representation of the double returned by data().

Reimplemented in Wt::Chart::WStandardChartProxyModel.

◆ flags()

WFlags< ItemFlag > Wt::Chart::WAbstractChartModel::flags ( int  row,
int  column 
) const
virtual

Returns the item flags for the given row and column.

Only the ItemIsXHTMLText and ItemHasDeferredTooltip flags are supported for charts.

ItemIsXHTMLText determines whether the tooltip text should be rendered as XHTML or as plain text, and ItemHasDeferredTooltip makes it so that tooltips are only loaded on demand.

Note
An XHTML text tooltip will be forced to be deferred. Non-deferred XHTML tooltips are not supported.
When not using deferred tooltips, the HTML <area> tag will be used. If there are many tooltips and the chart is interactive this may cause client-side performance issues. If deferred tooltips are used, this will cause some load on the server, as it calculates server-side what marker or bar the user is hovering over.
If the chart is interactive, and tooltips are not deferred, they will be scaled according to the first Y axis, and thus multiple Y axes will not be supported in combination with plain tooltips.

Reimplemented in Wt::Chart::WStandardChartProxyModel.

◆ headerData()

WString Wt::Chart::WAbstractChartModel::headerData ( int  column) const
virtual

Returns the given column's header data.

This is used as the name in the legend for a data series.

Defaults to an empty string.

Reimplemented in Wt::Chart::WStandardChartProxyModel.

◆ link()

WLink * Wt::Chart::WAbstractChartModel::link ( int  row,
int  column 
) const
virtual

Returns the link for a given row and column.

Defaults to an empty link, signifying that no link should be shown.

Reimplemented in Wt::Chart::WStandardChartProxyModel.

◆ markerBrushColor()

const WColor * Wt::Chart::WAbstractChartModel::markerBrushColor ( int  row,
int  column 
) const
virtual

Returns the marker brush color to use for a given row and column.

This is used as the color of the brush used when drawing a SeriesType::Point. The default is null, indicating that the default color, as determined by WDataSeries::markerBrush(), should be used.

See also
WDataSeries::setMarkerBrush()

Reimplemented in Wt::Chart::WStandardChartProxyModel.

◆ markerPenColor()

const WColor * Wt::Chart::WAbstractChartModel::markerPenColor ( int  row,
int  column 
) const
virtual

Returns the marker pen color to use for a given row and column.

This is used as the color of the outline of markers when drawing a SeriesType::Point. The default is null, indicating that the default color, as determined by WDataSeries::markerPen(), should be used.

See also
WDataSeries::setMarkerPen()

Reimplemented in Wt::Chart::WStandardChartProxyModel.

◆ markerScaleFactor()

const double * Wt::Chart::WAbstractChartModel::markerScaleFactor ( int  row,
int  column 
) const
virtual

Returns the marker scale factor to use for a given row and column.

This is used to scale the size of the marker when drawing a SeriesType::Point. The default is null, indicating that the default scale should be used.

Reimplemented in Wt::Chart::WStandardChartProxyModel.

◆ markerType()

const MarkerType * Wt::Chart::WAbstractChartModel::markerType ( int  row,
int  column 
) const
virtual

Returns the marker type to use for a given row and column.

This is used as the shape of the marker used when drawing a PointSeries. The default is null, indicating that the default marker, as determined by WDataSeries::marker(), should be used.

See also
WDataSeries::setMarker()

Reimplemented in Wt::Chart::WStandardChartProxyModel.

◆ rowCount()

virtual int Wt::Chart::WAbstractChartModel::rowCount ( ) const
pure virtual

Returns the number of rows.

See also
columnCount()

Implemented in Wt::Chart::WStandardChartProxyModel.

◆ toolTip()

WString Wt::Chart::WAbstractChartModel::toolTip ( int  row,
int  column 
) const
virtual

Returns the tooltip text to use on a given row and column.

Defaults to an empty string, signifying that no tooltip should be shown.

Reimplemented in Wt::Chart::WStandardChartProxyModel.