Skip to content

Extras

Chart

Bit.BlazorUI.ExtrasGraphPlot

BitChart renders native SVG computed in C# - no canvas or JavaScript engine - so it works in prerendering and static SSR. A Chart.js-like API (BitChartType + BitChartData + BitChartOptions, or one BitChartConfig) draws line, bar, area, pie, doughnut, polar area, radar, scatter, bubble, mixed and sparkline charts, styled by the bit theme and public --bit-Chart-* CSS variables, with keyboard and screen-reader support and SVG/PNG/CSV export.

Data labels

Values drawn on the data: on and inside bars, formatted on a line, percentages in a doughnut.

Values on the bars

Plugins.DataLabels prints each value on the chart. Anchor picks the point on the element (tip, middle or baseline) and Align places the label outside, on or inside that point.
Interactive chart. Use the left and right arrow keys to move through a series, the up and down arrow keys to move between series, Home and End for the first and last value, Enter to select, and Escape to leave.
Bar chart with 1 data series.
SeriesJanFebMarAprMayJunJul
Units12191422182520

Inside the bars

Anchor = End with Align = Start puts the label inside the bar; a BackgroundColor turns it into a pill that stays readable over any fill.
Interactive chart. Use the left and right arrow keys to move through a series, the up and down arrow keys to move between series, Home and End for the first and last value, Enter to select, and Escape to leave.
Bar chart with 1 data series.
SeriesJanFebMarAprMayJunJul
Units12191422182520

Formatted labels on a line

Line, scatter and radar points take labels too. Formatter shapes the text and DisplayFn filters which elements get one - here only values above 250.
Interactive chart. Use the left and right arrow keys to move through a series, the up and down arrow keys to move between series, Home and End for the first and last value, Enter to select, and Escape to leave.
Line chart with 1 data series.
SeriesJanFebMarAprMayJunJul
Visits120190260250320300280

Percentages in a doughnut

On arcs the anchor moves the label between the ring's inner and outer edge. FormatterCtx also receives the dataset and data index, which makes share-of-total labels possible.
Interactive chart. Use the left and right arrow keys to move through a series, the up and down arrow keys to move between series, Home and End for the first and last value, Enter to select, and Escape to leave.
Doughnut chart with 1 data series.
SeriesDirectOrganicReferralSocialEmail
Sessions300500180240120

Feedback

Found a mistake, a gap, or something that could be clearer? Every page and every component is one click from its source.