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.

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.

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.

DataverseChart Class

Parameters

Name
Type
Default
Description
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.
LinkedGridFunc<GridBase>?
Optional accessor that returns the grid whose filters should drive this chart. Use a lambda (() => _gridRef) so the chart can resolve the reference lazily in its own OnAfterRender — a direct Components.GridBase parameter would be baked in as null during the parent's render since Blazor captures sibling @refs later in the same pass.
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
The data source that provides the chart data. Call sites configure this (either a Components.DataverseChartDataSource, Components.AggregateDataverseChartDataSource, Components.ViewDataverseChartDataSource, etc.) and the component handles the Services.IPowerPortalsProService) lifecycle, loading state, and error display.
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: 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: LinkedGrid
Type: Func<GridBase>?
Description: Optional accessor that returns the grid whose filters should drive this chart. Use a lambda (() => _gridRef) so the chart can resolve the reference lazily in its own OnAfterRender — a direct Components.GridBase parameter would be baked in as null during the parent's render since Blazor captures sibling @refs later in the same pass.
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: The data source that provides the chart data. Call sites configure this (either a Components.DataverseChartDataSource, Components.AggregateDataverseChartDataSource, Components.ViewDataverseChartDataSource, etc.) and the component handles the Services.IPowerPortalsProService) lifecycle, loading state, and error display.
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.

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.

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').

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".

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: month number.
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: month number.
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'.

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>
The datasets to plot. Each dataset's ChartDataset.Data length should match ChartData.Labels; missing buckets should be filled with zero-valued data points so position alignment is preserved across series.
LabelsList<string>
The category labels rendered along the chart's primary axis.
Name: Datasets
Type: List<ChartDataset>
Description: The datasets to plot. Each dataset's ChartDataset.Data length should match ChartData.Labels; missing buckets should be filled with zero-valued data points so position alignment is preserved across series.
Name: Labels
Type: List<string>
Description: The category labels rendered along the chart's 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?
The default background color applied to all elements in this dataset (bars, line fill, etc.) for cartesian chart types. For radial chart types, per-point colors on IDataPoint.BackgroundColor take precedence. When null, the FluentUIChart wrapper auto-fills from the active Fluent palette.
BorderColorstring?
The default border color applied to all elements in this dataset. Same semantics as ChartDataset.BackgroundColor.
BorderWidthdouble
1
The width of the element borders in pixels. Fractional values are supported (for example 0.5 for hairline borders on high-DPI displays). Defaults to 1.
DataList<IDataPoint>
The data points in this dataset. Each Components.IDataPoint carries a numeric IDataPoint.Value for Chart.js and optional per-point IDataPoint.BackgroundColor / IDataPoint.BorderColor used by radial chart types (pie, doughnut, polarArea) to color individual segments.
Labelstring
The legend label for this dataset (for example 'Sales' or 'Won').
Name: BackgroundColor
Type: string?
Description: The default background color applied to all elements in this dataset (bars, line fill, etc.) for cartesian chart types. For radial chart types, per-point colors on IDataPoint.BackgroundColor take precedence. When null, the FluentUIChart wrapper auto-fills from the active Fluent palette.
Name: BorderColor
Type: string?
Description: The default border color applied to all elements in this dataset. Same semantics as ChartDataset.BackgroundColor.
Name: BorderWidth
Type: double
Default: 1
Description: The width of the element borders in pixels. Fractional values are supported (for example 0.5 for hairline borders on high-DPI displays). Defaults to 1.
Name: Data
Type: List<IDataPoint>
Description: The data points in this dataset. Each Components.IDataPoint carries a numeric IDataPoint.Value for Chart.js and optional per-point IDataPoint.BackgroundColor / IDataPoint.BorderColor used by radial chart types (pie, doughnut, polarArea) to color individual segments.
Name: Label
Type: string
Description: The legend label for this dataset (for example 'Sales' or 'Won').

IDataPoint

IDataPoint is an interface representing a single data point in a chart dataset. Implementations may carry additional context (record id, category, etc.) that is preserved on the C# side and made available to click handlers via ChartClickEventArgs.DataPoint.

IDataPoint Interface

Properties

