Open
Description
Hi all,
I have a problem with my plotview in Xamarin forms, i see it but when i try to pan or zomm on it, it's not work.
This is my code in C#:
var model = new PlotModel { Title = "Hello, Forms!", PlotAreaBorderColor = OxyColors.Transparent };
var BottomAxis = new TimeSpanAxis();
BottomAxis.Position = AxisPosition.Bottom;
model.PlotAreaBorderThickness = new OxyThickness(0, 0, 0, 0);
BottomAxis.IntervalLength = TimeSpanAxis.ToDouble(new TimeSpan(1,0,0));
var LeftAxis = new LinearAxis();
LeftAxis.Position = AxisPosition.Left;
LeftAxis.Minimum = 0d;
LeftAxis.Maximum = 50d;
var myController = new PlotController();
plotview.Controller = myController;
model.Axes.Add(LeftAxis);
model.Axes.Add(BottomAxis);
var Serie = new LineSeries();
Serie.Points.Add(new DataPoint(TimeSpanAxis.ToDouble(DateTime.Now.TimeOfDay.Subtract(new TimeSpan(0, 0, 20))),10d ));
Serie.Points.Add(new DataPoint(TimeSpanAxis.ToDouble(DateTime.Now.TimeOfDay.Subtract(new TimeSpan(0, 3, 20))),55d ));
Serie.Points.Add(new DataPoint(TimeSpanAxis.ToDouble(DateTime.Now.TimeOfDay.Subtract(new TimeSpan(0, 4, 20))),15d ));
model.Series.Add(Serie);
plotview.Model = model;
And this is View on XAML:
<oxy:PlotView x:Name="plotview" VerticalOptions="FillAndExpand" HorizontalOptions="FillAndExpand" Grid.Row="0" Grid.Column="1" Grid.ColumnSpan="3"/>
Any idea for resolve that?
Thanks in advance