private void Forms_ViewInitialized(object sender, Xamarin.Forms.ViewInitializedEventArgs e)
{
if (e.NativeView is SfChart)
{
sfChart = sender as Syncfusion.SfChart.XForms.SfChart;
var dataPoints = ((ChartSeries)(e.NativeView as SfChart).Series[0]).ItemsSource as ObservableCollection<Syncfusion.SfChart.XForms.ChartDataPoint>;
for (int i = 0; i < dataPoints.Count; i++)
{
var data = dataPoints[i] as Syncfusion.SfChart.XForms.ChartDataPoint;
var xValue = data.XValue.ToString();
var yValue = data.YValue.ToString();
voiceText += xValue + yValue;
}
(e.NativeView as SfChart).SelectionChanged += MainActivity_SelectionChanged;
}
}
private void MainActivity_SelectionChanged(object sender, SfChart.SelectionChangedEventArgs e)
{
(sender as SfChart).AnnounceForAccessibility(voiceText);
} |