Name
Type
Default
Description
BackgroundColorstring?
Optional background color for this specific data point. Used by radial chart types (pie, doughnut, polarArea) to give each segment a distinct color. When null, the FluentUIChart wrapper auto-fills from the active Fluent palette.
BorderColorstring?
Optional border color for this specific data point. Same semantics as IDataPoint.BackgroundColor.
Valuedouble
The numeric value plotted by Chart.js for this data point.
Name: BackgroundColor
Type: string?
Description: Optional background color for this specific data point. Used by radial chart types (pie, doughnut, polarArea) to give each segment a distinct color. When null, the FluentUIChart wrapper auto-fills from the active Fluent palette.
Name: BorderColor
Type: string?
Description: Optional border color for this specific data point. Same semantics as IDataPoint.BackgroundColor.
Name: Value
Type: double
Description: The numeric value plotted by Chart.js for this data point.

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?
Optional background color for this specific data point. Used by radial chart types (pie, doughnut, polarArea) to give each segment a distinct color. When null, the FluentUIChart wrapper auto-fills from the active Fluent palette.
BorderColorstring?
Optional border color for this specific data point. Same semantics as IDataPoint.BackgroundColor.
Valuedouble
0
The numeric value plotted by Chart.js for this data point.
Name: BackgroundColor
Type: string?
Description: Optional background color for this specific data point. Used by radial chart types (pie, doughnut, polarArea) to give each segment a distinct color. When null, the FluentUIChart wrapper auto-fills from the active Fluent palette.
Name: BorderColor
Type: string?
Description: Optional border color for this specific data point. Same semantics as IDataPoint.BackgroundColor.
Name: Value
Type: double
Default: 0
Description: The numeric value plotted by Chart.js for this data point.

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?
Optional background color for this specific data point. Used by radial chart types (pie, doughnut, polarArea) to give each segment a distinct color. When null, the FluentUIChart wrapper auto-fills from the active Fluent palette.
BorderColorstring?
Optional border color for this specific data point. Same semantics as IDataPoint.BackgroundColor.
RecordTableRecord?
The Dataverse row this data point was projected from. For non-aggregated queries this is a full record with TableRecord.Id populated; for aggregated queries the row has the aggregate result columns and an empty id.
Valuedouble
0
The numeric value plotted by Chart.js for this data point.
Name: BackgroundColor
Type: string?
Description: Optional background color for this specific data point. Used by radial chart types (pie, doughnut, polarArea) to give each segment a distinct color. When null, the FluentUIChart wrapper auto-fills from the active Fluent palette.
Name: BorderColor
Type: string?
Description: Optional border color for this specific data point. Same semantics as IDataPoint.BackgroundColor.
Name: Record
Type: TableRecord?
Description: The Dataverse row this data point was projected from. For non-aggregated queries this is a full record with TableRecord.Id populated; for aggregated queries the row has the aggregate result columns and an empty id.
Name: Value
Type: double
Default: 0
Description: The numeric value plotted by Chart.js for this data point.

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.

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.

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.

ChartClickEventArgs Class

Properties

Name
Type
Default
Description
DataIndexint
0
The zero-based index of the data point within its dataset.
DataPointIDataPoint?
The actual Components.IDataPoint instance that backs the clicked element. Pattern-match against your custom subclass 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: IDataPoint?
Description: The actual Components.IDataPoint instance that backs the clicked element. Pattern-match against your custom subclass 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.

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.

DataverseChartDataSource Class

Properties

Name
Type
Default
Description
ExternalFilterXmlstring?
Optional <filter>...</filter> element merged into the resolved FetchXml at query time. Intended for external-state integration (e.g. a linked grid publishing its current filter conditions). Kept separate from any subclass-specific filter config so assigning one won't clobber the other — both filters apply if both are set.
FetchXmlstring?
The FetchXML query to execute. The base class uses this value as-is; subclasses may override Services.IPowerPortalsProService) to compute it from a higher-level config.
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 Components.ChartDataset; the dataset's ChartDataset.Label comes from the formatted series value. When null or empty, all rows form a single dataset.
SingleSeriesLabelstring
Optional dataset label applied to the single emitted dataset when DataverseChartDataSource.SeriesColumn is not set. Has no effect for multi-series queries (each series uses its own label).
ValueColumnstring
The result column name to read numeric values from. Must reference a numeric column (int, decimal, double, money, big int) on the returned rows.
Name: ExternalFilterXml
Type: string?
Description: Optional <filter>...</filter> element merged into the resolved FetchXml at query time. Intended for external-state integration (e.g. a linked grid publishing its current filter conditions). Kept separate from any subclass-specific filter config so assigning one won't clobber the other — both filters apply if both are set.
Name: FetchXml
Type: string?
Description: The FetchXML query to execute. The base class uses this value as-is; subclasses may override Services.IPowerPortalsProService) to compute it from a higher-level config.
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 Components.ChartDataset; the dataset's ChartDataset.Label comes from the formatted series value. When null or empty, all rows form a single dataset.
Name: SingleSeriesLabel
Type: string
Description: Optional dataset label applied to the single emitted dataset when DataverseChartDataSource.SeriesColumn is not set. Has no effect for multi-series queries (each series uses its own label).
Name: ValueColumn
Type: string
Description: The result column name to read numeric values from. Must reference a numeric column (int, decimal, double, money, big int) on the returned rows.

