CartesianGridLineAnnotation line not show vertical

1 posts, 0 answers
  1. Javier
    Javier avatar
    22 posts
    Member since:
    Oct 2014

    Posted 13 Feb 2019 Link to this post

    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;
                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;

Back to Top