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

Clickable large sampling data

1 Answer 54 Views
Chart
This is a migrated thread and some comments may be shown as answers.
Leonardo
Top achievements
Rank 1
Leonardo asked on 04 Nov 2010, 11:19 AM
Hello,

i'm trying to use Telerik Silverlight Chart to present a 30.000 points clickable graph. 
I choose to use a 1000 points sampling graph and I configure my event "DefaultView.ChartArea.ItemClick" to be fired each time the user click to one point.

My problem is that my graph isn't precise AND that it isn't showing the true values binded.
I tried to modify my sampling function without succes.

I atach to this thread a image of my rended graph. The red region is where the user points his mouse and always get the tooltip "Date: 15/04/2009 Value: 0".  This point doesn't value 0.

I will add also my graph configuration code:
           Dim lineSeries As New LineSeriesDefinition()
        lineSeries.ShowItemLabels = False
        lineSeries.ShowPointMarks = False
        lineSeries.ShowItemToolTips = True
        lineSeries.Appearance.Stroke = New SolidColorBrush(Colors.Blue)
        lineSeries.Appearance.StrokeThickness = 1
  
        Dim dataMapping As New SeriesMapping()
        dataMapping.SeriesDefinition = lineSeries
        dataMapping.ItemMappings.Add(New ItemMapping("Value.DateHeure", DataPointMember.XValue))
        dataMapping.ItemMappings.Add(New ItemMapping("Value.Valeur", DataPointMember.YValue))
        dataMapping.ItemMappings(1).SamplingFunction = ChartSamplingFunction.Min
  
        rcGraphPoint.SeriesMappings.Clear()
        rcGraphPoint.SeriesMappings.Add(dataMapping)
  
        rcGraphPoint.DefaultView.ChartArea.AxisY.MinValue = 0
        rcGraphPoint.DefaultView.ChartArea.AxisY.AutoRange = True
        rcGraphPoint.DefaultView.ChartArea.AxisX.AutoRange = False
        rcGraphPoint.DefaultView.ChartArea.AxisX.MinValue = lPoints._liste.First.Key.ToOADate
        rcGraphPoint.DefaultView.ChartArea.AxisX.MaxValue = lPoints._liste.Last.Key.ToOADate
        rcGraphPoint.DefaultView.ChartArea.AxisX.Step = 7
        rcGraphPoint.DefaultView.ChartArea.AxisX.LabelStep = 2
        rcGraphPoint.DefaultView.ChartArea.AxisX.DefaultLabelFormat = "dd/MM/yy"
        rcGraphPoint.DefaultView.ChartArea.AxisX.LabelRotationAngle = 60
        rcGraphPoint.DefaultView.ChartArea.AxisX.LayoutMode = AxisLayoutMode.Inside
        rcGraphPoint.DefaultView.ChartArea.LabelFormatBehavior = LabelFormatBehavior.None
        rcGraphPoint.DefaultView.ChartArea.EnableAnimations = True
  
        AddHandler rcGraphPoint.DefaultView.ChartArea.ItemClick, AddressOf rcGraphPoint_Click
        AddHandler rcGraphPoint.DefaultView.ChartArea.ItemToolTipOpening, AddressOf rcGraphPoint_ItemToolTipOpening        
  
        rcGraphPoint.DefaultView.ChartLegend.Visibility = Windows.Visibility.Collapsed
        rcGraphPoint.SamplingSettings.SamplingThreshold = 1000
  
        rcGraphPoint.ItemsSource = lPoints._liste



Thanks for your answers!

1 Answer, 1 is accepted

Sort by
0
Evgeni "Zammy" Petrov
Telerik team
answered on 09 Nov 2010, 01:10 PM
Hi Leonardo,

What happens when you change the sampling function?

dataMapping.ItemMappings(1).SamplingFunction = ChartSamplingFunction.Average

 

In your example it is set to Min in the ItemMapping and getting a 0 value is the right behevior.

Here you can read about our sampling functionality:
http://www.telerik.com/help/silverlight/radchart-features-sampling.html

Best wishes,
Evgeni "Zammy" Petrov
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
Tags
Chart
Asked by
Leonardo
Top achievements
Rank 1
Answers by
Evgeni "Zammy" Petrov
Telerik team
Share this question
or