How to set space between interval on axis oxyplot

589 Views Asked by At

I'm working with Oxyplot to draw an image using image annotation. I need to set axis interval space so that the image looks stretch. Here what I mean by set the axis interval space

This the normal space

Normal space

and this is how I want it

After set the axis interval space

I got it from an application. How can I achieve that with Oxyplot?

1

There are 1 best solutions below

0
On

If you want to stretch it horizontally use Width property:

plotModel.Annotations.Add(new ImageAnnotation
{
    ImageSource = oxyImage,
    Opacity = 0.15,
    OffsetX = new PlotLength(0, PlotLengthUnit.RelativeToPlotArea),
    OffsetY = new PlotLength(0, PlotLengthUnit.RelativeToPlotArea),
    //Height = new PlotLength(0.5, PlotLengthUnit.RelativeToPlotArea),
    Width = new PlotLength(0.5, PlotLengthUnit.RelativeToViewport),
});

If you comment heigth or width line, the image will scale at the same time than the plot.