Annotations rendered below axis

4 posts, 0 answers
  1. Viollier
    Viollier avatar
    11 posts
    Member since:
    Jul 2016

    Posted 27 Mar Link to this post

    Hello. I am using a RadCartesianChartView with CartesianGridLineAnnotations set on the Y axis. When zooming and panning the chart, the annotations get rendered below the X axis, both the labels and the strokes. I've attached 2 screenshots to demonstrate the effect. Is there a property that we can change to prevent the annotations from going below the X axis? 

     

    Thank you.

  2. Deyan
    Admin
    Deyan avatar
    2147 posts

    Posted 28 Mar Link to this post

    Hello,

    Thanks for writing and for the attached screenshots.

    Would it be possible if you attached the source of your project or just a snippet that we can use to exactly reproduce the scenario and see what goes wrong?

    If you want to attach files, please open a new support ticket and do it there.

    Thanks for your time!

    Regards,
    Deyan
    Telerik by Progress
    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
  3. Viollier
    Viollier avatar
    11 posts
    Member since:
    Jul 2016

    Posted 31 Mar Link to this post

     

    Hi Deyan,

    i will try to post relevant snippets here. We are using custom annotations that are added as you see below:

     

    void AddValueAnnotations()
    {
        var labels = ChartModel.Labels;
        foreach (KeyValuePair<double, ValueType> entry in labels)
        {
            AddAnnotation(entry.Key, false);
        }
    }

    void AddAnnotation(double value, bool showLine)
    {
        CartesianGridLineAnnotation annotation = new CartesianGridLineAnnotation(Chart.VerticalAxis, value);
        annotation.ClipToPlotArea = false;
        if (showLine)
        {
            annotation.StrokeColor = Color.Argb(204, 153, 217, 194);
        }
        else
        {
            annotation.StrokeColor = Color.Argb(0, 0, 0, 0);
        }
        annotation.StrokeWidth = 1;
        annotation.Label = string.Format("{0:0.00}", value);
        annotation.LabelLocation = ChartAnnotationLabelLocation.Left;
        annotation.LabelHorizontalOffset = -7;
        annotation.LabelVerticalOffset = -10;
        Chart.Annotations.Add(annotation);
    }

  4. Deyan
    Admin
    Deyan avatar
    2147 posts

    Posted 03 Apr Link to this post

    Hi,

    Thanks for writing.

    I see that you are setting the ClipToPlotArea property to false. This might be causing the behavior you want to avoid. Can you try setting the property to true or there is a specific reason for it being set to false?

    Regards,
    Deyan
    Telerik by Progress
    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