How is the loading message displayed to the user for informational purposes while drawing graphics?

Hello,


I am using sfChart. I use FastLineSeries for this. The data is drawn seamlessly. But in case of big data, the user interface freezes for a few seconds while drawing. I want to show a progressbar to the user while drawing. Even if I run the ProgressBar in separate thread it freezes.


Can you help me please ?


7 Replies 1 reply marked as answer

DD Devakumar Dhanapoosanam Syncfusion Team April 12, 2022 03:25 AM UTC

Hi Ozgur,


We will validate and update you with complete details on April 12, 2022.


Regards,

Devakumar D



ÖZ Özgür April 12, 2022 06:12 AM UTC

Hi  Devakumar Dhanapoosanam,


I'm waiting. 



DD Devakumar Dhanapoosanam Syncfusion Team April 12, 2022 02:27 PM UTC

Hi Ozgur,


We have prepared a sample showing BusyIndicator while loading huge data in chart with the help of LayoutUpdated event as per in the below code example.


<chart:SfChart x:Name="chart" LayoutUpdated="chart_LayoutUpdated">

    <chart:FastLineSeries x:Name="fastLine"

                          ItemsSource="{Binding Data}"

                          XBindingPath="XValue" YBindingPath="YValue"/>

</chart:SfChart>

 

<Notification:SfBusyIndicator x:Name="busyIndicator" IsBusy="True" AnimationType="DotCircle"

                              Header="Loading" Foreground="Blue" />


private void chart_LayoutUpdated(object sender, EventArgs e)

{

    if (viewModel.isLoadedData)

    {

        busyIndicator.IsBusy = false;

        viewModel.isLoadedData = false;

    }

}


Please find the sample from the attachment below and let us know if you need any further assistance on this.


Regards,

Devakumar D


Attachment: 174244_fde0e330.zip


ÖZ Özgür April 13, 2022 05:40 AM UTC

Hi Devakumar Dhanapoosanam,


I reviewed the code you sent. The code doesn't really run a progressbar in the background. It only shows for 2 seconds and the UI freezes again. Yes, it's a small trick for the user, but it's still not what you want. As far as I understand, the actions applied to be able to draw the graph quickly freeze the UI and there is no solution to this.



YP Yuvaraj Palanisamy Syncfusion Team April 18, 2022 01:06 AM UTC

Hi Ozgur,

We will check and update you with complete details on or before 18th April 2022.


Regards,

Yuvaraj.



YP Yuvaraj Palanisamy Syncfusion Team April 18, 2022 03:02 PM UTC

Hi Ozgur,


We need some more time to validate this and we will update you with complete details on 19th April 2022. We appreciate your patience until then.


Regards,

Yuvaraj.




DD Devakumar Dhanapoosanam Syncfusion Team April 20, 2022 04:07 AM UTC

Hi Ozgur,


We can resolve the UI freezing issue by loading huge data in a separate thread and by inheriting FastLineSeries with additional property IsRendered to find series rendered using custom FastLineSegmentExt as per in the below code example.


<chart:SfChart x:Name="chart">

   

    <local:FastLineSeriesExt x:Name="fastLine"

                          ItemsSource="{Binding Data}" IsRendered="{Binding IsRendered, Mode=TwoWay}"

                          XBindingPath="XValue" YBindingPath="YValue"/>

</chart:SfChart>

 

<Notification:SfBusyIndicator x:Name="busyIndicator" IsBusy="{Binding IsRendered}"

                              AnimationType="DotCircle" Header="Loading" Foreground="Blue" />


public class FastLineSeriesExt : FastLineSeries

{

    public static readonly DependencyProperty IsRenderedProperty =

             DependencyProperty.Register("IsRendered", typeof(bool), typeof(FastLineSeriesExt), new PropertyMetadata(true));

 

    public bool IsRendered

    {

        get { return (bool)GetValue(IsRenderedProperty); }

        set { SetValue(IsRenderedProperty, value); }

    }

 

    protected override ChartSegment CreateSegment()

    {

        return new FastLineSegmentExt();

    }

}

 

public class FastLineSegmentExt : FastLineSegment

{

    public override void Update(IChartTransformer transformer)

    {

        base.Update(transformer);

 

        Dispatcher.BeginInvoke(System.Windows.Threading.DispatcherPriority.Normal,

         new Action(async() =>

        {

            await Task.Delay(10);

            if (Series is FastLineSeriesExt fastlineSeriesExt && fastlineSeriesExt.IsRendered)

            {

                fastlineSeriesExt.IsRendered = false;

            }

        }));

    }

}


While loading huge data points we can add with some millisecond delay using the Dispatcher.


Please find the modified sample from the attachment below and let us know if you need any further assistance on this.


Regards,

Devakumar D


Attachment: 174244_bd984216.zip

Marked as answer
Loader.
Up arrow icon