Chart API Reference

This page documents every public class, interface, and enum in the PowerPortalsPro charting library.

Components

The Blazor components that render charts.

FluentUIChart

A theme-aware wrapper around the base Chart component. Reads colors from the active Fluent UI design tokens, auto-fills dataset colors from a Fluent-derived palette, and re-themes the chart when the user toggles between light and dark mode.

Blazor

FluentUIChart Class

Parameters

Name
Type
Default
Description
DatasetsList<ChartDataset>
Gets or sets the datasets to plot. Any dataset that leaves ChartDataset.BackgroundColor or ChartDataset.BorderColor null will be auto-filled from the active Fluent palette.
EnableAnimationbool
True
Whether chart animations are enabled. Defaults to true.
Heightstring?
400px
Gets or sets the optional CSS height applied to the chart container. Defaults to 400px.
LabelsList<string>
Gets or sets the category labels rendered along the chart's primary axis.
LegendPositionChartLegendPosition?
Legend placement relative to the chart area, or ChartLegendPosition.Hidden to hide it entirely. When null, Chart.js's default (ChartLegendPosition.Top) is used.
OrientationChartOrientation?
Chart orientation. When ChartOrientation.Horizontal, categories appear on the Y axis and values on the X axis. Funnel charts default to horizontal for a top-down funnel. When null, the default for the chart type is used.
ShowBorderbool
True
Whether to wrap the chart in a themed border with rounded corners. Defaults to true.
Stackedbool
False
Whether to stack datasets on top of each other rather than side-by-side. Applies to bar and line charts.
Titlestring?
Chart title displayed above the chart. When null, no title is shown.
TypeChartType
Bar
Gets or sets the chart type to render (for example ChartType.Bar, ChartType.Line, ChartType.Pie, ChartType.Doughnut).
Widthstring?
Gets or sets the optional CSS width applied to the chart container.
XAxisPrefixstring?
Optional string prepended to each X-axis tick label.
XAxisSuffixstring?
Optional string appended to each X-axis tick label.
YAxisPrefixstring?
Optional string prepended to each Y-axis tick label and tooltip value (for example '$' for currency).
YAxisSuffixstring?
Optional string appended to each Y-axis tick label and tooltip value (for example '%' for percentages).
Name: Datasets
Type: List<ChartDataset>
Description: Gets or sets the datasets to plot. Any dataset that leaves ChartDataset.BackgroundColor or ChartDataset.BorderColor null will be auto-filled from the active Fluent palette.
Name: EnableAnimation
Type: bool
Default: True
Description: Whether chart animations are enabled. Defaults to true.
Name: Height
Type: string?
Default: 400px
Description: Gets or sets the optional CSS height applied to the chart container. Defaults to 400px.
Name: Labels
Type: List<string>
Description: Gets or sets the category labels rendered along the chart's primary axis.
Name: LegendPosition
Type: ChartLegendPosition?
Description: Legend placement relative to the chart area, or ChartLegendPosition.Hidden to hide it entirely. When null, Chart.js's default (ChartLegendPosition.Top) is used.
Name: Orientation
Type: ChartOrientation?
Description: Chart orientation. When ChartOrientation.Horizontal, categories appear on the Y axis and values on the X axis. Funnel charts default to horizontal for a top-down funnel. When null, the default for the chart type is used.
Name: ShowBorder
Type: bool
Default: True
Description: Whether to wrap the chart in a themed border with rounded corners. Defaults to true.
Name: Stacked
Type: bool
Default: False
Description: Whether to stack datasets on top of each other rather than side-by-side. Applies to bar and line charts.
Name: Title
Type: string?
Description: Chart title displayed above the chart. When null, no title is shown.
Name: Type
Type: ChartType
Default: Bar
Description: Gets or sets the chart type to render (for example ChartType.Bar, ChartType.Line, ChartType.Pie, ChartType.Doughnut).
Name: Width
Type: string?
Description: Gets or sets the optional CSS width applied to the chart container.
Name: XAxisPrefix
Type: string?
Description: Optional string prepended to each X-axis tick label.
Name: XAxisSuffix
Type: string?
Description: Optional string appended to each X-axis tick label.
Name: YAxisPrefix
Type: string?
Description: Optional string prepended to each Y-axis tick label and tooltip value (for example '$' for currency).
Name: YAxisSuffix
Type: string?
Description: Optional string appended to each Y-axis tick label and tooltip value (for example '%' for percentages).

Events

Name
Type
Description
OnElementClickEventCallback<ChartClickEventArgs>
Raised when the user clicks on a rendered chart element (a bar, slice, point, etc.). Forwarded to the underlying Components.Chart; clicks on the chart background are ignored.
Name: OnElementClick
Type: EventCallback<ChartClickEventArgs>
Description: Raised when the user clicks on a rendered chart element (a bar, slice, point, etc.). Forwarded to the underlying Components.Chart; clicks on the chart background are ignored.

Methods

Name
Parameters
Type
Description
ExportAsImageAsyncTask<string>
Exports the current chart as a PNG image and returns the data as a Base64-encoded data URI (e.g. 'data:image/png;base64,...'). Returns null if the chart has not been rendered yet.
Name: ExportAsImageAsync
Type: Task<string>
Description: Exports the current chart as a PNG image and returns the data as a Base64-encoded data URI (e.g. 'data:image/png;base64,...'). Returns null if the chart has not been rendered yet.
React

