This is a migrated thread and some comments may be shown as answers.

Multiple Series

8 Answers 167 Views
Chart
This is a migrated thread and some comments may be shown as answers.
Avi
Top achievements
Rank 1
Avi asked on 17 May 2011, 09:39 AM
I am trying to check whether Telerik chart Is the best chart for me.
I wrote a small application which shows 1000 line graphs with around 1000 points on each graph.
My performance is really lousy.
Did anyone ever tried to this ?

My Mapping is done like this:
            RadChart1.DefaultView.ChartArea.EnableAnimations = false;
            RadChart1.DefaultView.ChartArea.EnableTransitionAnimations = false;
            RadChart1.DefaultView.ChartArea.AxisY.MaxValue = 100;
           
            
            RadChart1.DefaultView.ChartLegend.MaxWidth = 100;
            LineSeriesDefinition lineSeriesDefinition = new LineSeriesDefinition();
            lineSeriesDefinition.ShowItemLabels = false;
            lineSeriesDefinition.ShowPointMarks = false;
            lineSeriesDefinition.ShowItemToolTips = false;
            ItemMapping itemMappingX = new ItemMapping();
            itemMappingX.DataPointMember = DataPointMember.XValue;
            itemMappingX.FieldName = "DoubleData";
            ItemMapping itemMappingY = new ItemMapping();
            itemMappingY.DataPointMember = DataPointMember.YValue;
            itemMappingY.FieldName = "DoubleData2";
            
            for (int i = 0; i < multiObservableCollection.Count; i++)
            {
                SeriesMapping seriesMapping = new SeriesMapping();
                seriesMapping.CollectionIndex = i;
                seriesMapping.SeriesDefinition = lineSeriesDefinition;
                seriesMapping.ItemMappings.Add(itemMappingX);
                seriesMapping.ItemMappings.Add(itemMappingY);

                this.RadChart1.SeriesMappings.Add(seriesMapping);
                Console.WriteLine(String.Format("Adding series {0}", i+1));
                
            }

8 Answers, 1 is accepted

Sort by
0
Yavor
Telerik team
answered on 19 May 2011, 07:55 AM
Hi Avi,

To see more information on how to improve the performance, please refer to the following article:

http://www.telerik.com/help/wpf/radchart-performance-tips-and-tricks.html

With thousands of points, and many series, it is normal to expect a slowdown in the performance of the control. Nevertheless, you can reduce the number of points, or simplify the series, as per the suggestions in the article, to boost the performance. I hope this information helps.

Greetings,
Yavor
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Avi
Top achievements
Rank 1
answered on 19 May 2011, 08:28 AM
I have seent this article and ofcourse implemented all suggestions and still performance are not good enough, i'll be more specific.
I need to add 1000 line series of 1000 points each. The series data is never changed and added to the chart once.
My Code is:
private void main(){
    ObservableCollection<ObservableCollection<DataClass>> multiObservableCollection = RandomDataGenerator.GetMultiObservableCollection(1000, 1000);
    SetDataMappings(multiObservableCollection );
    this.RadChart1.ItemsSource = multiObservableCollection ;
}
  
  
private void SetDataMappings(ObservableCollection<ObservableCollection<DataClass>> multiObservableCollection){
            RadChart1.DefaultView.ChartArea.EnableAnimations = false;
            RadChart1.DefaultView.ChartArea.EnableTransitionAnimations = false;
            RadChart1.DefaultView.ChartArea.AxisY.AutoRange = false;
            RadChart1.DefaultView.ChartArea.AxisY.MaxValue = 1000;
              
            RadChart1.DefaultView.ChartLegend.MaxWidth = 300;
            LineSeriesDefinition lineSeriesDefinition = new LineSeriesDefinition();
              
            lineSeriesDefinition.ShowItemLabels = false;
            lineSeriesDefinition.ShowPointMarks = false;
            lineSeriesDefinition.ShowItemToolTips = false;
  
            ItemMapping itemMappingX = new ItemMapping();
            itemMappingX.DataPointMember = DataPointMember.XValue;
            itemMappingX.FieldName = "DoubleData";
            ItemMapping itemMappingY = new ItemMapping();
            itemMappingY.DataPointMember = DataPointMember.YValue;
            itemMappingY.FieldName = "DoubleData2";
              
            for (int i = 0; i < multiObservableCollection.Count; i++)
            {
                SeriesMapping seriesMapping = new SeriesMapping();
                seriesMapping.CollectionIndex = i;
                seriesMapping.SeriesDefinition = lineSeriesDefinition;
                seriesMapping.ItemMappings.Add(itemMappingX);
                seriesMapping.ItemMappings.Add(itemMappingY);
                this.RadChart1.SeriesMappings.Add(seriesMapping);
                Console.WriteLine(String.Format("Adding series {0}", i+1));
                  
  
  
            }
}
Xaml is :
<telerik:RadChart x:Name="RadChart1"/>

Thanks,
Have a nice day
Avi
0
Yavor
Telerik team
answered on 20 May 2011, 07:27 AM
Hello Avi,

With such a large number of series and datapoints, the first step in improving the performance would be to reduce them. There is no other optimization, which would allow the control to easily render 1000 series with 1000 points each. Additionally, such a setup would carry practical implications for the end user, since navigating among this layout may be a challenge. Thus, you can consider loading only subsets of the original data, and reloading a different set, when required.
I hope this information helps.

Kind regards,
Yavor
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Thorsten
Top achievements
Rank 1
answered on 20 May 2011, 01:17 PM
Avi,

did you notice that using an ObservableCollection has a significant impact on performance? You should keep in mind that with every item added to the collection the whole series is redrawn (and possibly the whole chart as well). With 1.000 lines and 1.000 data points this would result in far more(!) than 1mio redraws. You should create you own ObservableCollection which suppresses the CollectionChange-event until it is fully populated (see the latest RadChart online documentation and the recommendation regarding using ObservableCollections).

Maybe this helps you a bit.

Thorsten
0
Avi
Top achievements
Rank 1
answered on 22 May 2011, 06:50 AM
I don't have this problem since all lists are populated before chart is performed
0
Avi
Top achievements
Rank 1
answered on 22 May 2011, 06:52 AM
Do you have any example on how to simplify the painting template ? maybe changing line series from Shape to Drawing ?
0
arun
Top achievements
Rank 1
answered on 16 Sep 2015, 12:34 PM

Hi

 I need to show multiple chart views  at one place .Whether it is achievable by using Report Viewer,Please Suggest.

With Rgards,

Arun

0
Stef
Telerik team
answered on 18 Sep 2015, 10:32 AM
Hi Arun,

You can use Telerik report to display multiple Graph items. For example create a Band report and add a Graph item in the Detail section. There will be rendered Graph items for each record in the report's DataSource.
The created report can be displayed in a WPF ReportVIewer control.


If you need further help, please open a support ticket to Telerik Reporting and elaborate on the scenario, data structure and expected layout of the report document.

Regards,
Stef
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
Chart
Asked by
Avi
Top achievements
Rank 1
Answers by
Yavor
Telerik team
Avi
Top achievements
Rank 1
Thorsten
Top achievements
Rank 1
arun
Top achievements
Rank 1
Stef
Telerik team
Share this question
or