Sampling problems

2 posts, 0 answers
  1. Wyller
    Wyller avatar
    6 posts
    Member since:
    Oct 2010

    Posted 05 Nov 2010 Link to this post


    I'm adding 5 series with 10000 points  per series in a chart and I'm experiencing a poor performance.
    I've followed all Telerik's tips to improve the performance but I got a little trouble when trying to use the sampling. It's not  rendering right, maybe I'm not doing it correctly.

    The images are attached.

    Here's my chart configuration:
                   radChart1.DefaultView.ChartArea.EnableAnimations = false;
               radChart1.DefaultView.ChartArea.LabelFormatBehavior = LabelFormatBehavior.None;
               radChart1.DefaultView.ChartArea.NoDataString = "Loading chart...";
               radChart1.DefaultView.ChartArea.ZoomScrollSettingsX.ScrollMode = ScrollMode.ScrollAndZoom;
               radChart1.DefaultView.ChartArea.ZoomScrollSettingsY.ScrollMode = ScrollMode.ScrollAndZoom;
               radChart1.DefaultView.ChartArea.AxisX.IsDateTime = true;
               radChart1.DefaultView.ChartArea.AxisX.StepLabelLevelCount = 2;
               radChart1.DefaultView.ChartArea.AxisX.StepLabelLevelHeight = 15;
               radChart1.DefaultView.ChartArea.AxisX.DefaultLabelFormat = "dd/MM HH:mm";
               radChart1.DefaultView.ChartArea.AxisX.MajorGridLinesVisibility = Visibility.Collapsed;
               radChart1.DefaultView.ChartArea.AxisX.MinorGridLinesVisibility = Visibility.Collapsed;
               radChart1.DefaultView.ChartArea.AxisY.AutoRange = false;
               radChart1.DefaultView.ChartArea.AxisY.AddRange(-1.2, 1.2, 0.5);
               radChart1.DefaultView.ChartArea.AxisY.MajorGridLinesVisibility = Visibility.Visible;
               radChart1.DefaultView.ChartArea.AxisY.MinorGridLinesVisibility = Visibility.Visible;            
               radChart1.DefaultView.ChartArea.ZoomScrollSettingsX.PropertyChanged += ZoomScrollSettingsX_PropertyChanged;
               radChart1.DefaultView.ChartArea.ZoomScrollSettingsY.PropertyChanged += ZoomScrollSettingsY_PropertyChanged;
               radChart1.SamplingSettings.SamplingThreshold = 1000;
               oGraphData.GetSeriesConfigCompleted += new EventHandler<GraphData.GetSeriesConfigCompletedEventArgs>(oGraphData_GetSeriesConfigCompleted);
               oGraphData.GetSeriesDataCompleted += new EventHandler<GraphData.GetSeriesDataCompletedEventArgs>(oGraphData_GetSeriesDataCompleted);

    Here's my LineSeries configuration:
                          var seriesMapping = new SeriesMapping();
                    seriesMapping.CollectionIndex = 0;
                    seriesMapping.LegendLabel = "Tag " + e.Result[x].Namek__BackingField;
                    seriesMapping.SeriesDefinition = new LineSeriesDefinition { ShowItemLabels = false, ShowPointMarks = false, ShowItemToolTips = false };
                    seriesMapping.SeriesDefinition.Appearance.StrokeThickness = 1;
                    seriesMapping.ItemMappings.Add(new ItemMapping { FieldName = "YValuek__BackingField", DataPointMember = DataPointMember.YValue, SamplingFunction = ChartSamplingFunction.KeepExtremes });
                    seriesMapping.ItemMappings.Add(new ItemMapping { FieldName = "XValuek__BackingField", DataPointMember = DataPointMember.XValue });
                    lstLegend.Add(new POPLegend { SerieColor = new SolidColorBrush { Color = Colors.Cyan } , ColumnName = e.Result[x].Namek__BackingField });

  2. Yavor
    Yavor avatar
    11 posts

    Posted 09 Nov 2010 Link to this post

    Hello Wyller,

    I reviewed the screenshots and the code. The code snippets seem correct. I suspect there may be a problem with the way the chart is databoud or created. To further trace the problem, it will be best if you open a formal support ticket, and send us a small working project, demonstrating your setup, and showing the unwanted behavior. We will review it locally, and get back to you with more information on the matter.

    Kind regards,
    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
Back to Top