Points are not visible in ScatterPointSeriesChart

3 posts, 0 answers
  1. yalçın
    yalçın avatar
    2 posts
    Member since:
    Nov 2012

    Posted 06 Oct 2015 Link to this post



    I am trying to generate a simple chart with 3 datapoint. Datapoints are defined as shown below

    public IDgraphViewModel()         {         

        Data = new ObservableCollection<ChartProfileSerisi>();        

         ChartProfileSerisi chartProfil1 = new ChartProfileSerisi();         

        chartProfil1.Noktalar.Add(new ChartVeriNoktasi(1.0,1.0));      

         chartProfil1.Noktalar.Add(new ChartVeriNoktasi(10.0, 10));    

             chartProfil1.Noktalar.Add(new ChartVeriNoktasi(140, 60));   

                            Data.Add(chartProfil1);                    } 

    I define the series with code behind

     Chart.HorizontalAxis = new LinearAxis();            Chart.VerticalAxis = new LinearAxis();                        ScatterPointSeries series1 = new ScatterPointSeries();

               series1.ItemsSource = Data[0].Noktalar;            series1.XValueBinding = new PropertyNameDataPointBinding() {PropertyName = "Zaman"};            series1.XValueBinding = new PropertyNameDataPointBinding() { PropertyName = "Stres" };            series1.Visibility = Visibility.Visible;                        


     In generated graph, axis appears correctly, x axis covers all data range up to 140 but points are not visible. In debugger, I checked

    series1.DataPoints  property, it is empty. What could be missing? The remaining code is below


    public class ChartProfileSerisi     {      

      public ObservableCollection<ChartVeriNoktasi> Noktalar { get; set; }

       public ChartProfileSerisi()        {           

     Noktalar = new ObservableCollection<ChartVeriNoktasi>();           

             }    }    



    public class ChartVeriNoktasi    {            

        public ChartVeriNoktasi(double zaman, double stres)        {      

          this.Zaman = zaman;            this.Stres = stres;        }

           public double Zaman { get; set; }   

         public double Stres { get; set; }    


  2. yalçın
    yalçın avatar
    2 posts
    Member since:
    Nov 2012

    Posted 06 Oct 2015 Link to this post

    I managed to get it work but I can't set legend marker geometry if I use a custom PointTemplate for a series. In the screenshot "Seri 1" legend is missing.

    I tried to defien an ellipseGeometry as Static Resource but it also did not work out.

  3. DevCraft R3 2016 release webinar banner
  4. Martin
    Martin avatar
    1044 posts

    Posted 08 Oct 2015 Link to this post

    Hello yalçın,

    The LegendItems in RadChartView gets their marker color from the default visual element of the corresponding series. Using a PointTemplate allows you to use any UI element as a visual for the data points. In other words the legend items doesn't know from what element to get their marker color.

    In order to display the color for a series that has a PointTemplate you can define a custom ItemTemplate for the RadLegend control and in its template add a Path that is bound to a Brush property that presents the series color.

    I hope this information helps.

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