Xamarin Forms Oxyplot Column Series textannotation position

Xamarin Forms Oxyplot Column Series textannotation position
0

#1

I have xamarin form which using oxyplot to plot column series. I wish to display a text annotation in the chart. I able to display it but when the content of the chart is different, the position of textannotation will run. How I can fix the position of it? Below is my code

plotModel = new PlotModel
{
Title = "Test",
LegendPlacement = LegendPlacement.Outside,
LegendPosition = LegendPosition.BottomCenter,
LegendOrientation = LegendOrientation.Horizontal,
LegendBorderThickness = 0
};
TextAnnotation txtlabel = new TextAnnotation();
txtlabel.Text = "1:1000";
txtlabel.TextColor = OxyColors.Red;
txtlabel.Stroke = OxyColors.Red;
txtlabel.StrokeThickness = 2;
txtlabel.FontSize = 13;
txtlabel.TextPosition = new DataPoint(-0.2, 0.64);
plotModel.Annotations.Add(txtlabel);

Thanks


#2

Could you clarify this? I don’t understand what the problem is.


#3

The text annotation will change the position every time the chart have different content/value. It will not stick in the same position. How I can make it constantly the position of the textannotation?


#4

Have you tried setting isPanEnabled = false in both your axes?


#5

ya…i set it to false valueAxis.IsPanEnabled = false; categoryaxis.IsPanEnabled = false; but the text still not in fix position. Any idea how I can fix the position?