Wt  4.11.1
Loading...
Searching...
No Matches
Wt::Chart::WStandardPalette Class Reference

Standard styling for rendering series in charts. More...

#include <Wt/Chart/WStandardPalette.h>

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

Public Types

typedef PaletteFlavour Flavour
 Typedef for enum Wt::Chart::PaletteFlavour.

Public Member Functions

 WStandardPalette (PaletteFlavour flavour)
 Creates a standard palette of a particular flavour.
virtual WBrush brush (int index) const override
 Returns a brush from the palette.
virtual WPen borderPen (int index) const override
 Returns a border pen from the palette.
virtual WPen strokePen (int index) const override
 Returns a stroke pen from the palette.
virtual WColor fontColor (int index) const override
 Returns a font color from the palette.
virtual WColor color (int index) const
 Returns the color for the given index.
Public Member Functions inherited from Wt::Chart::WChartPalette
virtual ~WChartPalette ()
 Destructor.

Detailed Description

Standard styling for rendering series in charts.

This class provides four standard palettes, each composed of eight different colors (these are recycled at index 8).

The three colored palettes are a variation on those defined at http://www.modernlifeisrubbish.co.uk/article/web-2.0-colour-palette.

The following table lists the background color, and font color of the different palettes:

NeutralBoldMutedGrayScale
Gmail blueMozilla redRuby on Rails redGray #1
Shiny silverFlock blueMozilla blueGray #2
Interactive action yellowRSS orangeEtsy vermillionGray #3
Qoop mintTechcrunch greenDigg blueGray #4
Digg blueFlickr pink43 Things goldGray #5
Shadows greyNewsvine greenWritely oliveGray #6
Magnolia Mag.noliaMagnolia Mag.noliaLast.fm crimsonGray #7
RSS orangeRollyo redBasecamp greenGray #8

The border pen is in all cases a gray pen of 0 width, while the stroke pen is a line of width 2 in the background color.

Member Function Documentation

◆ borderPen()

WPen Wt::Chart::WStandardPalette::borderPen ( int index) const
overridevirtual

Returns a border pen from the palette.

Returns the pen for stroking borders around an area filled using the brush at the same index.

See also
strokePen(), brush()

Implements Wt::Chart::WChartPalette.

◆ brush()

WBrush Wt::Chart::WStandardPalette::brush ( int index) const
overridevirtual

Returns a brush from the palette.

Returns the brush for the style with given index.

Implements Wt::Chart::WChartPalette.

◆ fontColor()

WColor Wt::Chart::WStandardPalette::fontColor ( int index) const
overridevirtual

Returns a font color from the palette.

Returns a font color suitable for rendering text in the area filled with the brush at the same index.

See also
brush()

Implements Wt::Chart::WChartPalette.

◆ strokePen()

WPen Wt::Chart::WStandardPalette::strokePen ( int index) const
overridevirtual

Returns a stroke pen from the palette.

Returns the pen for stroking lines for the style with given index.

See also
strokePen()

Implements Wt::Chart::WChartPalette.