Blazorise Chart API

Explore the Blazorise Chart API reference for charts and related plugins.

For examples and usage guidance, see the Chart documentation.

API

Parameters

Chart

Parameter Description TypeDefault
ChildContent

Specifies the content to render inside this Chart.

RenderFragmentnull
Data

Specifies the chart data.

ChartData<TItem>null
DataJsonString

Specifies the chart data that is serialized as json string.

string
Options

Specifies the chart options.

TOptionsnull
OptionsJsonString

Specifies the chart options that is serialized as json string.

string
OptionsObject

Specifies the chart options that is serialized as json object.

objectnull
Type

Specifies the chart type.

Possible values:Line, Bar, Pie, Doughnut, PolarArea, Radar, Scatter, Bubble

ChartTypeChartType.Line

Events

Chart

Event Description Type
Clicked

Raised when clicked on data point.

EventCallback<ChartMouseEventArgs>
Hovered

Raised when hovered over data point.

EventCallback<ChartMouseEventArgs>
MouseOut

Raised when mouse leaves the chart area.

EventCallback<ChartMouseEventArgs>

Methods

Chart

Method DescriptionReturnParameters
AddDataSet Adds a new dataset to the chart. TaskTDataSet[] datasets
AddDatasetsAndUpdate Adds new datasets and then update the chart. TaskTDataSet[] datasets
AddData Adds the new data point(s) to the specified dataset. Taskint dataSetIndex, TItem[] data
AddLabelsDatasetsAndUpdate Adds new set of labels and datasets and then update the chart. TaskIReadOnlyCollection<object> labels, TDataSet[] datasets
AddLabels Adds a new label to the chart. Taskobject[] labels
ChangeType Destroy the current chart instance and recreates it by using the same data and options. TaskChartType type
Clear Clears all the labels and data from the chart. Task
Destroy Destroys the chart instance. Calling this method should generally dispose of any chart resources. Task
PopData Removes the newest data point from the specified dataset. Taskint dataSetIndex
PopLabel Removes the newest label. Task
RemoveDataSet Removed the dataset at the specified index. Taskint dataSetIndex
Resize Manually resize the canvas element. This is run each time the canvas container is resized, but you can call this method manually if you change the size of the canvas nodes container element. Should also be called when updating the aspect ratio. Task
SetData Sets the new data point(s) to the specified dataset. Taskint dataSetIndex, List<TItem> data
SetOptionsObject Sets the chart's OptionsObject manually. Must call Update after manging this call. If the options changes AspectRatio must also call Resize after Update. Taskobject optionsObject
SetOptions Sets the chart's options manually. Must call Update after making this call. If the options changes AspectRatio must also call Resize after Update. TaskTOptions options
ShiftData Removes the oldest data point from the specified dataset. Taskint dataSetIndex
ShiftLabel Removes the oldest label. Task
Update Update and redraw the chart. Task
NotifyPluginInitialized Notifies the chart that it contains the plugin. voidChartPlugin plugin
NotifyPluginRemoved Notifies the chart that it should remove the plugin. Freeing the reference. voidChartPlugin plugin

ChartTrendline

Method DescriptionReturnParameters
AddTrendLineOptions Adds the trendline options to the chart. TaskList<ChartTrendlineData> trendlineData
On this page