Class BOBBarChart<TX, TY>
- Namespace
- BlazOrbit.Charts.Components
- Assembly
- BlazOrbit.Charts.dll
Vertical bar chart with multi-series support. X axis is categorical (typically string labels), Y axis is a linear numeric scale.
public sealed class BOBBarChart<TX, TY> : BOBChartBase<TX, TY>, IDataVisualizationFamilyComponent, IHasSeries<TX, TY>, IHasAxes where TX : notnull
Type Parameters
TXType of the X-axis categories. Compared via object.Equals(object); string is the typical choice.
TYNumeric type of the Y values (int, long, double, decimal, etc.).
- Inheritance
-
objectComponentBaseBOBChartBase<TX, TY>BOBBarChart<TX, TY>
- Implements
-
IHasSeries<TX, TY>
- Inherited Members
Constructors
BOBBarChart()
public BOBBarChart()
Properties
BarGroupRatio
Width of each bar group as a fraction of the categorical band (0..1). 0.8 means each group fills 80% of its band, leaving 10% padding on either side. Series within a group share that width equally.
[Parameter]
public double BarGroupRatio { get; set; }
Property Value
- double
OnDataHover
Fired when the user hovers a bar (mouseenter). Raised in addition to
the native SVG <title> tooltip so callers can drive
secondary UI off the same signal.
[Parameter]
public EventCallback<BOBChartHoverArgs<TX, TY>> OnDataHover { get; set; }
Property Value
- EventCallback<BOBChartHoverArgs<TX, TY>>
OnPointClick
Fired when the user clicks a bar. The argument carries the series label, the X / Y values and the point index - useful for drill-down navigation or row-selection patterns.
[Parameter]
public EventCallback<BOBChartClickArgs<TX, TY>> OnPointClick { get; set; }
Property Value
- EventCallback<BOBChartClickArgs<TX, TY>>
ReferenceLines
Horizontal reference / threshold lines drawn across the plot area (e.g. SLO targets, budget caps). Rendered over the grid but under the bars so they stay visible without blocking hover.
[Parameter]
public IEnumerable<BOBChartReferenceLine>? ReferenceLines { get; set; }
Property Value
- IEnumerable<BOBChartReferenceLine>
Series
The series rendered by the chart, in declaration order. Order affects stacking, legend listing and z-index.
[Parameter]
public IEnumerable<BOBChartSeries<TX, TY>>? Series { get; set; }
Property Value
- IEnumerable<BOBChartSeries<TX, TY>>
StackMode
Layout strategy for multi-series bars: None (default, side-by-side), Stacked (cumulative totals per category) or PercentStacked (each category normalised to 100%).
[Parameter]
public BOBBarStackMode StackMode { get; set; }
Property Value
XAxis
Configuration for the horizontal axis.
[Parameter]
public BOBChartAxis XAxis { get; set; }
Property Value
YAxis
Configuration for the vertical axis.
[Parameter]
public BOBChartAxis YAxis { get; set; }
Property Value
Methods
BuildAriaLabel()
Default ARIA label for the chart's <svg> root. Subclasses
override to inject series / value summaries (improves screen-reader
experience).
protected override string BuildAriaLabel()
Returns
- string
RenderSvg(RenderTreeBuilder)
Concrete charts override this to emit SVG content. The supplied
builder is positioned inside the <svg> root, so
implementations only need to add geometry primitives (lines, paths,
rects, text). Sequence numbers must remain unique within the override.
protected override void RenderSvg(RenderTreeBuilder builder)
Parameters
builderRenderTreeBuilderRender tree builder positioned inside the SVG root.