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

Maps numerical values to colors. More...

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

List of all members.

Public Member Functions

 WAbstractColorMap (double min, double max, WObject *parent=0)
 Constructor.
virtual WColor toColor (double value) const =0
 Converts a numerical value to a WColor.
virtual void createStrip (WPainter *painter, const WRectF &area=WRectF()) const =0
 Paints the colormap as a colored strip.
virtual void paintLegend (WPainter *painter, const WRectF &area=WRectF()) const =0
 Paints the colormap as a legend.
double minimum () const
 Returns the minimum of the colormap range.
double maximum () const
 Returns the maximum of the colormap range.
void setTickSpacing (int spacing)
 Sets the tickspacing for the legend as a number of line-heights.
int tickSpacing () const
 Returns the tickspacing for the legend.
void setFormatString (const WString &format)
 Sets the format for the labels on the colormap-legend.
const WStringformatString () const
 Returns the format string.
void setLabelFont (const WFont &font)
 Sets the font to be used when drawing the labels in the legend.
const WFontlabelFont ()
 Returns the font to be used when drawing the labels in the legend.

Detailed Description

Maps numerical values to colors.

The colormap has functionality to convert a numerical value to a WColor. For details on how, see the documentation of the implementations.

A colormap has a certain numerical range. When a colormap is painted as a colored strip or as a legend, this range is what will be presented, even if the colormap has the ability to convert values outside this range.


Constructor & Destructor Documentation

Wt::Chart::WAbstractColorMap::WAbstractColorMap ( double  min,
double  max,
WObject parent = 0 
)

Constructor.

Constructor taking a minimum and maximum value, determining the active range of the colormap. The default value for tickSpacing is 2 and the default label format is 2 decimal points.


Member Function Documentation

virtual void Wt::Chart::WAbstractColorMap::createStrip ( WPainter painter,
const WRectF area = WRectF() 
) const [pure virtual]

Paints the colormap as a colored strip.

This paints the colormap from the minimum to the maximum value in the provided area (default = fill the entire paintdevice). This is no legend with ticks and labels, only the colors are painted.

See also:
paintLegend()

Implemented in Wt::Chart::WStandardColorMap.

Returns the format string.

See also:
setFormatString()

Returns the font to be used when drawing the labels in the legend.

See also:
setLabelFont
virtual void Wt::Chart::WAbstractColorMap::paintLegend ( WPainter painter,
const WRectF area = WRectF() 
) const [pure virtual]

Paints the colormap as a legend.

The colormap is painted as a legend with ticks and value-labels. The parameter area can be used to specify a part of the paintdevice where the legend should be drawn. When drawing the legend, the tickspacing, labelformat and labelfont are taken into account.

See also:
setTickSpacing(), setFormatString(), setLabelFont()

Implemented in Wt::Chart::WStandardColorMap.

Sets the format for the labels on the colormap-legend.

The format string is interpreted by snprintf(). The default is a float with two decimal places.

See also:
paintLegend()

Sets the font to be used when drawing the labels in the legend.

The default is a default constructed WFont.

See also:
paintLegend()

Sets the tickspacing for the legend as a number of line-heights.

The tickspacing must be specified as an integer number of line-heigths. For example, the default value of 2 will leave two line-heights between the labels of the ticks.

See also:
paintLegend()

Returns the tickspacing for the legend.

See also:
setTickSpacing()
 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