DataverseChart

A convenience component that wraps FluentUIChart and owns the data-loading lifecycle. Accepts a DataverseChartDataSource, handles loading state, error display, and provides an optional refresh button.

Blazor

DataverseChart Class

Parameters

Name
Type
Default
Description
AggregationIndexint
0
Which entry in ViewDataSource.AggregationResults to render. Defaults to 0. Lets one datasource configured with multiple aggregations drive several charts (one per metric). Ignored when DataverseChart.Source is used instead.
CrossFilterModeChartCrossFilterMode
Highlight
Slice-click behavior when a DataverseChart.DataSource is supplied. Defaults to ChartCrossFilterMode.Highlight — soft cross-filter that emphasizes the matched slice and dims sibling non-matching rows without re-fetching. The consumer-supplied DataverseChart.OnElementClick still fires alongside, for layered telemetry / drill-through behavior. Ignored when DataverseChart.Source is used.
DataSourceViewDataSource?
Shared Data.ViewDataSource instance (typically also driving a paired <MainGrid>). Mutually exclusive with DataverseChart.Source. The chart reads its data reactively from ViewDataSource.AggregationResults and dispatches cross-filter state on slice clicks per DataverseChart.CrossFilterMode. One server round-trip then keeps the grid's row page and the chart's aggregation atomically consistent.
DefaultViewIdGuid?
Optional default view ID to pre-select in the view dropdown. If not set, the first view in DataverseChart.ViewIds (or the table's default view) is selected.
EnableAnimationbool
True
Whether chart animations are enabled. Defaults to true.
Heightstring?
400px
Optional CSS height applied to the entire component (including the view selector dropdown and themed border, when shown). The internal chart fills whatever space remains after the toolbar and selector. Defaults to 400px.
LegendPositionChartLegendPosition?
Legend placement relative to the chart area, or ChartLegendPosition.Hidden to hide it entirely. When null, Chart.js's default (ChartLegendPosition.Top) is used.
OrientationChartOrientation?
Chart orientation. Funnel charts default to ChartOrientation.Horizontal for a top-down funnel. When null, the default for the chart type is used.
ShowBorderbool
True
Whether to wrap the chart in a themed border with rounded corners. Defaults to true.
ShowExportButtonbool
True
Whether to show a download button that exports the chart as a PNG image. Defaults to true.
ShowRefreshButtonbool
True
Whether to show a refresh button in the top-right corner of the chart. Defaults to true.
SourceDataverseChartDataSource?
Stand-alone class-based data source. Mutually exclusive with DataverseChart.DataSource — exactly one of the two must be supplied. With DataverseChart.Source, this component owns the load + refresh lifecycle and dispatches through Services.IChartService directly. Use when a chart owns its own fetch (no paired grid).
Stackedbool
False
Whether to stack datasets on top of each other rather than side-by-side.
Titlestring?
Chart title displayed above the chart. When null, no title is shown.
TypeChartType
Bar
The chart type to render.
ViewIdsList<Guid>?
Optional list of Dataverse view IDs to display in a dropdown above the chart. When the user selects a view, its filter conditions are merged into the data source and the chart reloads. Works with Components.AggregateDataverseChartDataSource and Components.ViewDataverseChartDataSource.
Widthstring?
Optional CSS width applied to the chart container.
XAxisPrefixstring?
Optional string prepended to each X-axis tick label.
XAxisSuffixstring?
Optional string appended to each X-axis tick label.
YAxisPrefixstring?
Optional string prepended to each Y-axis tick label and tooltip value (e.g. '$').
YAxisSuffixstring?
Optional string appended to each Y-axis tick label and tooltip value (e.g. '%').
Name: AggregationIndex
Type: int
Default: 0
Description: Which entry in ViewDataSource.AggregationResults to render. Defaults to 0. Lets one datasource configured with multiple aggregations drive several charts (one per metric). Ignored when DataverseChart.Source is used instead.
Name: CrossFilterMode
Type: ChartCrossFilterMode
Default: Highlight
Description: Slice-click behavior when a DataverseChart.DataSource is supplied. Defaults to ChartCrossFilterMode.Highlight — soft cross-filter that emphasizes the matched slice and dims sibling non-matching rows without re-fetching. The consumer-supplied DataverseChart.OnElementClick still fires alongside, for layered telemetry / drill-through behavior. Ignored when DataverseChart.Source is used.
Name: DataSource
Type: ViewDataSource?
Description: Shared Data.ViewDataSource instance (typically also driving a paired <MainGrid>). Mutually exclusive with DataverseChart.Source. The chart reads its data reactively from ViewDataSource.AggregationResults and dispatches cross-filter state on slice clicks per DataverseChart.CrossFilterMode. One server round-trip then keeps the grid's row page and the chart's aggregation atomically consistent.
Name: DefaultViewId
Type: Guid?
Description: Optional default view ID to pre-select in the view dropdown. If not set, the first view in DataverseChart.ViewIds (or the table's default view) is selected.
Name: EnableAnimation
Type: bool
Default: True
Description: Whether chart animations are enabled. Defaults to true.
Name: Height
Type: string?
Default: 400px
Description: Optional CSS height applied to the entire component (including the view selector dropdown and themed border, when shown). The internal chart fills whatever space remains after the toolbar and selector. Defaults to 400px.
Name: LegendPosition
Type: ChartLegendPosition?
Description: Legend placement relative to the chart area, or ChartLegendPosition.Hidden to hide it entirely. When null, Chart.js's default (ChartLegendPosition.Top) is used.
Name: Orientation
Type: ChartOrientation?
Description: Chart orientation. Funnel charts default to ChartOrientation.Horizontal for a top-down funnel. When null, the default for the chart type is used.
Name: ShowBorder
Type: bool
Default: True
Description: Whether to wrap the chart in a themed border with rounded corners. Defaults to true.
Name: ShowExportButton
Type: bool
Default: True
Description: Whether to show a download button that exports the chart as a PNG image. Defaults to true.
Name: ShowRefreshButton
Type: bool
Default: True
Description: Whether to show a refresh button in the top-right corner of the chart. Defaults to true.
Name: Source
Type: DataverseChartDataSource?
Description: Stand-alone class-based data source. Mutually exclusive with DataverseChart.DataSource — exactly one of the two must be supplied. With DataverseChart.Source, this component owns the load + refresh lifecycle and dispatches through Services.IChartService directly. Use when a chart owns its own fetch (no paired grid).
Name: Stacked
Type: bool
Default: False
Description: Whether to stack datasets on top of each other rather than side-by-side.
Name: Title
Type: string?
Description: Chart title displayed above the chart. When null, no title is shown.
Name: Type
Type: ChartType
Default: Bar
Description: The chart type to render.
Name: ViewIds
Type: List<Guid>?
Description: Optional list of Dataverse view IDs to display in a dropdown above the chart. When the user selects a view, its filter conditions are merged into the data source and the chart reloads. Works with Components.AggregateDataverseChartDataSource and Components.ViewDataverseChartDataSource.
Name: Width
Type: string?
Description: Optional CSS width applied to the chart container.
Name: XAxisPrefix
Type: string?
Description: Optional string prepended to each X-axis tick label.
Name: XAxisSuffix
Type: string?
Description: Optional string appended to each X-axis tick label.
Name: YAxisPrefix
Type: string?
Description: Optional string prepended to each Y-axis tick label and tooltip value (e.g. '$').
Name: YAxisSuffix
Type: string?
Description: Optional string appended to each Y-axis tick label and tooltip value (e.g. '%').

Events

Name
Type
Description
OnElementClickEventCallback<ChartClickEventArgs>
Raised when the user clicks on a rendered chart element.
Name: OnElementClick
Type: EventCallback<ChartClickEventArgs>
Description: Raised when the user clicks on a rendered chart element.
React

Chart Types & Enums

Enumerations for chart type selection and date bucketing.

ChartType

The set of chart types supported by the underlying Chart.js library: Bar, Line, Pie, Doughnut, PolarArea, Radar, Bubble, and Scatter.

Blazor

ChartType Enum

Values

Name
Value
Description
Bar0
Vertical bar chart (Chart.js 'bar').
Line1
Line chart (Chart.js 'line').
Pie2
Pie chart (Chart.js 'pie').
Doughnut3
Doughnut chart (Chart.js 'doughnut').
PolarArea4
Polar area chart (Chart.js 'polarArea').
Radar5
Radar chart (Chart.js 'radar').
Bubble6
Bubble chart (Chart.js 'bubble').
Scatter7
Scatter chart (Chart.js 'scatter').
Funnel8
Funnel chart (via chartjs-chart-funnel plugin, type 'funnel').
Name: Bar
Value: 0
Description: Vertical bar chart (Chart.js 'bar').
Name: Line
Value: 1
Description: Line chart (Chart.js 'line').
Name: Pie
Value: 2
Description: Pie chart (Chart.js 'pie').
Name: Doughnut
Value: 3
Description: Doughnut chart (Chart.js 'doughnut').
Name: PolarArea
Value: 4
Description: Polar area chart (Chart.js 'polarArea').
Name: Radar
Value: 5
Description: Radar chart (Chart.js 'radar').
Name: Bubble
Value: 6
Description: Bubble chart (Chart.js 'bubble').
Name: Scatter
Value: 7
Description: Scatter chart (Chart.js 'scatter').
Name: Funnel
Value: 8
Description: Funnel chart (via chartjs-chart-funnel plugin, type 'funnel').
React

ChartDateGrouping

Date bucketing intervals for grouping datetime columns in aggregate queries. Includes simple values (Day, Month, Year) and combined values (MonthAndYear, QuarterAndYear, etc.) that produce formatted labels like "Jan 2024".

Blazor

ChartDateGrouping Enum

Values

Name
Value
Description
None0
No date grouping — the column is grouped by its raw value.
Day1
Group by day (dategrouping='day'). Label: day number.
Week2
Group by ISO week (dategrouping='week'). Label: week number.
Month3
Group by calendar month (dategrouping='month'). Label: abbreviated month name (Jan, Feb, …) in the current culture.
Quarter4
Group by calendar quarter (dategrouping='quarter'). Label: quarter number.
Year5
Group by calendar year (dategrouping='year'). Label: year.
MonthAndYear6
Group by month + year. Label: 'Jan 2024'.
DayAndMonth7
Group by day + month. Label: '15 Jan'.
DayAndMonthAndYear8
Group by day + month + year. Label: '15 Jan 2024'.
WeekAndYear9
Group by ISO week + year. Label: 'W15 2024'.
QuarterAndYear10
Group by quarter + year. Label: 'Q1 2024'.
Name: None
Value: 0
Description: No date grouping — the column is grouped by its raw value.
Name: Day
Value: 1
Description: Group by day (dategrouping='day'). Label: day number.
Name: Week
Value: 2
Description: Group by ISO week (dategrouping='week'). Label: week number.
Name: Month
Value: 3
Description: Group by calendar month (dategrouping='month'). Label: abbreviated month name (Jan, Feb, …) in the current culture.
Name: Quarter
Value: 4
Description: Group by calendar quarter (dategrouping='quarter'). Label: quarter number.
Name: Year
Value: 5
Description: Group by calendar year (dategrouping='year'). Label: year.
Name: MonthAndYear
Value: 6
Description: Group by month + year. Label: 'Jan 2024'.
Name: DayAndMonth
Value: 7
Description: Group by day + month. Label: '15 Jan'.
Name: DayAndMonthAndYear
Value: 8
Description: Group by day + month + year. Label: '15 Jan 2024'.
Name: WeekAndYear
Value: 9
Description: Group by ISO week + year. Label: 'W15 2024'.
Name: QuarterAndYear
Value: 10
Description: Group by quarter + year. Label: 'Q1 2024'.
React

Data Model

The classes and interfaces that represent chart data, data points, theming, and click event payloads.

ChartData

Bundles the fully-shaped data needed to render a chart: a list of category labels (X axis) and one or more datasets. Returned by data source LoadAsync methods.

ChartData Class

Properties

Name
Type
Default
Description
DatasetsList<ChartDataset>
Datasets to plot. Each dataset's ChartDataset.Data length should match ChartData.Labels; missing buckets are zero-filled by the server so positional alignment is preserved across series.
LabelsList<string>
Category labels rendered along the primary axis.
Name: Datasets
Type: List<ChartDataset>
Description: Datasets to plot. Each dataset's ChartDataset.Data length should match ChartData.Labels; missing buckets are zero-filled by the server so positional alignment is preserved across series.
Name: Labels
Type: List<string>
Description: Category labels rendered along the primary axis.

ChartDataset

Represents a single dataset (series) in a chart. Contains data points, a legend label, and optional color overrides for background and border.

ChartDataset Class

Properties

Name
Type
Default
Description
BackgroundColorstring?
Default background color for every element in this dataset for cartesian chart types. For radial chart types per-point DataPoint.BackgroundColor overrides win. When null, the FluentUIChart wrapper auto-fills from the active Fluent palette.
BorderColorstring?
Default border color. Same precedence semantics as ChartDataset.BackgroundColor.
BorderWidthdouble
1
Element border width in pixels. Fractional values are supported (e.g. 0.5 for hairline borders on high-DPI displays). Defaults to 1.
DataList<DataPoint>
Data points in this dataset. Items are Models.DataPoint or a subclass (Models.DataverseDataPoint when the data source is Dataverse-backed). The polymorphic `$type` discriminator is preserved through JSON.
Labelstring
Legend label for this dataset (e.g. 'Sales' or 'Won').
Name: BackgroundColor
Type: string?
Description: Default background color for every element in this dataset for cartesian chart types. For radial chart types per-point DataPoint.BackgroundColor overrides win. When null, the FluentUIChart wrapper auto-fills from the active Fluent palette.
Name: BorderColor
Type: string?
Description: Default border color. Same precedence semantics as ChartDataset.BackgroundColor.
Name: BorderWidth
Type: double
Default: 1
Description: Element border width in pixels. Fractional values are supported (e.g. 0.5 for hairline borders on high-DPI displays). Defaults to 1.
Name: Data
Type: List<DataPoint>
Description: Data points in this dataset. Items are Models.DataPoint or a subclass (Models.DataverseDataPoint when the data source is Dataverse-backed). The polymorphic `$type` discriminator is preserved through JSON.
Name: Label
Type: string
Description: Legend label for this dataset (e.g. 'Sales' or 'Won').

DataPoint

Default implementation of IDataPoint. Subclass to attach caller-defined context (record id, region, etc.) that will be available to click handlers.

DataPoint Class

Properties

Name
Type
Default
Description
BackgroundColorstring?
Per-point background color. Used by radial chart types (pie, doughnut, polarArea) to color individual segments distinctly. When null, the FluentUIChart wrapper auto-fills from the active palette.
BorderColorstring?
Per-point border color. Same semantics as DataPoint.BackgroundColor.
Valuedouble
0
The numeric value plotted by Chart.js.
Name: BackgroundColor
Type: string?
Description: Per-point background color. Used by radial chart types (pie, doughnut, polarArea) to color individual segments distinctly. When null, the FluentUIChart wrapper auto-fills from the active palette.
Name: BorderColor
Type: string?
Description: Per-point border color. Same semantics as DataPoint.BackgroundColor.
Name: Value
Type: double
Default: 0
Description: The numeric value plotted by Chart.js.

DataverseDataPoint

An IDataPoint implementation that retains the underlying Dataverse TableRecord it was projected from. Click handlers can pattern-match on this type to access the row's id, table name, and column values.

DataverseDataPoint Class

Properties

Name
Type
Default
Description
BackgroundColorstring?
Per-point background color. Used by radial chart types (pie, doughnut, polarArea) to color individual segments distinctly. When null, the FluentUIChart wrapper auto-fills from the active palette.
BorderColorstring?
Per-point border color. Same semantics as DataPoint.BackgroundColor.
RecordTableRecord?
The Dataverse row this data point was projected from. Nullable because zero-filled buckets in a multi-series pivot don't have an originating record.
Valuedouble
0
The numeric value plotted by Chart.js.
Name: BackgroundColor
Type: string?
Description: Per-point background color. Used by radial chart types (pie, doughnut, polarArea) to color individual segments distinctly. When null, the FluentUIChart wrapper auto-fills from the active palette.
Name: BorderColor
Type: string?
Description: Per-point border color. Same semantics as DataPoint.BackgroundColor.
Name: Record
Type: TableRecord?
Description: The Dataverse row this data point was projected from. Nullable because zero-filled buckets in a multi-series pivot don't have an originating record.
Name: Value
Type: double
Default: 0
Description: The numeric value plotted by Chart.js.

ChartTheme

Theme and formatting overrides applied to a chart instance — text color, gridline color, Y-axis value formatting (prefix/suffix), chart title, stacked mode, and legend position.

Blazor

ChartTheme Class

Properties

Name
Type
Default
Description
EnableAnimationbool
True
Gets or sets whether chart animations are enabled. Defaults to true. Set to false to disable all entry and update animations.
GridColorstring?
Gets or sets the color used for axis gridlines and borders.
IndexAxisChartIndexAxis?
The Chart.js category-axis direction. Set by the component layer from the caller's Components.ChartOrientation via Components.ChartOrientation); consumers should set Orientation on the component instead of this property directly. When null, the JS layer applies a chart-type-specific default. The enum value is converted to the lowercase Chart.js string at JSON serialization time (see Components.ChartIndexAxis).
LegendPositionChartLegendPosition?
Legend placement relative to the chart area, or ChartLegendPosition.Hidden to hide it entirely. When null, Chart.js's default is used. The enum value is converted to the lowercase Chart.js string at JSON serialization time (see Components.ChartLegendPosition).
Stackedbool
False
Gets or sets whether the X and Y axes are stacked. When true, datasets are stacked on top of each other rather than displayed side-by-side. Applies to bar and line charts.
TextColorstring?
Gets or sets the color used for default text, legend labels, axis ticks, and titles.
Titlestring?
Gets or sets the chart title text displayed above the chart. When null, no title is shown.
XAxisPrefixstring?
Gets or sets a string prepended to each X-axis tick label (for example 'Q' for quarters). When null, no prefix is applied.
XAxisSuffixstring?
Gets or sets a string appended to each X-axis tick label. When null, no suffix is applied.
YAxisPrefixstring?
Gets or sets a string prepended to each Y-axis tick label and tooltip value (for example '$' for currency). When null, no prefix is applied.
YAxisSuffixstring?
Gets or sets a string appended to each Y-axis tick label and tooltip value (for example '%' for percentages). When null, no suffix is applied.
Name: EnableAnimation
Type: bool
Default: True
Description: Gets or sets whether chart animations are enabled. Defaults to true. Set to false to disable all entry and update animations.
Name: GridColor
Type: string?
Description: Gets or sets the color used for axis gridlines and borders.
Name: IndexAxis
Type: ChartIndexAxis?
Description: The Chart.js category-axis direction. Set by the component layer from the caller's Components.ChartOrientation via Components.ChartOrientation); consumers should set Orientation on the component instead of this property directly. When null, the JS layer applies a chart-type-specific default. The enum value is converted to the lowercase Chart.js string at JSON serialization time (see Components.ChartIndexAxis).
Name: LegendPosition
Type: ChartLegendPosition?
Description: Legend placement relative to the chart area, or ChartLegendPosition.Hidden to hide it entirely. When null, Chart.js's default is used. The enum value is converted to the lowercase Chart.js string at JSON serialization time (see Components.ChartLegendPosition).
Name: Stacked
Type: bool
Default: False
Description: Gets or sets whether the X and Y axes are stacked. When true, datasets are stacked on top of each other rather than displayed side-by-side. Applies to bar and line charts.
Name: TextColor
Type: string?
Description: Gets or sets the color used for default text, legend labels, axis ticks, and titles.
Name: Title
Type: string?
Description: Gets or sets the chart title text displayed above the chart. When null, no title is shown.
Name: XAxisPrefix
Type: string?
Description: Gets or sets a string prepended to each X-axis tick label (for example 'Q' for quarters). When null, no prefix is applied.
Name: XAxisSuffix
Type: string?
Description: Gets or sets a string appended to each X-axis tick label. When null, no suffix is applied.
Name: YAxisPrefix
Type: string?
Description: Gets or sets a string prepended to each Y-axis tick label and tooltip value (for example '$' for currency). When null, no prefix is applied.
Name: YAxisSuffix
Type: string?
Description: Gets or sets a string appended to each Y-axis tick label and tooltip value (for example '%' for percentages). When null, no suffix is applied.
React

ChartClickEventArgs

Payload describing a click on a single chart element (bar, slice, point, etc.). Contains the dataset index, data index, label, value, dataset label, and the original IDataPoint instance for pattern matching.

Blazor

ChartClickEventArgs Class

Properties

Name
Type
Default
Description
DataIndexint
0
The zero-based index of the data point within its dataset.
DataPointDataPoint?
The actual Models.DataPoint instance that backs the clicked element. Pattern-match against your custom subclass (e.g. Models.DataverseDataPoint) to access caller-defined context (record id, category, etc.). May be null if the indices from JavaScript no longer match the current dataset (for example because the data was replaced mid-click).
DatasetIndexint
0
The zero-based index of the dataset that contains the clicked element.
DatasetLabelstring
The label of the dataset the clicked element belongs to (for example 'Sales'), or an empty string if the dataset has no label.
Labelstring
The category label associated with the clicked element (for example 'January'), or an empty string if the chart has no labels.
Valuedouble
0
The numeric value of the clicked data point.
Name: DataIndex
Type: int
Default: 0
Description: The zero-based index of the data point within its dataset.
Name: DataPoint
Type: DataPoint?
Description: The actual Models.DataPoint instance that backs the clicked element. Pattern-match against your custom subclass (e.g. Models.DataverseDataPoint) to access caller-defined context (record id, category, etc.). May be null if the indices from JavaScript no longer match the current dataset (for example because the data was replaced mid-click).
Name: DatasetIndex
Type: int
Default: 0
Description: The zero-based index of the dataset that contains the clicked element.
Name: DatasetLabel
Type: string
Description: The label of the dataset the clicked element belongs to (for example 'Sales'), or an empty string if the dataset has no label.
Name: Label
Type: string
Description: The category label associated with the clicked element (for example 'January'), or an empty string if the chart has no labels.
Name: Value
Type: double
Default: 0
Description: The numeric value of the clicked data point.
React

Data Sources

Data source classes that load chart data from Dataverse via FetchXML queries.

DataverseChartDataSource

Base data source class that accepts raw FetchXML and column mappings. Executes the query via IPowerPortalsProService, handles RelatedRecordValue unwrapping for aggregate results, and shapes rows into single- or multi-series ChartData.

Blazor

DataverseChartDataSource Class

Properties

Name
Type
Default
Description
FetchXmlstring?
The FetchXML query to execute. The base class sends this in the request directly; subclasses override Models.ChartDataRequest) to use a different input mode.
LabelColumnstring
The result column name to use for chart labels (X axis). For raw FetchXML this is the attribute logical name (or its alias if one was specified in the FetchXML).
SeriesColumnstring?
Optional result column name used to split rows into multiple datasets. When set, rows sharing the same series value are grouped into one dataset.
SingleSeriesLabelstring
Optional dataset label applied to the single emitted dataset when DataverseChartDataSource.SeriesColumn is not set. Multi-series queries use the formatted series value as the dataset label and ignore this.
ValueColumnstring
The result column name to read numeric values from. Must reference a numeric column on the returned rows.
Name: FetchXml
Type: string?
Description: The FetchXML query to execute. The base class sends this in the request directly; subclasses override Models.ChartDataRequest) to use a different input mode.
Name: LabelColumn
Type: string
Description: The result column name to use for chart labels (X axis). For raw FetchXML this is the attribute logical name (or its alias if one was specified in the FetchXML).
Name: SeriesColumn
Type: string?
Description: Optional result column name used to split rows into multiple datasets. When set, rows sharing the same series value are grouped into one dataset.
Name: SingleSeriesLabel
Type: string
Description: Optional dataset label applied to the single emitted dataset when DataverseChartDataSource.SeriesColumn is not set. Multi-series queries use the formatted series value as the dataset label and ignore this.
Name: ValueColumn
Type: string
Description: The result column name to read numeric values from. Must reference a numeric column on the returned rows.

