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

ParameterDefaultType
ChildContentnullRenderFragment

Specifies the content to render inside this Chart.
DatanullChartData<TItem>

Specifies the chart data.
DataJsonString—string

Specifies the chart data that is serialized as json string.
OptionsnullTOptions

Specifies the chart options.
OptionsJsonString—string

Specifies the chart options that is serialized as json string.
OptionsObjectnullobject

Specifies the chart options that is serialized as json object.
TypeChartType.LineChartType

Specifies the chart type.
Possible values:LineBarPieDoughnutPolarAreaRadarScatterBubble

Events

Chart

EventType
ClickedEventCallback<ChartMouseEventArgs>

Raised when clicked on data point.
HoveredEventCallback<ChartMouseEventArgs>

Raised when hovered over data point.
MouseOutEventCallback<ChartMouseEventArgs>

Raised when mouse leaves the chart area.

Methods

Chart

MethodReturnParameters
AddDataSetTaskTDataSet[] datasets

Adds a new dataset to the chart.
AddDatasetsAndUpdateTaskTDataSet[] datasets

Adds new datasets and then update the chart.
AddDataTaskint dataSetIndex, TItem[] data

Adds the new data point(s) to the specified dataset.
AddLabelsDatasetsAndUpdateTaskIReadOnlyCollection<object> labels, TDataSet[] datasets

Adds new set of labels and datasets and then update the chart.
AddLabelsTaskobject[] labels

Adds a new label to the chart.
ChangeTypeTaskChartType type

Destroy the current chart instance and recreates it by using the same data and options.
ClearTask—

Clears all the labels and data from the chart.
DestroyTask—

Destroys the chart instance. Calling this method should generally dispose of any chart resources.
PopDataTaskint dataSetIndex

Removes the newest data point from the specified dataset.
PopLabelTask—

Removes the newest label.
RemoveDataSetTaskint dataSetIndex

Removed the dataset at the specified index.
ResizeTask—

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.
SetDataTaskint dataSetIndex, List<TItem> data

Sets the new data point(s) to the specified dataset.
SetOptionsObjectTaskobject optionsObject

Sets the chart's OptionsObject manually. Must call Update after manging this call. If the options changes AspectRatio must also call Resize after Update.
SetOptionsTaskTOptions options

Sets the chart's options manually. Must call Update after making this call. If the options changes AspectRatio must also call Resize after Update.
ShiftDataTaskint dataSetIndex

Removes the oldest data point from the specified dataset.
ShiftLabelTask—

Removes the oldest label.
UpdateTask—

Update and redraw the chart.
NotifyPluginInitializedvoidChartPlugin plugin

Notifies the chart that it contains the plugin.
NotifyPluginRemovedvoidChartPlugin plugin

Notifies the chart that it should remove the plugin. Freeing the reference.

ChartTrendline

MethodReturnParameters
AddTrendLineOptionsTaskList<ChartTrendlineData> trendlineData

Adds the trendline options to the chart.