StringFormat instead of formatted value on DateTimeAxis

Oystein Bjorke 4 years ago 0
This discussion was imported from CodePlex

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


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.


<oxy:Plot x:Name="chart" Title="A Graph"/>
PlotModel model = new PlotModel();
var xAxis = new DateTimeAxis(AxisPosition.Bottom, null, @"D", DateTimeIntervalType.Months) { MajorGridlineStyle = LineStyle.Solid, MinorGridlineStyle = LineStyle.Dot };
var yAxis = new LinearAxis(AxisPosition.Left, 0.0 / 0.0, 0.0 / 0.0, "Value") { MajorGridlineStyle = LineStyle.Solid, MinorGridlineStyle = LineStyle.Dot };
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!

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

Ahh, amazing response time! Thanks! :)