Methods

Name
Parameters
Type
Description
LoadAsyncIChartService chartService
Task<ChartData>
Loads chart data via the shared Services.IChartService.
Name: LoadAsync
Parameters: IChartService chartService
Type: Task<ChartData>
Description: Loads chart data via the shared Services.IChartService.
React

AggregateDataverseChartDataSource

A subclass that builds an aggregate FetchXML query from simple properties (TableName, GroupByColumn, AggregateColumn, Aggregate) instead of requiring raw FetchXML. Supports date bucketing, multi-series, view-based filtering, inline filter fragments, and linked entity joins.

Blazor

AggregateDataverseChartDataSource Class

Properties

Name
Type
Default
Description
AggregateAggregateType
Sum
The aggregate function applied to AggregateDataverseChartDataSource.AggregateColumn.
AggregateColumnstring
The Dataverse column to aggregate. For AggregateType.Count any column works. Sets DataverseChartDataSource.ValueColumn on the base class so they stay in sync.
FetchXmlstring?
The FetchXML query to execute. The base class sends this in the request directly; subclasses override Models.ChartDataRequest) to use a different input mode.
FilterXmlstring?
Optional raw FetchXML filter fragment to inject into the generated query (a complete <filter>...</filter>).
GroupByColumnstring
The Dataverse column to group by — becomes the chart's X-axis labels. Sets DataverseChartDataSource.LabelColumn on the base class so they stay in sync.
GroupByDateGroupingChartDateGrouping
None
When AggregateDataverseChartDataSource.GroupByColumn is a datetime column, controls how dates are bucketed.
GroupByLinkedEntityChartLinkedEntity?
Optional linked-entity chain for AggregateDataverseChartDataSource.GroupByColumn. When set, the groupby attribute is placed inside the link-entity in the generated FetchXML.
LabelColumnstring
The result column name to use for chart labels (X axis). For raw FetchXML this is the attribute logical name (or its alias if one was specified in the FetchXML).
SeriesColumnstring?
Optional result column name used to split rows into multiple datasets. When set, rows sharing the same series value are grouped into one dataset.
SeriesDateGroupingChartDateGrouping
None
Optional date grouping for the series — applied to the same column as AggregateDataverseChartDataSource.GroupByColumn. Year-over-year charts use ChartDateGrouping.Month on AggregateDataverseChartDataSource.GroupByDateGrouping and ChartDateGrouping.Year on this property. When set, DataverseChartDataSource.SeriesColumn is ignored.
SeriesLinkedEntityChartLinkedEntity?
Optional linked-entity chain for DataverseChartDataSource.SeriesColumn.
SingleSeriesLabelstring
Optional dataset label applied to the single emitted dataset when DataverseChartDataSource.SeriesColumn is not set. Multi-series queries use the formatted series value as the dataset label and ignore this.
TableNamestring
The Dataverse table to query (e.g. 'opportunity').
Topint?
Optional maximum number of grouped rows to return.
ValueColumnstring
The result column name to read numeric values from. Must reference a numeric column on the returned rows.
ViewIdGuid?
Optional saved-view id. When set, the view's filter conditions are merged into the generated aggregate query. Determines which records are included; the aggregate config determines how they're grouped.
Name: Aggregate
Type: AggregateType
Default: Sum
Description: The aggregate function applied to AggregateDataverseChartDataSource.AggregateColumn.
Name: AggregateColumn
Type: string
Description: The Dataverse column to aggregate. For AggregateType.Count any column works. Sets DataverseChartDataSource.ValueColumn on the base class so they stay in sync.
Name: FetchXml
Type: string?
Description: The FetchXML query to execute. The base class sends this in the request directly; subclasses override Models.ChartDataRequest) to use a different input mode.
Name: FilterXml
Type: string?
Description: Optional raw FetchXML filter fragment to inject into the generated query (a complete <filter>...</filter>).
Name: GroupByColumn
Type: string
Description: The Dataverse column to group by — becomes the chart's X-axis labels. Sets DataverseChartDataSource.LabelColumn on the base class so they stay in sync.
Name: GroupByDateGrouping
Type: ChartDateGrouping
Default: None
Description: When AggregateDataverseChartDataSource.GroupByColumn is a datetime column, controls how dates are bucketed.
Name: GroupByLinkedEntity
Type: ChartLinkedEntity?
Description: Optional linked-entity chain for AggregateDataverseChartDataSource.GroupByColumn. When set, the groupby attribute is placed inside the link-entity in the generated FetchXML.
Name: LabelColumn
Type: string
Description: The result column name to use for chart labels (X axis). For raw FetchXML this is the attribute logical name (or its alias if one was specified in the FetchXML).
Name: SeriesColumn
Type: string?
Description: Optional result column name used to split rows into multiple datasets. When set, rows sharing the same series value are grouped into one dataset.
Name: SeriesDateGrouping
Type: ChartDateGrouping
Default: None
Description: Optional date grouping for the series — applied to the same column as AggregateDataverseChartDataSource.GroupByColumn. Year-over-year charts use ChartDateGrouping.Month on AggregateDataverseChartDataSource.GroupByDateGrouping and ChartDateGrouping.Year on this property. When set, DataverseChartDataSource.SeriesColumn is ignored.
Name: SeriesLinkedEntity
Type: ChartLinkedEntity?
Description: Optional linked-entity chain for DataverseChartDataSource.SeriesColumn.
Name: SingleSeriesLabel
Type: string
Description: Optional dataset label applied to the single emitted dataset when DataverseChartDataSource.SeriesColumn is not set. Multi-series queries use the formatted series value as the dataset label and ignore this.
Name: TableName
Type: string
Description: The Dataverse table to query (e.g. 'opportunity').
Name: Top
Type: int?
Description: Optional maximum number of grouped rows to return.
Name: ValueColumn
Type: string
Description: The result column name to read numeric values from. Must reference a numeric column on the returned rows.
Name: ViewId
Type: Guid?
Description: Optional saved-view id. When set, the view's filter conditions are merged into the generated aggregate query. Determines which records are included; the aggregate config determines how they're grouped.

