We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Accessibility for SfChart?

Thread ID:

Created:

Updated:

Platform:

Replies:

145421 Jun 20,2019 03:00 PM UTC Jul 2,2019 10:08 AM UTC Xamarin.Forms 3
loading
Tags: SfChart
James Lavery
Asked On June 20, 2019 03:00 PM UTC

Is it possible for the SfChart to hook into the Accessibility features of the phone?

Ideally we need to be able to tap on an item on a chart and use VoiceOver (iOS) and TalkBack (Android) to read the data for the item/point.

Regards,

James

Bharathiraja K [Syncfusion]
Replied On June 25, 2019 02:33 PM UTC

Hi James 
 
Greetings from Syncfusion. This functionality will work by default for the controls like Grid, NavigationDrawer which uses views like TextView in that. But this is not applicable for controls like Chart which uses canvas drawing for light weight rendering. For announcing some texts like data points in it once you touch (like the default framework controls when TalkBack is enabled), we can use ContentDescription or AnnounceForAccessibility on property changing, we have prepared sample to announce selected data point by invoke selected changing event. The sample will be downloaded from below link. 
 
 
[MainActivity.cs] 
        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); 
        } 
 
Please let us know, if you have any other queries on this.  
 
Regards, 
Bharathi. 


James Lavery
Replied On June 27, 2019 01:53 PM UTC

Thank you - I have downloaded and run the sample on an Android device, and I cannot get the MainActivity_SelectionChanged handler to trigger, with TalkBack enabled. The TalkBack system is preventing items from being selected.

Am I missing something on my TalkBack settings, or is there something else we need to do in the code?

I have not yet managed to test it a physical iOS device.

Regards,

James

Rachel A [Syncfusion]
Replied On July 2, 2019 10:08 AM UTC

Hi James, 
 
As we have mentioned before, the chart does not contain any visual elements. We used canvas drawing for light weight rendering. So, based on the device configuration it may or may not allow chart to perform its behaviors. The talk back settings are differing from one device to another, we have checked with multiple device, some of the device allows segment selection in double tap, some of them allowed in triple tap. And the one plus device allows selection by double tap followed by one single tap.  
 
Also, we have faced the same reported problem in Moto G(5s) – V 7.1, the device does not allow the chart to perform its selection behavior it is due to the device configuration, but it works fine in most of the device. Please find the validated sample, video from below link.  
 
 
Refer the below blogs for more details about this.  
 
Regards, 
Rachel.  


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon