How to change one point's shape of a series (just like one point is rectange square and other is default shape like point?

5 posts, 0 answers
  1. PEIYANG
    PEIYANG avatar
    65 posts
    Member since:
    Jul 2012

    Posted 09 Oct 2012 Link to this post

    How to change one point's shape of a series (just like one point is rectange square and other is default shape like point?
  2. Petar Marchev
    Admin
    Petar Marchev avatar
    968 posts

    Posted 11 Oct 2012 Link to this post

    Hello Peiyang,

    Unfortunately the SeriesMappings of the RadChart do not offer such a point-template-selector functionality. In this help topic you can see how you can customize the point marks. You can see that in order to switch between different visuals - this logic needs to be implemented inside the ControlTemplate.

    Regards,
    Petar Marchev
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

  3. DevCraft banner
  4. PEIYANG
    PEIYANG avatar
    65 posts
    Member since:
    Jul 2012

    Posted 11 Oct 2012 Link to this post

    Can you give me a code example?I have some data ,find a data<0;and I want this point is rectange square and other is default shape like point
  5. PEIYANG
    PEIYANG avatar
    65 posts
    Member since:
    Jul 2012

    Posted 11 Oct 2012 Link to this post

    I find this solvelution,but it is only affact at first time when chart load first ,but when I change the itemsource,it is unaffact because pointMarks.Count==0,but actually it must not be 0
    void markdiff(){
               List<PointMark> pointMarks =
                   RadChart1.ChildrenOfType<PointMark>().ToList();
                List<PointMark> selectedPointMark = new List<PointMark>();

          
                if (pointMarks.Count != 0)
                {
                    foreach (var item in newDataSource)
                        selectedPointMark.Add((from n in pointMarks
                                               where condiction).First());

     

                    this.SetPointMarkSelectedState(selectedPointMark);
                }
            }
            private void SetPointMarkSelectedState(List<PointMark> selectedPointMark)
            {
              
                    foreach (var item in selectedPointMark)
                    {
                        item.Fill = new SolidColorBrush(Colors.Red);
                        item.Shape = MarkerShape.Triangle;
                        item.Size = 12;
                    }
          

               }


  6. Petar Marchev
    Admin
    Petar Marchev avatar
    968 posts

    Posted 12 Oct 2012 Link to this post

    Hi Peiyang,

    I have attached a very simple app that demonstrates one approach you may apply. You will need to override the logic inside the PlotInfoToVisibilityConverter that determines whether a Border should be visible or not. Let us know if this helps.

    Greetings,
    Petar Marchev
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Back to Top
DevCraft banner