OxyPlot.WPF.RectangleAnnotation no text when using code

Oystein Bjorke 5 years ago 0
This discussion was imported from CodePlex

DShawNitec wrote at 2013-06-01 01:13:

We are converting over from the 1.3 version to 2.0. In 1.3 we had made a WPF version from LineAnnotation which work ok but we are trying to use the supplied 2.0 version.
The rectangle shows with the correct outline color and fill color in the right location but no text.
Plot has a DateTimeAxis at the bottom, normal vertical axis on left.
We are using the following:
                ra = new OxyPlot.Wpf.RectangleAnnotation();
                ra.MinimumX = OxyPlot.Axes.DateTimeAxis.ToDouble(ll);
                ra.MaximumX = OxyPlot.Axes.DateTimeAxis.ToDouble(llW);
                ra.MinimumY = yBot;
                ra.MaximumY = yTop;
                ra.Fill = Colors.White;
                ra.Stroke = Colors.Black;
                ra.StrokeThickness = 2;
                ra.ClipToBounds = false;
                ra.Text = " Case Colors";
                ra.Layer = AnnotationLayer.AboveSeries;
                ra.TextRotation = 0.0;
                CaseComparePlot.Annotations.Add(ra);
Any suggestions on what's missing?

DShawNitec wrote at 2013-06-03 18:22:

Found the problem llW was bigger than maximum on the DateTime axis which caused the text to not appear. Our old version clipped on the axes so we never saw it.

objo wrote at 2013-06-08 10:53:

The text should be centered on the visible part of the rectangle.
CodePlex