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

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

4 Answers 30 Views
Chart
This is a migrated thread and some comments may be shown as answers.
PEIYANG
Top achievements
Rank 1
PEIYANG asked on 09 Oct 2012, 06:36 PM
How to change one point's shape of a series (just like one point is rectange square and other is default shape like point?

4 Answers, 1 is accepted

Sort by
0
Petar Marchev
Telerik team
answered on 11 Oct 2012, 08:19 AM
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.

0
PEIYANG
Top achievements
Rank 1
answered on 11 Oct 2012, 08:56 AM
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
0
PEIYANG
Top achievements
Rank 1
answered on 11 Oct 2012, 09:05 AM
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;
                }
      

           }


0
Petar Marchev
Telerik team
answered on 12 Oct 2012, 06:42 AM
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.

Tags
Chart
Asked by
PEIYANG
Top achievements
Rank 1
Answers by
Petar Marchev
Telerik team
PEIYANG
Top achievements
Rank 1
Share this question
or