feat: add accessibility title and description to pie chart

* Reuse the title as the title element
* Add description to the parser and then render
This commit is contained in:
Cory Gwin
2022-02-18 02:37:43 +00:00
committed by GitHub
parent 9110bdfb5d
commit 0b815c7782
7 changed files with 84 additions and 1 deletions

View File

@@ -4,6 +4,7 @@ import * as configApi from '../../config';
let sections = {};
let title = '';
let description = '';
let showData = false;
export const parseDirective = function (statement, context, type) {
@@ -33,6 +34,15 @@ const getShowData = function () {
const getTitle = function () {
return title;
};
const setAccDescription = function (txt) {
description = txt;
};
const getAccDescription = function () {
return description;
};
const cleanupValue = function (value) {
if (value.substring(0, 1) === ':') {
value = value.substring(1).trim();
@@ -62,5 +72,7 @@ export default {
getTitle,
setShowData,
getShowData,
getAccDescription,
setAccDescription,
// parseError
};