Methods

Name
Parameters
Type
Description
LoadAsyncIChartService chartService
Task<ChartData>
Loads chart data via the shared Services.IChartService.
Name: LoadAsync
Parameters: IChartService chartService
Type: Task<ChartData>
Description: Loads chart data via the shared Services.IChartService.
React

ViewDataverseChartDataSource

A subclass that resolves its FetchXML from a Dataverse saved view (saved query). The caller still sets LabelColumn and ValueColumn to indicate which columns map to labels and values.

Blazor

ViewDataverseChartDataSource Class

Properties

Name
Type
Default
Description
FetchXmlstring?
The FetchXML query to execute. The base class sends this in the request directly; subclasses override Models.ChartDataRequest) to use a different input mode.
LabelColumnstring
The result column name to use for chart labels (X axis). For raw FetchXML this is the attribute logical name (or its alias if one was specified in the FetchXML).
SeriesColumnstring?
Optional result column name used to split rows into multiple datasets. When set, rows sharing the same series value are grouped into one dataset.
SingleSeriesLabelstring
Optional dataset label applied to the single emitted dataset when DataverseChartDataSource.SeriesColumn is not set. Multi-series queries use the formatted series value as the dataset label and ignore this.
ValueColumnstring
The result column name to read numeric values from. Must reference a numeric column on the returned rows.
ViewIdGuid
00000000-0000-0000-0000-000000000000
The unique identifier of the Dataverse saved view to load. The server fetches its FetchXml on every call (uncached at this layer; ViewMetadataCache handles caching server-side).
Name: FetchXml
Type: string?
Description: The FetchXML query to execute. The base class sends this in the request directly; subclasses override Models.ChartDataRequest) to use a different input mode.
Name: LabelColumn
Type: string
Description: The result column name to use for chart labels (X axis). For raw FetchXML this is the attribute logical name (or its alias if one was specified in the FetchXML).
Name: SeriesColumn
Type: string?
Description: Optional result column name used to split rows into multiple datasets. When set, rows sharing the same series value are grouped into one dataset.
Name: SingleSeriesLabel
Type: string
Description: Optional dataset label applied to the single emitted dataset when DataverseChartDataSource.SeriesColumn is not set. Multi-series queries use the formatted series value as the dataset label and ignore this.
Name: ValueColumn
Type: string
Description: The result column name to read numeric values from. Must reference a numeric column on the returned rows.
Name: ViewId
Type: Guid
Default: 00000000-0000-0000-0000-000000000000
Description: The unique identifier of the Dataverse saved view to load. The server fetches its FetchXml on every call (uncached at this layer; ViewMetadataCache handles caching server-side).

