Why the performance of the chartview in winforms is less than the dynamic chart of excel?

1 Answer 123 Views
ChartView PivotGrid and PivotFieldList
SANDRO
Top achievements
Rank 2
Iron
Iron
Iron
SANDRO asked on 17 Aug 2022, 07:55 PM

Hi good morning.

I have made an application which uses the PivotGrid, PivotFieldList and Chartview controls to present the data in the way that an Excel pivot table and chart would.

But I am at a point where the performance of creating the graph is very low compared to Excel.

I comment on the case.

When I add one more field to the PivotGrid in the rows section, the performance to present the graph begins to be slow, in this example that I show I add the "Section" field and to graph it takes 39 seconds.

But if I add a fourth field to that row section of the PivotGrid when plotting the app crashes.

The number of records handled by the PivotGrid is currently 80,000, but with a tendency to grow, the PivotGrid has no problem loading that amount of data.

I know that reading a graph as it is seen is not practical, but the user will manipulate the fields of the PivotGrid until the required information is left, of course with filters included, but while that happens the graph must be updated, but this is not possible because the app crashes, show the image.


 

I did the exercise of getting the table from the database with all 80,000 records and passing it to Excel and making a dynamic table and graph and I was surprised to see that in Excel when adding the "Section" field it took a couple of seconds and when I added a fourth field, it takes six seconds, also the graph is not practical to read, but the important thing here is that in Excel it does not crash and it presents the graph, I show the image of the exercise in Excel.

I would like you to support me in reaching a solution so that the application does not crash when trying to graph such amount of data.

Or is this a limitation of control?, to think of an alternative.

Thanks for your attention.

1 Answer, 1 is accepted

Sort by
1
Accepted
Dess | Tech Support Engineer, Principal
Telerik team
answered on 18 Aug 2022, 10:24 AM
Hello, Sandro,  

I am really sorry to hear that you are experiencing any difficulties with RadChartView from the Telerik UI for WinForms suite. Please have in mind that MS Excel is a completely different application and if you want to make any fair (to a certain extend) comparison for loading the chart data, it is better to use the MS Chart for that purpose: https://www.c-sharpcorner.com/UploadFile/1e050f/chart-control-in-windows-form-application/ 

Our components are built from the Telerik Presentation Framework which is built on top of the .NET Framework which inevitably increases memory usage compared to other controls, such as the standard controls which simply wrap native objects.  

Apart from this introduction, I would like to note that the performance that our RadChartView offers is directly dependant on the data points it should visualize. The control is targeted for casual situations - usually several hundred points would fit on a normal display but with more points the details are lost anyways. I would recommend you to have a look at the following KB article which gives some tips how to improve the performance in RadChartView:

https://docs.telerik.com/devtools/winforms/knowledge-base/tips-and-tricks-to-optimize-performance-in-chartview 

You can give it a try in a standalone RadChartView and see how it will behave with the different approaches. I hope this information helps. If you need any further assistance please don't hesitate to contact me. 

Regards,
Dess | Tech Support Engineer, Principal
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

SANDRO
Top achievements
Rank 2
Iron
Iron
Iron
commented on 18 Aug 2022, 07:12 PM

I tried what you suggested and there was no major change.

Before all this an idea came to me, I want to add a warning to the user so that he begins to apply filters, when it is detected that there are many children within a series and that there is no applied filter and that the graphing process is stopped.

I've been working on it and I'm having trouble continuing.

1. I can't get the number of filters that exist inside radPivotGrid.RowGroupDescriptions and inside radPivotGrid.ColumnGroupDescriptions, I already saw where it stores them, but I can't get there to get the value, this will help me to send a message to the user and stop the graphing process, added picture for this case.

2. I did the Obtain PivotFieldList report filters exercise without any problem, so that is a good time to give a warning to the user that there are no filters applied and to stop the graphing process, the warning is displayed, but the continuous graphing process.

How do I stop this process, what event do I use so that the filling of the graph is not executed?

I hope you can help me on these two points.

Thank you very much.

Dess | Tech Support Engineer, Principal
Telerik team
commented on 23 Aug 2022, 07:10 AM

Hi, Sandro,

I will go straight to your questions:

1. In order to have access to certain public properties, it is necessary to cast the item to the respective type. I have prepared a sample code snippet for your reference, demonstrating how to access the filtered items:

            foreach (PropertyGroupDescriptionBase gd in this.radPivotGrid1.RowGroupDescriptions)
            {
                LabelGroupFilter groupFilter = gd.GroupFilter as LabelGroupFilter;
                if (groupFilter!=null)
                {
                    Console.WriteLine(gd.PropertyName);
                    SetCondition condition= groupFilter.Condition as SetCondition ;
                    if (condition != null)
                    {
                        foreach (var item in condition.Items)
                        {
                            Console.WriteLine(item.ToString());
                        }
                    }
                }
            }

2. I suppose that by "graphing process" you mean displaying the chart data. Please correct me if I am wrong. Note that when you add or remove group filters, the pivot UI is being updated and the respective data is displayed. The RadPivotGrid.UpdateCompleted event is being fired in this situation. If you don't want the chart to display the selected pivot data, you can disconnect the chart from the pivot by managing the RadChartView.DataSource property, e.g. setting it to null or the pivot instance.

Tags
ChartView PivotGrid and PivotFieldList
Asked by
SANDRO
Top achievements
Rank 2
Iron
Iron
Iron
Answers by
Dess | Tech Support Engineer, Principal
Telerik team
Share this question
or