Class PivotViewDisplayOption
Represents display options to configure the viewport rendering mode for the SfPivotView<TValue> component.
Inheritance
Inherited Members
Namespace: Syncfusion.Blazor.PivotView
Assembly: Syncfusion.Blazor.dll
Syntax
public class PivotViewDisplayOption : SfDataBoundComponent, IComponent, IHandleEvent, IHandleAfterRender, IDisposable
Remarks
The PivotViewDisplayOption class controls whether the pivot component displays as a table, a chart, or both views simultaneously. This configuration determines the visual presentation and interaction mode of the pivot data.
The following options are available:
Constructors
PivotViewDisplayOption()
Declaration
public PivotViewDisplayOption()
Properties
Primary
Gets or sets the primary view (table or chart) to display when both views are enabled.
Declaration
[Parameter]
[JsonPropertyName("primary")]
[JsonConverter(typeof(JsonStringEnumConverter))]
public Primary Primary { get; set; }
Property Value
| Type | Description |
|---|---|
| Primary | A Primary value that selects the initial view shown when both the Pivot Table and Pivot Chart are available. The default value is Table. |
Remarks
This setting takes effect only when View is set to Both.
If View is not Both, the component displays the view specified by View regardless of the Primary value.
The following options are available:
Examples
The following example enables both views and sets the chart as the primary view:
<SfPivotView TValue="ProductDetails" Width="800" Height="500">
<PivotViewDataSourceSettings DataSource="@data">
<!-- Configure rows, columns, values, and filters -->
</PivotViewDataSourceSettings>
<PivotViewDisplayOption View="View.Both" Primary="Primary.Chart" />
</SfPivotView>
View
Gets or sets the display mode of the Pivot Table (PivotView), allowing it to render as a table, a chart, or both.
Declaration
[Parameter]
[JsonPropertyName("view")]
[JsonConverter(typeof(JsonStringEnumConverter))]
public View View { get; set; }
Property Value
| Type | Description |
|---|---|
| View | A View value that determines how the component is rendered:
|
Remarks
By default, the Pivot Table renders in the table view (Table).
Use Chart to present data visually, or Both to enable simultaneous tabular and graphical analysis.
When View is set to Both, the initial view that appears is determined by the Primary property.
Examples
The following example configures the PivotView to render in chart view:
<SfPivotView TValue="ProductDetails" Width="800" Height="500">
<PivotViewDataSourceSettings DataSource="@data">
<!-- Configure rows, columns, values, and filters -->
</PivotViewDataSourceSettings>
<PivotViewDisplayOption View="View.Chart" />
</SfPivotView>
Methods
OnInitializedAsync()
Method invoked when the component is ready to start, having received its initial parameters from its parent in the render tree. Override this method if you will perform an asynchronous operation and want the component to refresh when that operation is completed.
Declaration
protected override Task OnInitializedAsync()
Returns
| Type | Description |
|---|---|
| Task | A System.Threading.Tasks.Task representing any asynchronous operation. |
Overrides
OnParametersSetAsync()
Method invoked when the component has received parameters from its parent in the render tree, and the incoming values have been assigned to properties.
Declaration
protected override Task OnParametersSetAsync()
Returns
| Type | Description |
|---|---|
| Task | A System.Threading.Tasks.Task representing any asynchronous operation. |