I have a Oxyplot Graph in my WPF application, with LinearAxis as Y, and DateTimeAxis as X. This works fine. My question was more on the Displayed Labels in DateTimeAxis. Instead of displaying Time, I would like to display Index. For example,
I tried following (using LabelFormatter to show index),
var index = 1;
var xAxis = new DateTimeAxis()
{
Position = AxisPosition.Bottom,
MinorIntervalType = DateTimeIntervalType.Hours,
IntervalType = DateTimeIntervalType.Hours,
MajorGridlineStyle = LineStyle.Solid,
MajorStep = 1.0/24,
IntervalLength = 75,
MinorGridlineStyle = LineStyle.None,
LabelFormatter = (x) => index++.ToString()
};
This does display number instead of Time, but instead of beginning from 1,
- it starts at some value x (in my case in early 40s)
- and each time I resize the graph, the value increases (say after first resize it begins at 108).
Example
Is there a way i could achieve, even after resizing ?