AnyChart sample
HTML
<script src="https://cdn.anychart.com/js/7.12.0/anychart-bundle.min.js"></script>
<script src="https://cdn.anychart.com/js/7.12.0/anychart-bundle.min.js"></script>
<link rel="stylesheet" href="https://cdn.anychart.com/css/7.12.0/anychart-ui.min.css" /><div id="container"></div>
CSS
html, body, #container {
width: 100%;
height: 100%;
margin: 0;
padding: 0;
}
JavaScript
anychart.onDocumentReady(function() {
// data
var data = anychart.data.set([
["John", 10000],
["Jake", 12000],
["Peter", 18000],
["James", 11000],
["Mary", 9000]
]);
// map data for the each series
var Sales2014 = data.mapAs({x: [0], value: [1]});
// chart type
chart = anychart.column();
// set data
var series2014 = chart.column(Sales2014);
series2014.name("Sales in 2014");
// chart title
chart.title("Making chart and series titles accessible");
// enable the accessibility support for series
series2014.a11y(true);
// set the titleFormatter for the chart
chart.a11y().titleFormatter(function(e){
chart = this.chart;
return "Data Plot Y Sum is " + chart.getStat("dataPlotYSum") + "\n" +
"First Series Y minimum is " + chart.getSeries(0).getStat("seriesYMin") + "\n" +
"First Series Y maximum is " + chart.getSeries(0).getStat("seriesYMax");
});
// set the titleFormatter for the series
series2014.a11y().titleFormatter(function(e){
var series = this.series;
return "This series name is:" + series.name() + " has its maximum value in $" + series.getStat("seriesYMax") + ", the average in $" + series.getStat("average") + " and minimum value in $" + series.getStat("seriesYMin");
});
// draw
chart.container("container").draw();
});