Methods

Name
Parameters
Type
Description
LoadAsyncIChartService chartService
Task<ChartData>
Loads chart data via the shared Services.IChartService.
Name: LoadAsync
Parameters: IChartService chartService
Type: Task<ChartData>
Description: Loads chart data via the shared Services.IChartService.
React

ChartLinkedEntity

Describes a linked entity (join) used by AggregateDataverseChartDataSource to place a groupby or series attribute on a related table. Supports unlimited nesting via the LinkedEntity property for multi-hop joins (e.g. opportunity → account → business unit).

ChartLinkedEntity Class

Properties

Name
Type
Default
Description
Fromstring
Column on the linked table that provides the join key (e.g. 'accountid').
JoinTypeJoinOperator
Inner
Join type. Defaults to JoinOperator.Inner.
LinkedEntityChartLinkedEntity?
Optional child linked entity for multi-hop joins. The groupby/series attribute is placed on the innermost entity in the chain.
TableNamestring
Logical name of the linked table (e.g. 'account').
Tostring
Column on the parent table (or parent link-entity) to join to (e.g. 'customerid').
Name: From
Type: string
Description: Column on the linked table that provides the join key (e.g. 'accountid').
Name: JoinType
Type: JoinOperator
Default: Inner
Description: Join type. Defaults to JoinOperator.Inner.
Name: LinkedEntity
Type: ChartLinkedEntity?
Description: Optional child linked entity for multi-hop joins. The groupby/series attribute is placed on the innermost entity in the chain.
Name: TableName
Type: string
Description: Logical name of the linked table (e.g. 'account').
Name: To
Type: string
Description: Column on the parent table (or parent link-entity) to join to (e.g. 'customerid').

