VectSharp 2.6.1
A light library for C# vector graphics
All Classes Namespaces Functions Variables Enumerations Properties Events Pages
VectSharp.Plots.DataLabels< T > Class Template Reference

A plot element that draws a text label at each data point. More...

Inheritance diagram for VectSharp.Plots.DataLabels< T >:

Public Member Functions

 DataLabels (IEnumerable< T > data, ICoordinateSystem< T > coordinateSystem)
 Creates a new DataLabels<T> instance. More...
 
void Plot (Graphics target)
 Draw the plot element on the specified target &#160;Graphics.
Parameters
targetThe Graphics on which to draw.
More...
 
void Plot (Graphics target)
 Draw the plot element on the specified target &#160;Graphics. More...
 

Properties

IEnumerable< T > Data [get, set]
 The data points at which the labels will be drawn. More...
 
Func< int, T, object > Label [get, set]
 A function used to determine the text of the labels to draw. The arguments for this function should be a int representing the index of the data point and a T representing the coordinates of the data point. This function should return either an IEnumerable<T> of FormattedText objects, which will be used as-is, or any other kind of object, which will be converted to a string to be used in the label. More...
 
Func< int, T, double > Rotation = (i, d) => 0 [get, set]
 A function used to determine the orientation of the labels with respect to the horizontal. The arguments for this function should be a int representing the index of the data point and a T representing the coordinates of the data point. This function should return a double representing the angle with respect to the horizontal at which the label should be drawn. More...
 
Func< int, T, PointMargin = (i, d) => new Point() [get, set]
 A function used to determine the position of the labels with respect to the data points. The arguments for this function should be a int representing the index of the data point and a T representing the coordinates of the data point. This function should return a Point defining the amount of space between the data point and the label, in plot coordinates. More...
 
TextBaselines Baseline = TextBaselines.Middle [get, set]
 The baseline for the labels. More...
 
TextAnchors Alignment = TextAnchors.Center [get, set]
 The alignment for the labels. More...
 
ICoordinateSystem< T > CoordinateSystem [get, set]
 The coordinate system used to transform the points from data space to plot space. More...
 
PlotElementPresentationAttributes PresentationAttributes = new PlotElementPresentationAttributes() { Stroke = null } [get, set]
 Presentation attributes determining the appearance of the labels. More...
 
string Tag [get, set]
 A tag to identify the labels in the plot. More...
 
- Properties inherited from VectSharp.Plots.IPlotElement
ICoordinateSystem CoordinateSystem [get]
 The coordinate system used to transform the points from data space to plot space. More...
 

Detailed Description

A plot element that draws a text label at each data point.

Template Parameters
TThe kind of data describing the data points (generally, IReadOnlyList<double>).

Definition at line 336 of file DataPoints.cs.

Constructor & Destructor Documentation

◆ DataLabels()

VectSharp.Plots.DataLabels< T >.DataLabels ( IEnumerable< T >  data,
ICoordinateSystem< T >  coordinateSystem 
)

Creates a new DataLabels<T> instance.

Parameters
dataThe data points at which the labels will be drawn.
coordinateSystemThe coordinate system used to transform the points from data space to plot space.

Definition at line 445 of file DataPoints.cs.

Member Function Documentation

◆ Plot()

void VectSharp.Plots.DataLabels< T >.Plot ( Graphics  target)

Draw the plot element on the specified target &#160;Graphics.

Parameters
targetThe Graphics on which to draw.

Implements VectSharp.Plots.IPlotElement.

Definition at line 465 of file DataPoints.cs.

Property Documentation

◆ Alignment

TextAnchors VectSharp.Plots.DataLabels< T >.Alignment = TextAnchors.Center
getset

The alignment for the labels.

Definition at line 422 of file DataPoints.cs.

◆ Baseline

TextBaselines VectSharp.Plots.DataLabels< T >.Baseline = TextBaselines.Middle
getset

The baseline for the labels.

Definition at line 417 of file DataPoints.cs.

◆ CoordinateSystem

The coordinate system used to transform the points from data space to plot space.

Implements VectSharp.Plots.IPlotElement.

Definition at line 427 of file DataPoints.cs.

◆ Data

IEnumerable<T> VectSharp.Plots.DataLabels< T >.Data
getset

The data points at which the labels will be drawn.

Definition at line 341 of file DataPoints.cs.

◆ Label

Func<int, T, object> VectSharp.Plots.DataLabels< T >.Label
getset

A function used to determine the text of the labels to draw. The arguments for this function should be a int representing the index of the data point and a T representing the coordinates of the data point. This function should return either an IEnumerable<T> of FormattedText objects, which will be used as-is, or any other kind of object, which will be converted to a string to be used in the label.

Definition at line 352 of file DataPoints.cs.

◆ Margin

Func<int, T, Point> VectSharp.Plots.DataLabels< T >.Margin = (i, d) => new Point()
getset

A function used to determine the position of the labels with respect to the data points. The arguments for this function should be a int representing the index of the data point and a T representing the coordinates of the data point. This function should return a Point defining the amount of space between the data point and the label, in plot coordinates.

Definition at line 412 of file DataPoints.cs.

◆ PresentationAttributes

PlotElementPresentationAttributes VectSharp.Plots.DataLabels< T >.PresentationAttributes = new PlotElementPresentationAttributes() { Stroke = null }
getset

Presentation attributes determining the appearance of the labels.

Definition at line 433 of file DataPoints.cs.

◆ Rotation

Func<int, T, double> VectSharp.Plots.DataLabels< T >.Rotation = (i, d) => 0
getset

A function used to determine the orientation of the labels with respect to the horizontal. The arguments for this function should be a int representing the index of the data point and a T representing the coordinates of the data point. This function should return a double representing the angle with respect to the horizontal at which the label should be drawn.

Definition at line 405 of file DataPoints.cs.

◆ Tag

string VectSharp.Plots.DataLabels< T >.Tag
getset

A tag to identify the labels in the plot.

Definition at line 438 of file DataPoints.cs.


The documentation for this class was generated from the following file: