Toggling SfAccumulationChart Datasource generating flickering effect

It's a Blazor server side web application. I am using SfSwitch to toggle Datasource of a SfAccumulationChart to display different data. It's generating a flickering effect whenever changling  SfSwitch . Is there anything I am wrongly impemented? I used  SfSwitch event to change the Datasource. Below is the code I used.


@page "/donutchart"

@using Syncfusion.Blazor.Buttons

@using Syncfusion.Blazor

@using Syncfusion.Blazor.Charts

@using System.Globalization;

@inject NavigationManager NavigationManager


<div>

<SfSwitch @bind-Checked="@isChecked" OnLabel="ZBC" OffLabel="Default" ValueChange="Change" TChecked="bool?" CssClass="e-large"></SfSwitch>

</div>

<div class="control-section">

<SfAccumulationChart Title="3D Professional Contracting, Inc." Theme="@Theme">

<AccumulationChartLegendSettings Visible="true" Position="LegendPosition.Bottom" Padding="0">

</AccumulationChartLegendSettings>

<AccumulationChartTooltipSettings Enable="true"></AccumulationChartTooltipSettings>

<AccumulationChartSeriesCollection>

<AccumulationChartSeries DataSource="@MatrixDataPoints" XName="MatrixType" YName="Amount" Radius="90%" InnerRadius="50%" Name="Matrix" Explode="true" ExplodeOffset="10%" ExplodeIndex="3" StartAngle="270" EndAngle="90" PointColorMapping="Color">

<AccumulationDataLabelSettings Visible="true" Name="DataLabelMappingName">

<AccumulationChartDataLabelFont FontWeight="600"></AccumulationChartDataLabelFont>

</AccumulationDataLabelSettings>

</AccumulationChartSeries>

</AccumulationChartSeriesCollection>

</SfAccumulationChart>

</div>

@code{

private bool? isChecked = false;

private Theme Theme { get; set; }

private bool IsShow = true;

public List<MatrixData> MatrixDataPoints { get; set; } = new List<MatrixData>();


public List<MatrixData> DefaultMatrixDataPoints { get; set; } = new List<MatrixData>

{

new MatrixData { MatrixType = "OpenLiability", Amount = 8357258, DataLabelMappingName = "$8357258", Color="#4e93d3" },

new MatrixData { MatrixType = "AvailableCapacity", Amount = 6642742, DataLabelMappingName = "$6642742", Color="#dcdbdc" },

};


public List<MatrixData> ZBCtMatrixDataPoints { get; set; } = new List<MatrixData>

{

new MatrixData { MatrixType = "OpenLiability", Amount = 8357258, DataLabelMappingName = "$8357258", Color="#4e93d3" },

new MatrixData { MatrixType = "AvailableCapacity", Amount = 15642742, DataLabelMappingName = "$15642742", Color="#dcdbdc" },

};


protected override void OnInitialized()

{

MatrixDataPoints = isChecked == true ? ZBCtMatrixDataPoints : DefaultMatrixDataPoints;

if (NavigationManager.Uri.IndexOf("material") > -1)

{

Theme = Theme.Material;

}

else if (NavigationManager.Uri.IndexOf("fabric") > -1)

{

Theme = Theme.Fabric;

}

else if (NavigationManager.Uri.IndexOf("bootstrap") > -1)

{

Theme = Theme.Bootstrap;

}

else if (NavigationManager.Uri.IndexOf("highcontrast") > -1)

{

Theme = Theme.HighContrast;

}

else

{

Theme = Theme.Material;

}

}


public class MatrixData

{

public string MatrixType { get; set; }

public double Amount { get; set; }

public string DataLabelMappingName { get; set; }

public string Color { get; set; }

}


private void Change(ChangeEventArgs<bool?> args)

{

MatrixDataPoints = isChecked == true ? ZBCtMatrixDataPoints : DefaultMatrixDataPoints;

}

}

<style>

.e-large {

width: 55px;

height: 25px

}

</style>




4 Replies 1 reply marked as answer

SM Srihari Muthukaruppan Syncfusion Team July 2, 2021 11:06 AM UTC

Hi Jaish, 
 
We have analyzed your query. Based on your request we have logged a bug task on this. You can keep track of it from the below feedback portal link. 
     
     
This fix will be available in our upcoming weekly patch release which is scheduled to be rolled out on or before July 13 2021. We appreciate your patience until then.  
 
Regards, 
Srihari M 



DG Durga Gopalakrishnan Syncfusion Team July 13, 2021 05:32 PM UTC

Hi Jaish, 

We are glad to announce that our v19.2.47 patch release is rolled out; we have added the fix for reported issue. You can use the latest Syncfusion.Blazor NuGet package version.  



We thank you for your support and appreciate your patience in waiting for this release. Please get in touch with us if you would require any further assistance. 

Regards, 
Durga G 


Marked as answer

JM Jaish Mathews August 18, 2021 05:16 PM UTC

Nice, it;s better now. 


I have one more question about  custom annotations. like with same data, we need 3 additiona custom annotations along with below values.

new MatrixData { MatrixType = "OpenLiability", Amount = 8357258, DataLabelMappingName = "$8357258", Color="#4e93d3" },

new MatrixData { MatrixType = "AvailableCapacity", Amount = 6642742, DataLabelMappingName = "$6642742", Color="#dcdbdc" },

The graph coming with blue and grey sections now. How add those additional 3 yellow highlighted values? use any other graph to achieve this?




DG Durga Gopalakrishnan Syncfusion Team August 19, 2021 03:16 PM UTC

Hi Jaish, 

We request you to use AccumulationChartAnnotations to display the customized text in chart. Please check with the below snippet and sample. 

<SfAccumulationChart> 
    <AccumulationChartAnnotations> 
        <AccumulationChartAnnotation X="50%" Y="80%" CoordinateUnits="@Syncfusion.Blazor.Charts.Units.Pixel" Region="@Syncfusion.Blazor.Charts.Regions.Series"> 
            <ContentTemplate> 
                <div style='font-size:24px'>72%</div> 
            </ContentTemplate> 
        </AccumulationChartAnnotation> 
    </AccumulationChartAnnotations> 
</SfAccumulationChart> 


 

 
 

Kindly revert us if you have any concerns. 

Regards, 
Durga G 


Loader.
Up arrow icon