Sharing one datasource between a grid and a chart

A ViewDataSource can drive a MainGrid and one (or more) DataverseChart components in lockstep. One server round-trip returns the row page and the chart aggregation atomically, so there's no race where the chart shows numbers for an old filter while the grid is on a new one. Search, sort, page, and view changes on either consumer flow through the same datasource.

Construct the datasource in OnInitialized (so the injected IGridService is available) and pass it to both views via DataSource. The grid renders the row page; the chart renders AggregationResults[AggregationIndex]. Multiple aggregations are supported — each entry powers a separate chart pointing at the same datasource.

<DataverseChart DataSource="_ds" Type="ChartType.Pie" />
<MainGrid       DataSource="_ds" TableName="opportunity" />

@code {
    private ViewDataSource? _ds;

    protected override void OnInitialized()
    {
        _ds = new ViewDataSource(_gridService, new ViewDataSourceOptions
        {
            ViewId = _openOpportunitiesViewId,
            Aggregations = new[]
            {
                new ChartAggregation
                {
                    GroupBy = new ChartGrouping { Column = "opportunityratingcode" },
                    AggregateColumn = "opportunityid",
                    Aggregate = AggregateType.Count,
                },
            },
        });
    }

    public async ValueTask DisposeAsync()
    {
        if (_ds is not null) await _ds.DisposeAsync();
    }
}

Clicking a chart slice sets the datasource's Highlight, which dims non-matching rows in the paired grid (and non-matching slices in the chart) without re-fetching. Click the same slice again to clear. For drill-through navigation or a hard filter, set CrossFilterMode="ChartCrossFilterMode.None" and handle OnElementClick yourself.