StringFormat instead of formatted value on DateTimeAxis

Oystein Bjorke il y a 10 ans 0
This discussion was imported from CodePlex

akiss wrote at 2013-09-20 14:14:

Hi,

I've just installed OxyPlot and started experimenting with it. However, with DateTimeAxis, I ran into a strange problem. Whatever I set as StringFormat shows verbatim as the labels below the axis. I.e., if StringFormat=@"D", I see lots of Ds on the chart not the actual dates. If I set the property to null then yyyy appears instead of the years. Any ideas what's gone wrong?

Snipets below.

Thanks,
Akos

XAML:
<oxy:Plot x:Name="chart" Title="A Graph"/>
C#:
PlotModel model = new PlotModel();
var xAxis = new DateTimeAxis(AxisPosition.Bottom, null, @"D", DateTimeIntervalType.Months) { MajorGridlineStyle = LineStyle.Solid, MinorGridlineStyle = LineStyle.Dot };
model.Axes.Add(xAxis);
var yAxis = new LinearAxis(AxisPosition.Left, 0.0 / 0.0, 0.0 / 0.0, "Value") { MajorGridlineStyle = LineStyle.Solid, MinorGridlineStyle = LineStyle.Dot };
model.Axes.Add(yAxis);
chart.Model = model;
Configuration: Win 7SP1 (Hungarian), VS Pro 2012U3, OxyPlot.Core|Wpf 2013.1.82.1 via NuGet

objo wrote at 2013-09-20 14:46:

Try the latest version, this was fixed yesterday. Egészségedre!
https://oxyplot.codeplex.com/workitem/10077

akiss wrote at 2013-09-20 14:54:

Ahh, amazing response time! Thanks! :)