#2732 Regression fixes for accessibility

This commit is contained in:
Knut Sveidqvist
2022-05-06 19:42:40 +02:00
parent da548f1970
commit 65143a0182
12 changed files with 82 additions and 30 deletions

View File

@@ -69,7 +69,7 @@ line
statement
:
| txt value { yy.addSection($1,yy.cleanupValue($2)); }
| title title_value { $$=$2.trim();yy.setTitle($$); }
| title title_value { $$=$2.trim();yy.setPieTitle($$); }
| acc_title acc_title_value { $$=$2.trim();yy.setTitle($$); }
| acc_descr acc_descr_value { $$=$2.trim();yy.setAccDescription($$); }
| acc_descr_multiline_value { $$=$1.trim();yy.setAccDescription($$); } | section {yy.addSection($1.substr(8));$$=$1.substr(8);}

View File

@@ -52,6 +52,15 @@ const clear = function () {
commonClear();
};
export const setPieTitle = function (txt) {
let sanitizedText = common.sanitizeText(txt, configApi.getConfig());
title = sanitizedText;
};
export const getPieTitle = function () {
return title;
};
export default {
parseDirective,
getConfig: () => configApi.getConfig().pie,
@@ -61,6 +70,8 @@ export default {
clear,
setTitle,
getTitle,
setPieTitle,
getPieTitle,
setShowData,
getShowData,
getAccDescription,

View File

@@ -136,7 +136,7 @@ export const draw = (txt, id) => {
svg
.append('text')
.text(parser.yy.getTitle())
.text(parser.yy.getPieTitle())
.attr('x', 0)
.attr('y', -(height - 50) / 2)
.attr('class', 'pieTitleText');