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

A plot element that draws bars for categorical data. More...

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

Public Member Functions

 CategoricalBars (IEnumerable<(T, double)> data, IComparer<(T, double)> sorting, Func<(T, double),(T, double)> getBaseline, ICoordinateSystem<(T, double)> coordinateSystem)
 Create a new CategoricalBars<T> instance. More...
 
 CategoricalBars (IEnumerable<(T, double)> data, Comparison<(T, double)> sorting, Func<(T, double),(T, double)> getBaseline, ICoordinateSystem<(T, double)> coordinateSystem)
 Create a new CategoricalBars<T> instance. More...
 
 CategoricalBars (IEnumerable<(T, double)> data, Comparison<(T, double)> sorting, ICoordinateSystem<(T, double)> coordinateSystem)
 Create a new Bars<T> instance. The baseline for each (T x, double y) is determined automatically as (x, 0). More...
 
 CategoricalBars (IReadOnlyList<(T, double)> data, ICoordinateSystem<(T, double)> coordinateSystem)
 Create a new Bars<T> instance. The baseline for each (T x, double y) is determined automatically as (x, 0). More...
 
- Public Member Functions inherited from VectSharp.Plots.Bars<(T, double)>
 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...
 
 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)
 

Additional Inherited Members

- Properties inherited from VectSharp.Plots.Bars<(T, double)>
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 [get, set]
 Presentation attributes for the bars. More...
 
string Tag [get, set]
 A tag to identify the bars in the plot. More...
 

Detailed Description

A plot element that draws bars for categorical data.

Template Parameters
TThe type of the data categories.

Definition at line 245 of file Bars.cs.

Constructor & Destructor Documentation

◆ CategoricalBars() [1/4]

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

Create a new CategoricalBars<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 256 of file Bars.cs.

◆ CategoricalBars() [2/4]

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

Create a new CategoricalBars<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 267 of file Bars.cs.

◆ CategoricalBars() [3/4]

VectSharp.Plots.CategoricalBars< T >.CategoricalBars ( IEnumerable<(T, double)>  data,
Comparison<(T, double)>  sorting,
ICoordinateSystem<(T, double)>  coordinateSystem 
)

Create a new Bars<T> instance. The baseline for each (T x, double y) is determined automatically as (x, 0).

Parameters
dataThe data points corresponding to the tips of the bars.
sortingA comparer used to sort the bars.
coordinateSystemThe coordinate system used to transform the points from data space to plot space.

Definition at line 275 of file Bars.cs.

◆ CategoricalBars() [4/4]

VectSharp.Plots.CategoricalBars< T >.CategoricalBars ( IReadOnlyList<(T, double)>  data,
ICoordinateSystem<(T, double)>  coordinateSystem 
)

Create a new Bars<T> instance. The baseline for each (T x, double y) is determined automatically as (x, 0).

Parameters
dataThe data points corresponding to the tips of the bars. These should already be sorted.
coordinateSystemThe coordinate system used to transform the points from data space to plot space.

Definition at line 282 of file Bars.cs.


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