Blazor Bubble Chart
A BlazorExpress.ChartJS bubble chart component is used to display three dimensions of data at the same time. The location of the bubble is determined by the first two dimensions and the size of each bubble represents a third value.
How it works #
The bubble chart visualizes three dimensions of data by mapping each point to
X, Y, and R values.
TIP
For data visualization, you can use the predefined palettes
ColorUtility.CategoricalTwelveColors for a 12-color palette and ColorUtility.CategoricalSixColors for a 6-color palette.
These palettes offer a range of distinct and visually appealing colors that can be applied to represent different categories or data elements in your visualizations.
Click event #
Set the
OnClick callback to react when a bubble is selected. The callback receives ChartClickEventArgs with the dataset, point index, label, and structured raw X, Y, and R value.
Chart Components — Dedicated Library
Chart components have been moved to the dedicated BlazorExpress.ChartJS library to support independent feature additions and easier maintenance. Complete the following steps in the Blazor project that renders the charts.
- Install the package used by these demos:
dotnet add package BlazorExpress.ChartJS --version 1.2.4 - Import the component namespace in
_Imports.razor:@using BlazorExpress.ChartJS - Load the browser scripts in this order from the host page, after the Blazor framework script.
The data-labels plugin is needed only when a chart uses data labels.
<script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/4.4.1/chart.umd.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/chartjs-plugin-datalabels/2.2.0/chartjs-plugin-datalabels.min.js"></script> <script src="_content/BlazorExpress.ChartJS/blazorexpress.chartjs.js"></script>
See the BlazorExpress.ChartJS website and GitHub repository for current package documentation. We also recommend checking the original BlazorExpress.ChartJS demos when adapting advanced examples.
For a complete charts setup walkthrough, see the
Getting Started — Charts Setup section.