private void OnChartSelectionChanged(ChartView sender, ChartDataPointSelectionEventArgs args) { if (args == null) return; WValue = args.Wvalue; QnValue = args.QnValue; QjValue = args.QjValue; }
private void OnChartTapped (object sender, ChartSelectionEventArgs e) { double wValue = 0; double qnValue = 0; double qjValue = 0; if (e.SelectedDataPointIndex != -1) { if (_firstSeries != null) { var wAllValues = _firstSeries.GetChartDataPoints (); var value = wAllValues.ElementAt (e.SelectedDataPointIndex); wValue = value.YValue; } if (_secondSeries != null) { var wAllValues = _secondSeries.GetChartDataPoints (); var value = wAllValues.ElementAt (e.SelectedDataPointIndex); qnValue = value.YValue; } if (_thirdSeries != null) { var wAllValues = _thirdSeries.GetChartDataPoints (); var value = wAllValues.ElementAt (e.SelectedDataPointIndex); qjValue = value.YValue; } } var parameter = new ChartDataPointSelectionEventArgs () { Wvalue = wValue, QnValue = qnValue, QjValue = qjValue }; MessagingCenter.Send (this, MessagingCenterKeys.ChartSelectionChangedKey, parameter); }