It is currently Wed Aug 23, 2017 2:41 am Advanced search

mark map series aria-hidden

Technical support, bug reports and more.

mark map series aria-hidden

Postby primerano » Fri Aug 11, 2017 6:25 pm

On the us-small map I always add the map lines as the second series

http://jsfiddle.net/primerano/g6e6apwt/5/

There doesn't appear to be a way in the the library to specify a series should be hidden from the screen reader.

http://api.highcharts.com/highcharts/accessibility

The code always adds the ARIA information on all series provided but a series of lines should be ignored.

<g transform="translate(0,0) scale(1 1)" role="region" tabindex="-1" aria-label="Separators, series 2 of 2. line with 20 data points">

if (this.chart.series.length > 1 || a11yOptions.describeSingleSeries) {
// Adds the ARIA attributes

Can we get an option added that tells the accessibility to mark a series as aria-hidden?

Thanks,
Tony
primerano
 
Posts: 31
Joined: Fri Jun 02, 2017 8:03 pm

Re: mark map series aria-hidden

Postby kamil » Tue Aug 15, 2017 3:57 pm

Hi Tony,

Have you tried using seriesDescriptionFormatter?: http://api.highcharts.com/highmaps/acce ... nFormatter
You can check within this function whether it's map lines series and if it is simply return an empty string.

Best regards!
Kamil Kulig
Highcharts Developer
kamil
 
Posts: 230
Joined: Tue May 30, 2017 11:12 am

Re: mark map series aria-hidden

Postby primerano » Fri Aug 18, 2017 4:21 pm

returning a blank string doesn't make a difference since it will still build the default string because the blank string is falsey.
Code: Select all
seriesEl.setAttribute('aria-label', a11yOptions.seriesDescriptionFormatter && a11yOptions.seriesDescriptionFormatter(this) ||   this.buildSeriesInfoString());


But I could pass in a string with 1 space.

Code: Select all
seriesDescriptionFormatter: function (series) {
        if (series.type === "mapline") {
          return '  ';
        }
      }


That said.. the screen reader will still read the series points because it was not marked with ARIA hidden.

I had to set it manually

$("g.highcharts-series.highcharts-series-1 [role='region']").attr('aria-label', null);
$("g.highcharts-series.highcharts-series-1 [role='region']").attr('aria-hidden', 'true');

An option mark a series hidden would be ideal.

I'm not sure what this option should be called but it could be used in setA11yDescription to mark the element hidden
Code: Select all
if (this.aria_hidden) {
         seriesEl.setAttribute('aria-hidden', 'true');
} else {
      // Make series element accessible
      if (this.chart.series.length > 1 || a11yOptions.describeSingleSeries) {
         seriesEl.setAttribute(
            'role',
            this.options.exposeElementToA11y ? 'img' : 'region'
         );
         seriesEl.setAttribute('tabindex', '-1');
         seriesEl.setAttribute('aria-label', a11yOptions.seriesDescriptionFormatter && a11yOptions.seriesDescriptionFormatter(this) ||
            this.buildSeriesInfoString());
      }

}

and would also be used to skip this section
// Make individual point elements accessible if possible. Note: If markers are disabled there might not be any elements there to make accessible.

Should I submit this as a feature request?
Thanks
Tony
primerano
 
Posts: 31
Joined: Fri Jun 02, 2017 8:03 pm

Re: mark map series aria-hidden

Postby kamil » Mon Aug 21, 2017 3:17 pm

Hi Tony,

I think it's a good idea.
Thank you for your contribution to Highcharts.

Best regards!
Kamil Kulig
Highcharts Developer
kamil
 
Posts: 230
Joined: Tue May 30, 2017 11:12 am


Return to Highmaps Usage

Who is online

Users browsing this forum: No registered users and 0 guests