I have use wpf oxyplot and set x-axis to use logarithmic.
I use mvvm not code behind style.
here is my property in vm
public PlotModel ChartPlot
{
get { return _chartPlot; }
set { _chartPlot = value; RaisePropertyChanged(() => ChartPlot); }
}
wpf
<oxy:PlotView Grid.Row="1" Grid.Column="1" Model="{Binding ChartPlot}" />
//--- here is _bigDataPoints data list of points
var _bigDataPoints = new List<DataPoints>();
// #x1 double #y double
_bigDataPoints.Add(410.8070281 , 4943000.0000000 );
_bigDataPoints.Add(432.7935746 , 5041000.0000000 );
_bigDataPoints.Add(436.8319199 , 5059000.0000000 );
_bigDataPoints.Add(9918.193582 , 47320000.0000000 );
_bigDataPoints.Add(10099.91912 , 48130000.0000000 );
_bigDataPoints.Add(10216.58243 , 48650000.0000000 );
_bigDataPoints.Add(104904.5616 , 470700000.0000000 );
_bigDataPoints.Add(107282.6983 , 481300000.0000000 );
_bigDataPoints.Add(108337.1551 , 486000000.0000000 );
_bigDataPoints.Add(991388.6853 , 4422000128.0000000 );
_bigDataPoints.Add(1000362.786 , 4462000128.0000000 );
_bigDataPoints.Add(1006195.923 , 4488000000 );
var logAxisX = new LogarithmicAxis() { Position = AxisPosition.Bottom, Title = "Log(x)", UseSuperExponentialFormat = false, Base = 10 };
var linearAxisY = new LinearAxis() { Position = AxisPosition.Left, Title = "Y", UseSuperExponentialFormat = false };
// PlotModel ChartPlot = new PlotModel(); -> this is property that is binding to oxyplot control
ChartPlot.Axes.Add(linearAxisY);
ChartPlot.Axes.Add(logAxisX);
var lineSeriesBigData = new OxyPlot.Series.LineSeries();
lineSeriesBigData.Points.AddRange(_bigDataPoints);
ChartPlot.Series.Clear();
ChartPlot.Annotations.Clear();
ChartPlot.Series.Add(lineSeriesBigData);
// refresh chart
ChartPlot.InvalidatePlot(true);
Curve is missing at all, why? I have set min/max interval for chart axis but still linear curve is missing on the chart. other bug is that x-axis cannot be drag with mouse. it seem like axis is freeze. if I set maximum of x-axis he not show correct max value in x-axis. Show 100, why? y-axis is OK
