Wt
4.11.1
|
A curve label. More...
#include <WCartesianChart.h>
Public Member Functions | |
CurveLabel (const WDataSeries &series, const WPointF &point, const WString &label) | |
Create a new curve label. More... | |
CurveLabel (const WDataSeries &series, const cpp17::any &x, const cpp17::any &y, const WString &label) | |
Create a new curve label. More... | |
void | setSeries (const WDataSeries &series) |
Set the series this curve label is associated with. | |
const WDataSeries & | series () const |
Get the series this curve label is associated with. More... | |
void | setPoint (const WPointF &point) |
Set the point in model coordinates this label is associated with. | |
void | setPoint (const cpp17::any &x, const cpp17::any &y) |
Set the point in model coordinates this label is associated with. | |
const WPointF | point () const |
Get the point in model coordinates this label is associated with. More... | |
const cpp17::any & | x () const |
Get the x position for this label. More... | |
const cpp17::any & | y () const |
Get the y position for this label. More... | |
void | setLabel (const WString &label) |
Set the label that should be drawn in the box. | |
const WString & | label () const |
Get the label that should be drawn in the box. More... | |
void | setOffset (const WPointF &offset) |
Set the offset the text should be placed at. More... | |
const WPointF & | offset () const |
Get the offset the text should be placed at. More... | |
void | setWidth (int width) |
Set the width of the box in pixels. More... | |
int | width () const |
Get the width of the box in pixels. More... | |
void | setLinePen (const WPen &pen) |
Set the pen to use for the connecting line. More... | |
const WPen & | linePen () const |
Get the pen to use for the connecting line. More... | |
void | setTextPen (const WPen &pen) |
Set the pen for the text in the box. | |
const WPen & | textPen () const |
Get the pen for the text in the box. More... | |
void | setBoxBrush (const WBrush &brush) |
Set the brush to use for the box around the text. More... | |
const WBrush & | boxBrush () const |
Get the brush to use for the box around the text. More... | |
void | setMarkerBrush (const WBrush &brush) |
Set the brush used to fill the circle at point(). | |
const WBrush & | markerBrush () const |
Get the brush used to fill the circle at point(). More... | |
A curve label.
Curve labels can be added with WCartesianChart::addCurveLabel(). They are associated with a particular series, and are drawn at the given point in model coordinates. When the chart is transformed (zoom or pan) or the associated series is manipulated, the curve label's position will change, but not its size.
Wt::Chart::CurveLabel::CurveLabel | ( | const WDataSeries & | series, |
const WPointF & | point, | ||
const WString & | label | ||
) |
Create a new curve label.
Create a new curve label for given series, at the given point with the given text.
Wt::Chart::CurveLabel::CurveLabel | ( | const WDataSeries & | series, |
const cpp17::any & | x, | ||
const cpp17::any & | y, | ||
const WString & | label | ||
) |
Create a new curve label.
Create a new curve label for given series, at the given x, y coordinates and the given text.
const WBrush& Wt::Chart::CurveLabel::boxBrush | ( | ) | const |
Get the brush to use for the box around the text.
const WString& Wt::Chart::CurveLabel::label | ( | ) | const |
Get the label that should be drawn in the box.
const WPen& Wt::Chart::CurveLabel::linePen | ( | ) | const |
Get the pen to use for the connecting line.
const WBrush& Wt::Chart::CurveLabel::markerBrush | ( | ) | const |
Get the brush used to fill the circle at point().
const WPointF& Wt::Chart::CurveLabel::offset | ( | ) | const |
Get the offset the text should be placed at.
const WPointF Wt::Chart::CurveLabel::point | ( | ) | const |
Get the point in model coordinates this label is associated with.
const WDataSeries& Wt::Chart::CurveLabel::series | ( | ) | const |
Get the series this curve label is associated with.
void Wt::Chart::CurveLabel::setBoxBrush | ( | const WBrush & | brush | ) |
Set the brush to use for the box around the text.
This sets the brush used to fill the box with the text defined in label().
void Wt::Chart::CurveLabel::setLinePen | ( | const WPen & | pen | ) |
void Wt::Chart::CurveLabel::setOffset | ( | const WPointF & | offset | ) |
Set the offset the text should be placed at.
The offset is defined in pixels, with x values going from left to right, and y values from top to bottom.
The default offset is (60, -20), which means the middle of the label() is drawn 60 pixels to the right, and 20 pixels above the point.
void Wt::Chart::CurveLabel::setWidth | ( | int | width | ) |
Set the width of the box in pixels.
If the width is 0 (the default), server side font metrics will be used to determine the size of the box.
const WPen& Wt::Chart::CurveLabel::textPen | ( | ) | const |
Get the pen for the text in the box.
int Wt::Chart::CurveLabel::width | ( | ) | const |
Get the width of the box in pixels.
const cpp17::any& Wt::Chart::CurveLabel::x | ( | ) | const |
Get the x position for this label.
const cpp17::any& Wt::Chart::CurveLabel::y | ( | ) | const |
Get the y position for this label.