Methods

Name
Parameters
Type
Description
LoadAsyncIPowerPortalsProService service
Task<ChartData>
Executes the query and shapes the results into Components.ChartData.
Name: LoadAsync
Parameters: IPowerPortalsProService service
Type: Task<ChartData>
Description: Executes the query and shapes the results into Components.ChartData.

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.

AggregateDataverseChartDataSource Class

Properties

Name
Type
Default
Description
AggregateAggregateType
Sum
The aggregate function to apply to AggregateDataverseChartDataSource.AggregateColumn.
AggregateColumnstring
The Dataverse column to aggregate (e.g. 'estimatedvalue', 'revenue'). For AggregateType.Count this can be any column — it counts rows regardless of nulls. Sets DataverseChartDataSource.ValueColumn on the base class so they stay in sync.
ExternalFilterXmlstring?
Optional <filter>...</filter> element merged into the resolved FetchXml at query time. Intended for external-state integration (e.g. a linked grid publishing its current filter conditions). Kept separate from any subclass-specific filter config so assigning one won't clobber the other — both filters apply if both are set.
FetchXmlstring?
The FetchXML query to execute. The base class uses this value as-is; subclasses may override Services.IPowerPortalsProService) to compute it from a higher-level config.
FilterXmlstring?
Optional raw FetchXML filter fragment to inject into the generated query. Should be a complete <filter>...</filter> element. Multiple filter elements are supported — wrap them in a single <filter type='and'> parent if needed.
GroupByColumnstring
The Dataverse column to group by — this becomes the chart's X-axis labels (e.g. 'industrycode', 'actualclosedate'). Sets DataverseChartDataSource.LabelColumn on the base class so they stay in sync.
GroupByDateGroupingChartDateGrouping
None
When AggregateDataverseChartDataSource.GroupByColumn is a datetime column, set this to control how dates are bucketed. Simple values (Day, Month, Year, etc.) map to a single FetchXML dategrouping. Combined values (MonthAndYear, QuarterAndYear, etc.) emit multiple groupby attributes and merge them into formatted labels like 'Jan 2024'. Leave as ChartDateGrouping.None for non-date columns.
GroupByLinkedEntityChartLinkedEntity?
Optional linked entity chain for AggregateDataverseChartDataSource.GroupByColumn. When set, the groupby attribute is placed inside the link-entity in the generated FetchXML instead of on the main entity. Supports unlimited nesting via ChartLinkedEntity.LinkedEntity.
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 Components.ChartDataset; the dataset's ChartDataset.Label comes from the formatted series value. When null or empty, all rows form a single dataset.
SeriesDateGroupingChartDateGrouping
None
Optional date grouping for the series, applied to the same column as AggregateDataverseChartDataSource.GroupByColumn. Use this for year-over-year charts: set AggregateDataverseChartDataSource.GroupByDateGrouping to ChartDateGrouping.Month and SeriesDateGrouping to ChartDateGrouping.Year to get one series per year with months on the X-axis. When set, DataverseChartDataSource.SeriesColumn is ignored.
SeriesLinkedEntityChartLinkedEntity?
Optional linked entity chain for DataverseChartDataSource.SeriesColumn. When set, the series groupby attribute is placed inside the link-entity. Can reference the same table as AggregateDataverseChartDataSource.GroupByLinkedEntity — the builder reuses the link-entity when the join configuration matches.
SingleSeriesLabelstring
Optional dataset label applied to the single emitted dataset when DataverseChartDataSource.SeriesColumn is not set. Has no effect for multi-series queries (each series uses its own label).
TableNamestring
The Dataverse table to query (e.g. 'opportunity', 'account').
Topint?
Optional maximum number of grouped rows to return.
ValueColumnstring
The result column name to read numeric values from. Must reference a numeric column (int, decimal, double, money, big int) on the returned rows.
ViewIdGuid?
Optional saved-view id. When set, the view's filter conditions are extracted from its FetchXML and merged into the generated aggregate query. The view determines which records are included; the aggregate config determines how they're grouped.
Name: Aggregate
Type: AggregateType
Default: Sum
Description: The aggregate function to apply to AggregateDataverseChartDataSource.AggregateColumn.
Name: AggregateColumn
Type: string
Description: The Dataverse column to aggregate (e.g. 'estimatedvalue', 'revenue'). For AggregateType.Count this can be any column — it counts rows regardless of nulls. Sets DataverseChartDataSource.ValueColumn on the base class so they stay in sync.
Name: ExternalFilterXml
Type: string?
Description: Optional <filter>...</filter> element merged into the resolved FetchXml at query time. Intended for external-state integration (e.g. a linked grid publishing its current filter conditions). Kept separate from any subclass-specific filter config so assigning one won't clobber the other — both filters apply if both are set.
Name: FetchXml
Type: string?
Description: The FetchXML query to execute. The base class uses this value as-is; subclasses may override Services.IPowerPortalsProService) to compute it from a higher-level config.
Name: FilterXml
Type: string?
Description: Optional raw FetchXML filter fragment to inject into the generated query. Should be a complete <filter>...</filter> element. Multiple filter elements are supported — wrap them in a single <filter type='and'> parent if needed.
Name: GroupByColumn
Type: string
Description: The Dataverse column to group by — this becomes the chart's X-axis labels (e.g. 'industrycode', 'actualclosedate'). 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, set this to control how dates are bucketed. Simple values (Day, Month, Year, etc.) map to a single FetchXML dategrouping. Combined values (MonthAndYear, QuarterAndYear, etc.) emit multiple groupby attributes and merge them into formatted labels like 'Jan 2024'. Leave as ChartDateGrouping.None for non-date columns.
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 instead of on the main entity. Supports unlimited nesting via ChartLinkedEntity.LinkedEntity.
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 Components.ChartDataset; the dataset's ChartDataset.Label comes from the formatted series value. When null or empty, all rows form a single dataset.
Name: SeriesDateGrouping
Type: ChartDateGrouping
Default: None
Description: Optional date grouping for the series, applied to the same column as AggregateDataverseChartDataSource.GroupByColumn. Use this for year-over-year charts: set AggregateDataverseChartDataSource.GroupByDateGrouping to ChartDateGrouping.Month and SeriesDateGrouping to ChartDateGrouping.Year to get one series per year with months on the X-axis. When set, DataverseChartDataSource.SeriesColumn is ignored.
Name: SeriesLinkedEntity
Type: ChartLinkedEntity?
Description: Optional linked entity chain for DataverseChartDataSource.SeriesColumn. When set, the series groupby attribute is placed inside the link-entity. Can reference the same table as AggregateDataverseChartDataSource.GroupByLinkedEntity — the builder reuses the link-entity when the join configuration matches.
Name: SingleSeriesLabel
Type: string
Description: Optional dataset label applied to the single emitted dataset when DataverseChartDataSource.SeriesColumn is not set. Has no effect for multi-series queries (each series uses its own label).
Name: TableName
Type: string
Description: The Dataverse table to query (e.g. 'opportunity', 'account').
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 (int, decimal, double, money, big int) on the returned rows.
Name: ViewId
Type: Guid?
Description: Optional saved-view id. When set, the view's filter conditions are extracted from its FetchXML and merged into the generated aggregate query. The view determines which records are included; the aggregate config determines how they're grouped.

