Search code examples
winformsaxis-labelsoxyplotyaxis

Oxyplot move all Axis labels by a custom constraint


I have a problem with OxyPlot (Windows form) Axis labels: I'd like to move y Axis label by a custom constraint, for example put all labels where indicated by arrows in the figure:

ylabelPosition

Something like Axis.LabelPadding = 10;

The Axis is a CategoryAxis with Position = AxisPosition.Left, nothing else. How should I add a padding to each label of my axis?


Solution

  • To solve this problem you have to use IsTickCentered = true property when you define your CategoryAxis.

    new CategoryAxis { IsTickCentered = true };