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

A plot element that draws bars. More...

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

Public Member Functions

 Bars (IEnumerable< T > data, IComparer< T > sorting, Func< T, T > getBaseline, ICoordinateSystem< T > coordinateSystem)
 Create a new Bars<T> instance. More...
 
 Bars (IEnumerable< T > data, Comparison< T > sorting, Func< T, T > getBaseline, ICoordinateSystem< T > coordinateSystem)
 Create a new Bars<T> instance. More...
 
 Bars (IReadOnlyList< T > data, Func< T, T > getBaseline, ICoordinateSystem< T > coordinateSystem)
 Create a new Bars<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...
 
 Bars (IEnumerable< IReadOnlyList< double > > data, IComparer< IReadOnlyList< double > > sorting, Func< IReadOnlyList< double >, IReadOnlyList< double > > getBaseline, ICoordinateSystem< IReadOnlyList< double > > coordinateSystem)
 Create a new Bars instance. More...
 
 Bars (IEnumerable< IReadOnlyList< double > > data, Comparison< IReadOnlyList< double > > sorting, Func< IReadOnlyList< double >, IReadOnlyList< double > > getBaseline, ICoordinateSystem< IReadOnlyList< double > > coordinateSystem)
 Create a new Bars instance. More...
 
 Bars (IEnumerable< IReadOnlyList< double > > data, ICoordinateSystem< IReadOnlyList< double > > coordinateSystem, bool vertical=true)
 Create a new Bars instance. More...
 
void Plot (Graphics target)
 Draw the plot element on the specified target &#160;Graphics. More...
 

Properties

SortedSet< T > Data [get, set]
 The data points corresponding to the tips of the bars. More...
 
Func< T, T > GetBaseline [get, set]
 A function that returns the bottom for each bar. This function should accept a single parameter of type T and return another T object, representing the bottom of the bar in data space. More...
 
double Margin [get, set]
 The margin between consecutive bars. This should range between 0 and 1. 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() [get, set]
 Presentation attributes for the bars. More...
 
string Tag [get, set]
 A tag to identify the bars 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 bars.

A plot element that draws bars for numerical data.

Template Parameters
TThe type of data elements.

Definition at line 29 of file Bars.cs.

Constructor & Destructor Documentation

◆ Bars() [1/6]

VectSharp.Plots.Bars< T >.Bars ( IEnumerable< T >  data,
IComparer< T >  sorting,
Func< T, T >  getBaseline,
ICoordinateSystem< T >  coordinateSystem 
)

Create a new Bars<T> instance.

Parameters
dataThe data points corresponding to the tips of the bars.
sortingA comparer used to sort the bars.
getBaselineA function that returns the bottom for each bar. This function should accept a single parameter of type T and return another T object, representing the bottom of the bar in data space.
coordinateSystemThe coordinate system used to transform the points from data space to plot space.

Definition at line 89 of file Bars.cs.

◆ Bars() [2/6]

VectSharp.Plots.Bars< T >.Bars ( IEnumerable< T >  data,
Comparison< T >  sorting,
Func< T, T >  getBaseline,
ICoordinateSystem< T >  coordinateSystem 
)

Create a new Bars<T> instance.

Parameters
dataThe data points corresponding to the tips of the bars.
sortingA comparer used to sort the bars.
getBaselineA function that returns the bottom for each bar. This function should accept a single parameter of type T and return another T object, representing the bottom of the bar in data space.
coordinateSystemThe coordinate system used to transform the points from data space to plot space.

Definition at line 105 of file Bars.cs.

◆ Bars() [3/6]

VectSharp.Plots.Bars< T >.Bars ( IReadOnlyList< T >  data,
Func< T, T >  getBaseline,
ICoordinateSystem< T >  coordinateSystem 
)

Create a new Bars<T> instance.

Parameters
dataThe data points corresponding to the tips of the bars. These should already be sorted.
getBaselineA function that returns the bottom for each bar. This function should accept a single parameter of type T and return another T object, representing the bottom of the bar in data space.
coordinateSystemThe coordinate system used to transform the points from data space to plot space.

Definition at line 115 of file Bars.cs.

◆ Bars() [4/6]

VectSharp.Plots.Bars< T >.Bars ( IEnumerable< IReadOnlyList< double > >  data,
IComparer< IReadOnlyList< double > >  sorting,
Func< IReadOnlyList< double >, IReadOnlyList< double > >  getBaseline,
ICoordinateSystem< IReadOnlyList< double > >  coordinateSystem 
)

Create a new Bars instance.

Parameters
dataThe data points corresponding to the tips of the bars.
sortingA comparer used to sort the bars.
getBaselineA function that returns the bottom for each bar. This function should accept a single parameter (an IReadOnlyList<T> of doubles), and return another object of the same type, representing the bottom of the bar in data space.
coordinateSystemThe coordinate system used to transform the points from data space to plot space.

Definition at line 299 of file Bars.cs.

◆ Bars() [5/6]

VectSharp.Plots.Bars< T >.Bars ( IEnumerable< IReadOnlyList< double > >  data,
Comparison< IReadOnlyList< double > >  sorting,
Func< IReadOnlyList< double >, IReadOnlyList< double > >  getBaseline,
ICoordinateSystem< IReadOnlyList< double > >  coordinateSystem 
)

Create a new Bars instance.

Parameters
dataThe data points corresponding to the tips of the bars.
sortingA comparer used to sort the bars.
getBaselineA function that returns the bottom for each bar. This function should accept a single parameter (an IReadOnlyList<T> of doubles), and return another object of the same type, representing the bottom of the bar in data space.
coordinateSystemThe coordinate system used to transform the points from data space to plot space.

Definition at line 310 of file Bars.cs.

◆ Bars() [6/6]

VectSharp.Plots.Bars< T >.Bars ( IEnumerable< IReadOnlyList< double > >  data,
ICoordinateSystem< IReadOnlyList< double > >  coordinateSystem,
bool  vertical = true 
)

Create a new Bars instance.

Parameters
dataThe data points corresponding to the tips of the bars.
coordinateSystemThe coordinate system used to transform the points from data space to plot space.
verticalIf this is true (the default), the bars rise vertically above the X axis Otherwise, the bars grow horizontally from the Y axis.

Definition at line 319 of file Bars.cs.

Member Function Documentation

◆ Plot()

void VectSharp.Plots.Bars< 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 143 of file Bars.cs.

Property Documentation

◆ CoordinateSystem

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

Implements VectSharp.Plots.IPlotElement.

Definition at line 67 of file Bars.cs.

◆ Data

SortedSet<T> VectSharp.Plots.Bars< T >.Data
getset

The data points corresponding to the tips of the bars.

Definition at line 36 of file Bars.cs.

◆ GetBaseline

Func<T, T> VectSharp.Plots.Bars< T >.GetBaseline
getset

A function that returns the bottom for each bar. This function should accept a single parameter of type T and return another T object, representing the bottom of the bar in data space.

Definition at line 43 of file Bars.cs.

◆ Margin

double VectSharp.Plots.Bars< T >.Margin
getset

The margin between consecutive bars. This should range between 0 and 1.

Definition at line 48 of file Bars.cs.

◆ PresentationAttributes

Presentation attributes for the bars.

Definition at line 73 of file Bars.cs.

◆ Tag

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

A tag to identify the bars in the plot.

Definition at line 78 of file Bars.cs.


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