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

CartesianGridLineAnnotation line not show vertical

0 Answers 127 Views
ChartView
This is a migrated thread and some comments may be shown as answers.
Javier
Top achievements
Rank 1
Javier asked on 14 Feb 2019, 02:44 AM

Good evening, I have a small inconvenience, I want to show a vertical line in the highest value of the chart, but when I try to do it, it shows the line vertically. Any suggestions? Thanks.

 

this code:

 var max_linea = listaDatos.Max();
            var min_linea = listaDatos.Min();
            var posicion = listaDatos.IndexOf(listaDatos.Max());

          

            CartesianGridLineAnnotation annotation1 = new CartesianGridLineAnnotation();
            annotation1.Axis = this.ChartSuspension.Axes[1] as CartesianAxis;
            annotation1.Value = max_linea;
            annotation1.BorderColor = Color.Red;
            annotation1.BorderDashStyle = DashStyle.Solid;
            annotation1.BorderWidth = 1;
            this.ChartSuspension.Annotations.Add(annotation1);
            CartesianGridLineAnnotation annotation2 = new CartesianGridLineAnnotation();
            annotation2.Axis = this.ChartSuspension.Axes[0] as CartesianAxis;
            annotation2.Value = posicion;
            annotation2.BorderColor = Color.Blue;
            annotation2.BorderDashStyle = DashStyle.Solid;
            annotation2.BorderWidth = 1;
            this.ChartSuspension.Annotations.Add(annotation2);

No answers yet. Maybe you can help?

Tags
ChartView
Asked by
Javier
Top achievements
Rank 1
Share this question
or