BarChartExtensions

Contains extension methods for .

Contains extension methods for BarChart.

Methods

public static BarChart AddItem<T>(BarChart chart, T item)

Adds an item to the bar chart.

Parameters:

chart (BarChart)
The bar chart.
item (T)
The item.

Returns:

The same instance so that multiple calls can be chained.

public static BarChart AddItems<T>(BarChart chart, IEnumerable<T> items)

Adds multiple items to the bar chart.

Parameters:

chart (BarChart)
The bar chart.
items (IEnumerable<T>)
The items.

Returns:

The same instance so that multiple calls can be chained.

public static BarChart AddItems<T>(BarChart chart, IEnumerable<T> items, Func<T, BarChartItem> converter)

Adds multiple items to the bar chart.

Parameters:

chart (BarChart)
The bar chart.
items (IEnumerable<T>)
The items.
converter (Func<T, BarChartItem>)
The converter that converts instances of T to BarChartItem.

Returns:

The same instance so that multiple calls can be chained.

public static BarChart CenterLabel(BarChart chart)

Centers the label.

Parameters:

chart (BarChart)
The bar chart.

Returns:

The same instance so that multiple calls can be chained.

public static BarChart HideValues(BarChart chart)

Hides values next to each bar in the bar chart.

Parameters:

chart (BarChart)
The bar chart.

Returns:

The same instance so that multiple calls can be chained.

public static BarChart Label(BarChart chart, string label)

Sets the label of the bar chart.

Parameters:

chart (BarChart)
The bar chart.
label (string)
The bar chart label.

Returns:

The same instance so that multiple calls can be chained.

public static BarChart LeftAlignLabel(BarChart chart)

Aligns the label to the left.

Parameters:

chart (BarChart)
The bar chart.

Returns:

The same instance so that multiple calls can be chained.

public static BarChart RightAlignLabel(BarChart chart)

Aligns the label to the right.

Parameters:

chart (BarChart)
The bar chart.

Returns:

The same instance so that multiple calls can be chained.

public static BarChart ShowValues(BarChart chart)

Shows values next to each bar in the bar chart.

Parameters:

chart (BarChart)
The bar chart.

Returns:

The same instance so that multiple calls can be chained.

public static BarChart ShowValues(BarChart chart, bool show)

Sets whether or not values should be shown next to each bar.

Parameters:

chart (BarChart)
The bar chart.
show (bool)
Whether or not values should be shown next to each bar.

Returns:

The same instance so that multiple calls can be chained.

public static BarChart UseValueFormatter(BarChart chart, Func<double, CultureInfo, string> func)

Sets the value formatter for the bar chart using culture info.

Parameters:

chart (BarChart)
The bar chart.
func (Func<double, CultureInfo, string>)
The value formatter function with culture info.

Returns:

The same instance so that multiple calls can be chained.

public static BarChart UseValueFormatter(BarChart chart, Func<double, string> func)

Sets the value formatter for the bar chart.

Parameters:

chart (BarChart)
The bar chart.
func (Func<double, string>)
The value formatter to use.

Returns:

The same instance so that multiple calls can be chained.

public static BarChart Width(BarChart chart, int? width)

Sets the width of the bar chart.

Parameters:

chart (BarChart)
The bar chart.
width (int?)
The bar chart width.

Returns:

The same instance so that multiple calls can be chained.

public static BarChart WithMaxValue(BarChart chart, double maxValue)

Sets the max fixed value for the chart.

Parameters:

chart (BarChart)
The bar chart.
maxValue (double)
Max value for the chart.

Returns:

The same instance so that multiple calls can be chained.