-
Notifications
You must be signed in to change notification settings - Fork 4
Home
ipax77 edited this page May 22, 2026
·
2 revisions
pax.BlazorChartJs renders Chart.js charts in Blazor from typed C# configuration objects. Start with a minimal ChartComponent, then add callbacks, plugins, live updates, large-data update paths, events, legends, time axes, or shared defaults as the chart needs them.
Current version: v0.9.0-preview2
The wiki focuses on library features that are demonstrated by the public sample app:
-
Getting Started - render the README chart with
ChartJsConfig, labels, and a dataset. -
Callbacks and Plugins - call JavaScript from chart options through
ChartJsFunctionand register a custom plugin. - Updating Charts - update values, labels, and dataset membership after first render.
-
Large Data Updates - populate a chart with many points through
SetDatasetBinaryData. - Tooltip Callbacks - customize tooltip text, colors, point styles, and external rendering.
- Time Charts - register a date adapter and configure a time axis.
- Data Labels - configure chart-level and per-dataset datalabels.
-
Events and HTML Legends - receive Chart.js events in C# and build a legend from
LegendComponentBase. -
Defaults and Helpers - configure app defaults and use
ChartComponenthelper APIs.
The basic chart page is enough to create a chart in a Blazor component. The advanced pages layer features on top of that model:
-
ChartJsFunctionkeeps JavaScript callbacks in a registered module while C# selects where they are used. - Custom plugins let Chart.js behavior and plugin options extend beyond the built-in wrapper types.
- Smooth update helpers keep a rendered chart in sync with changing data and dataset lists.
- Binary dataset updates are useful when the chart data payload is large.
- Tooltip callbacks and datalabels cover two common presentation layers above dataset values.
- Time scales need both a typed time axis and a registered Chart.js date adapter.
- Event flags opt C# handlers into chart, animation, resize, and legend interactions.
-
LegendComponentBaseturns generated Chart.js legend items into Blazor markup that can be styled and extended. - App defaults and
ChartComponenthelpers reduce repeated setup around shared charts.