Methods

Name
Parameters
Type
Description
LoadAsyncIPowerPortalsProService service
Task<ChartData>
Executes the query and shapes the results into Components.ChartData.
Name: LoadAsync
Parameters: IPowerPortalsProService service
Type: Task<ChartData>
Description: Executes the query and shapes the results into Components.ChartData.

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.

ViewDataverseChartDataSource Class

Properties

Name
Type
Default
Description
ExternalFilterXmlstring?
Optional <filter>...</filter> element merged into the resolved FetchXml at query time. Intended for external-state integration (e.g. a linked grid publishing its current filter conditions). Kept separate from any subclass-specific filter config so assigning one won't clobber the other — both filters apply if both are set.
FetchXmlstring?
The FetchXML query to execute. The base class uses this value as-is; subclasses may override Services.IPowerPortalsProService) to compute it from a higher-level config.
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 Components.ChartDataset; the dataset's ChartDataset.Label comes from the formatted series value. When null or empty, all rows form a single dataset.
SingleSeriesLabelstring
Optional dataset label applied to the single emitted dataset when DataverseChartDataSource.SeriesColumn is not set. Has no effect for multi-series queries (each series uses its own label).
ValueColumnstring
The result column name to read numeric values from. Must reference a numeric column (int, decimal, double, money, big int) on the returned rows.
ViewIdGuid
00000000-0000-0000-0000-000000000000
The unique identifier of the Dataverse saved view to load. The view's FetchXml is fetched on first Services.IPowerPortalsProService) call.
Name: ExternalFilterXml
Type: string?
Description: Optional <filter>...</filter> element merged into the resolved FetchXml at query time. Intended for external-state integration (e.g. a linked grid publishing its current filter conditions). Kept separate from any subclass-specific filter config so assigning one won't clobber the other — both filters apply if both are set.
Name: FetchXml
Type: string?
Description: The FetchXML query to execute. The base class uses this value as-is; subclasses may override Services.IPowerPortalsProService) to compute it from a higher-level config.
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 Components.ChartDataset; the dataset's ChartDataset.Label comes from the formatted series value. When null or empty, all rows form a single dataset.
Name: SingleSeriesLabel
Type: string
Description: Optional dataset label applied to the single emitted dataset when DataverseChartDataSource.SeriesColumn is not set. Has no effect for multi-series queries (each series uses its own label).
Name: ValueColumn
Type: string
Description: The result column name to read numeric values from. Must reference a numeric column (int, decimal, double, money, big int) 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 view's FetchXml is fetched on first Services.IPowerPortalsProService) call.

