John Stritenberger
John Stritenberger

Reputation: 1274

OxyPlot MajorStep behavior

On my LinearAxis, I am attempting to always have the center value shown and major steps as a function of that center value. Consider the following...

double _centerValue = 5;
axis.Minimum   = _centerValue - 200;
axis.Maximum   = _centerValue + 200;
axis.MajorStep = 100;

My thought was that, starting at the minimum, the major step would occur every 100 units, resulting in intervals of -195, -95, 5, 105, and 205. However, the intervals occur at multiples of 100. This is undesirable in that it leaves me with an awkward graph that has an unmarked center value and unbalanced major step labels.

The following shot was taken with the code above at a _centerValue of 50..

BadGraph

The following, using my jank paint skills, is what I'm after...

GoodGraph

How can I get my desired behavior with OxyPlot? It is worth to note that _centerValue can change dynamically.

Upvotes: 0

Views: 1258

Answers (1)

Po-Sen
Po-Sen

Reputation: 487

Maybe you can override ZoomAt method to change your center.

Upvotes: 0

Related Questions