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

Annotations rendered below axis

3 Answers 72 Views
Chart - Xamarin.iOS
This is a migrated thread and some comments may be shown as answers.
Viollier
Top achievements
Rank 1
Viollier asked on 27 Mar 2017, 07:26 AM

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.

3 Answers, 1 is accepted

Sort by
0
Deyan
Telerik team
answered on 28 Mar 2017, 03:17 PM
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
0
Viollier
Top achievements
Rank 1
answered on 31 Mar 2017, 07:23 AM

 

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

0
Deyan
Telerik team
answered on 03 Apr 2017, 08:00 AM
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
Tags
Chart - Xamarin.iOS
Asked by
Viollier
Top achievements
Rank 1
Answers by
Deyan
Telerik team
Viollier
Top achievements
Rank 1
Share this question
or