Wt: Wt::Chart::WAbstractChartModel Class Reference

Wt 4.10.4

Loading...
Searching...
No Matches
Public Member Functions | List of all members
Wt::Chart::WAbstractChartModel Class Referenceabstract
Charts (Wt::Chart)

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.
virtual WString | displayData (int row, int column) const
| Returns display data at a given row and column.
virtual WString | headerData (int column) const
| Returns the given column's header data.
virtual WString | toolTip (int row, int column) const
| Returns the tooltip text to use on a given row and column.
virtual WFlags< ItemFlag > | flags (int row, int column) const
| Returns the item flags for the given row and column.
virtual WLink * | link (int row, int column) const
| Returns the link for a given row and column.
virtual const WColor * | markerPenColor (int row, int column) const
| Returns the marker pen color to use for a given row and column.
virtual const WColor * | markerBrushColor (int row, int column) const
| Returns the marker brush color to use for a given row and column.
virtual const MarkerType * | markerType (int row, int column) const
| Returns the marker type to use for a given row and column.
virtual const WColor * | barPenColor (int row, int column) const
| Returns the bar pen color to use for a given row and column.
virtual const WColor * | barBrushColor (int row, int column) const
| Returns the bar brush color to use for a given row and column.
virtual const double * | markerScaleFactor (int row, int column) const
| Returns the marker scale factor to use for a given row and column.
virtual int | columnCount () const =0
| Returns the number of columns.
virtual int | rowCount () const =0
| Returns the number of rows.
virtual Signal & | changed ()
| A signal that notifies of any change to the model.
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.
std::unique_ptr< WObject > | removeChild (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.
virtual const std::string | id () const
| Returns the (unique) identifier for this object.
virtual void | setObjectName (const std::string &name)
| Sets an object name.
virtual std::string | objectName () const
| Returns the object name.
void | resetLearnedSlots ()
| Resets learned stateless slot implementations.
template<class T >
void | resetLearnedSlot (void(T::*method)())
| Resets a learned stateless slot implementation.
template<class T >
WStatelessSlot * | implementStateless (void(T::*method)())
| Declares a slot to be stateless and learn client-side behaviour on first invocation.
template<class T >
WStatelessSlot * | implementStateless (void(T::*method)(), void(T::*undoMethod)())
| Declares a slot to be stateless and learn client-side behaviour in advance.
void | isNotStateless ()
| Marks the current function as not stateless.
template<class T >
WStatelessSlot * | implementJavaScript (void(T::*method)(), const std::string &jsCode)
| Provides a JavaScript implementation for a method.
Public Member Functions inherited from Wt::Core::observable
| observable () noexcept
| Default constructor.
virtual | ~observable ()
| Destructor.
template<typename... Args, typename C >
auto | bindSafe (void(C::*method)(Args...)) noexcept
| Protects a method call against object destruction.
template<typename... Args, typename C >
auto | bindSafe (void(C::*method)(Args...) const) const noexcept
| Protects a const method call against object destruction.
template<typename Function >
auto | bindSafe (const Function &function) noexcept
| Protects a function against object destruction.

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

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

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

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

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

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

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

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

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

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

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

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

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