Hi Adrian,
Kindly refer to the following code example to toggle between Table and Chart by using external button click.
Code Example:
<SfPivotView TValue="ProductDetails" @ref="pivot" ShowFieldList="true" ShowToolbar="true" Toolbar="@toolbar" AllowConditionalFormatting="true" AllowPdfExport="true" AllowExcelExport="true">
<PivotViewDisplayOption Primary="@primary" View=View.Both></PivotViewDisplayOption>
<PivotChartSettings><PivotChartSeries Type="ChartSeriesType.Column"></PivotChartSeries></PivotChartSettings>
</SfPivotView>
public Primary primary = Primary.Table;
public void ToggleView(Microsoft.AspNetCore.Components.Web.MouseEventArgs args)
{
if (primary == Primary.Chart)
{
primary = Primary.Table;
}
else
{
primary = Primary.Chart;
}
} |
Meanwhile, we have prepared a sample for your reference. Please find it from below link.
Please let us know if you have any concerns.
Regards,
Manikandan