// Add sequential tab indices to all charts in the page. Takes optional offset parameter, defaults to 5.
// Call function after charts have been created.
function addSequentialTabIx(offset) {
var each = Highcharts.each,
ix = Highcharts.pick(offset, 5);
each(Highcharts.charts, function(chart) {
chart.container.setAttribute('tabindex', ix++);
chart.container.firstChild.setAttribute('tabindex', ix++);
// Add to points
each(chart.series, function(series) {
var firstPointEl = series.points[0] && series.points[0].graphic && series.points[0].graphic.element,
seriesEl = firstPointEl && firstPointEl.parentNode || series.graph && series.graph.element || series.group && series.group.element;
if (seriesEl) {
seriesEl.setAttribute('tabindex', ix++);
}
each(series.points, function(point) {
if (point.graphic && point.graphic.element) {
point.graphic.element.setAttribute('tabindex', ix++);
point.graphic.element.onfocus = function () {
point.highlight();
};
}
});
});
// Legend
each(chart.legend.allItems, function(legendItem) {
if (legendItem.legendGroup.element) {
legendItem.legendGroup.element.setAttribute('tabindex', ix++);
}
});
// Export menu is dynamically shown, but we can add index to the button here
each(chart.container.getElementsByClassName('highcharts-contextbutton'), function(listItem) {
listItem.setAttribute('tabindex', ix++);
});
ix += 10; // Leave room for dynamically added context menu indices.
});
}
Highcharts.wrap(Highcharts.Chart.prototype, 'addAccessibleContextMenuAttribs', function(proceed) {
proceed.call(this); // Call original function
var exportList = this.exportDivElements,
menuBtn =...
Please Whitelist JSFiddle in your content blocker.
Help keep JSFiddle free for always by one of two ways:
Whitelist JSFiddle in your content blocker (two clicks)
Go PRO and get access to additional PRO features →
Join the 4+ million users, and keep the JSFiddle dream alive.
Ad-free
All ads in the editor and listing pages are turned completely off.
Use pre-released features
You get to try and use features (like the Palette Color Generator) months before everyone else.
Fiddle collections
Sort and categorize your Fiddles into multiple collections.
Private collections and fiddles
You can make as many Private Fiddles, and Private Collections as you wish!
Console
Debug your Fiddle with a minimal built-in JavaScript console.