I'm using oxyplot in my ios project to plot some graphs. I need to handle touches on the graph to add notes on it. I'm using the touch events but it's not working. Actually it works sometimes and other times it doesn't. It was working at the beginning and now it's not anymore. Does anyone know what the bug might be.
Here is the code
myLineChart.series1.TouchStarted += (sender, e) =>
{
myLineChart.xCoordinate = e.Position.X;
myLineChart.yCoordinate = e.Position.Y;
if(myLineChart.series1.Points != null){
timer = new System.Timers.Timer ();
timer.Interval = 400;
timer.Elapsed += (senderr, er) => {
InvokeOnMainThread ( () => {
dialog = new DialogView(View,Language.AddNoteLabel,Language.NotesQuestionLabel,Language.YesButton,Language.NoButton);
dialog.Show();
dialog.firstButton.TouchUpInside += (sender1, e1) => CreateNote ();
dialog.secondButton.TouchUpInside += (sender1, e1) => dialog.Dispose ();
});
timer.Dispose();
};
timer.Enabled = true;
}
e.Handled = true;
};
You may consider handle the OxyPlot.Model.TouchCompleted event.