Clickable large sampling data

2 posts, 0 answers
  1. Leonardo
    Leonardo avatar
    4 posts
    Member since:
    Nov 2010

    Posted 04 Nov 2010 Link to this post

    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!
  2. Evgeni "Zammy" Petrov
    Admin
    Evgeni "Zammy" Petrov avatar
    168 posts

    Posted 09 Nov 2010 Link to this post

    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
Back to Top