Methods

Name
Parameters
Type
Description
LoadAsyncIPowerPortalsProService service
Task<ChartData>
Executes the query and shapes the results into Components.ChartData.
Name: LoadAsync
Parameters: IPowerPortalsProService service
Type: Task<ChartData>
Description: Executes the query and shapes the results into Components.ChartData.

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
The column on the linked table that provides the join key (e.g. 'accountid').
JoinTypeJoinOperator
Inner
The 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
The logical name of the table to join (e.g. 'account').
Tostring
The column on the parent table (or parent link-entity) to join to (e.g. 'customerid').
Name: From
Type: string
Description: The column on the linked table that provides the join key (e.g. 'accountid').
Name: JoinType
Type: JoinOperator
Default: Inner
Description: The 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: The logical name of the table to join (e.g. 'account').
Name: To
Type: string
Description: The column on the parent table (or parent link-entity) to join to (e.g. 'customerid').

Linking charts to a grid

A DataverseChart can mirror the current filter state of a MainGrid. When the user switches the grid's view or types in its search box, the chart re-aggregates against the matching records — and when the grid's Refresh button is pressed, the chart reloads alongside it. Any number of charts can link to the same grid.

Pass the grid reference through a lambda rather than directly. The lambda is resolved after the parent's render completes, so the grid's @@ref has already been captured — a direct LinkedGrid="_grid" would be evaluated as null during that same render pass.

<MainGrid @ref="_grid" TableName="opportunity" ViewIds="_viewIds" />

<DataverseChart Source="_pipelineSource" LinkedGrid="() => _grid" />
<DataverseChart Source="_ratingSource"   LinkedGrid="() => _grid" />

@code {
    private MainGrid _grid = default!;
    // ... data sources ...
}

Under the hood, GridBase exposes two events that charts subscribe to: FetchXmlChanged carries the exact FetchXml the grid just executed (late subscribers receive the most recent value immediately, so the chart still picks up the grid's starting filters if it links up after the initial load), and OnRefresh fires when the user presses Refresh so linked charts always reload even if the filter portion hasn't changed. The chart dedupes FetchXmlChanged on the filter portion so a grid sort doesn't trigger a redundant chart query.