VectSharp 2.6.1
A light library for C# vector graphics
All Classes Namespaces Functions Variables Enumerations Properties Events Pages
VectSharp.Plots.StackedBars Class Reference

A plot element that draws stacked bars. More...

Inheritance diagram for VectSharp.Plots.StackedBars:

Public Member Functions

 StackedBars (IEnumerable< IReadOnlyList< double > > data, IComparer< IReadOnlyList< double > > sorting, Func< IReadOnlyList< double >, IReadOnlyList< double > > getBaseline, ICoordinateSystem< IReadOnlyList< double > > coordinateSystem)
 Create a new StackedBars instance. More...
 
 StackedBars (IEnumerable< IReadOnlyList< double > > data, Comparison< IReadOnlyList< double > > sorting, Func< IReadOnlyList< double >, IReadOnlyList< double > > getBaseline, ICoordinateSystem< IReadOnlyList< double > > coordinateSystem)
 Create a new StackedBars instance. More...
 
 StackedBars (IEnumerable< IReadOnlyList< double > > data, ICoordinateSystem< IReadOnlyList< double > > coordinateSystem, bool vertical=true)
 Create a new StackedBars 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

bool Vertical = true [get, set]
 If this is true, the bars rise vertically above the X axis Otherwise, the bars grow horizontally from the Y axis. More...
 
SortedSet< IReadOnlyList< double > > Data [get, set]
 The data points corresponding to the tips of the bars. For each bar stack, the data point contains an element determining the position of the bar on the X axis (if Vertical is true, or on the Y axis otherwise), and a set of elements determining the length of each segment in the bar stack. More...
 
Func< IReadOnlyList< double >, IReadOnlyList< double > > GetBaseline [get, set]
 A 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. More...
 
double Margin [get, set]
 The margin between consecutive bars. This should range between 0 and 1. More...
 
ICoordinateSystem< IReadOnlyList< double > > CoordinateSystem [get, set]
 The coordinate system used to transform the points from data space to plot space. More...
 
IReadOnlyList< PlotElementPresentationAttributesPresentationAttributes = new PlotElementPresentationAttributes[] { new PlotElementPresentationAttributes() } [get, set]
 Presentation attributes for the bars. An element from this collection is used for each segment in the stack; if there are more segments than elements in this collection, the presentation attributes are wrapped. More...
 
string Tag [get, set]
 A tag to identify the stacked 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 stacked bars.

Definition at line 325 of file Bars.cs.

Constructor & Destructor Documentation

◆ StackedBars() [1/3]

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

Create a new StackedBars instance.

Parameters
dataThe data points corresponding to the tips of the bars. For each bar stack, the data point contains an element determining the position of the bar on the X axis (if Vertical is true, or on the Y axis otherwise), and a set of elements determining the length of each segment in the bar stack.
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 399 of file Bars.cs.

◆ StackedBars() [2/3]

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

Create a new StackedBars instance.

Parameters
dataThe data points corresponding to the tips of the bars. For each bar stack, the data point contains an element determining the position of the bar on the X axis (if Vertical is true, or on the Y axis otherwise), and a set of elements determining the length of each segment in the bar stack.
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 418 of file Bars.cs.

◆ StackedBars() [3/3]

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

Create a new StackedBars instance.

Parameters
dataThe data points corresponding to the tips of the bars. For each bar stack, the data point contains an element determining the position of the bar on the X axis (if vertical is true, or on the Y axis otherwise), and a set of elements determining the length of each segment in the bar stack.
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 430 of file Bars.cs.

Member Function Documentation

◆ Plot()

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

Property Documentation

◆ CoordinateSystem

ICoordinateSystem<IReadOnlyList<double> > VectSharp.Plots.StackedBars.CoordinateSystem
getset

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

Implements VectSharp.Plots.IPlotElement.

Definition at line 372 of file Bars.cs.

◆ Data

SortedSet<IReadOnlyList<double> > VectSharp.Plots.StackedBars.Data
getset

The data points corresponding to the tips of the bars. For each bar stack, the data point contains an element determining the position of the bar on the X axis (if Vertical is true, or on the Y axis otherwise), and a set of elements determining the length of each segment in the bar stack.

Definition at line 341 of file Bars.cs.

◆ GetBaseline

Func<IReadOnlyList<double>, IReadOnlyList<double> > VectSharp.Plots.StackedBars.GetBaseline
getset

A 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.

Definition at line 348 of file Bars.cs.

◆ Margin

double VectSharp.Plots.StackedBars.Margin
getset

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

Definition at line 353 of file Bars.cs.

◆ PresentationAttributes

IReadOnlyList<PlotElementPresentationAttributes> VectSharp.Plots.StackedBars.PresentationAttributes = new PlotElementPresentationAttributes[] { new PlotElementPresentationAttributes() }
getset

Presentation attributes for the bars. An element from this collection is used for each segment in the stack; if there are more segments than elements in this collection, the presentation attributes are wrapped.

Definition at line 380 of file Bars.cs.

◆ Tag

string VectSharp.Plots.StackedBars.Tag
getset

A tag to identify the stacked bars in the plot.

Definition at line 385 of file Bars.cs.

◆ Vertical

bool VectSharp.Plots.StackedBars.Vertical = true
getset

If this is true, the bars rise vertically above the X axis Otherwise, the bars grow horizontally from the Y axis.

Definition at line 333 of file Bars.cs.


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