React highcharts :如何将“accessibility.enabled”选项设置为false

nuypyhwy  于 2022-11-10  发布在  Highcharts
关注(0)|答案(1)|浏览(389)

我在控制台中遇到此错误:

Highcharts warning: Consider including the "accessibility.js" module to make your chart more usable for people with disabilities. Set the "accessibility.enabled" option to false to remove this warning. See https://www.highcharts.com/docs/accessibility/accessibility-module.

在文档中找不到Set the "accessibility.enabled" option to false
这是我传递给组件的选项:

const optionNUsersPerService = {
        chart: {
            plotBackgroundColor: null,
            plotBorderWidth: null,
            plotShadow: false,
            type: 'pie'
        },
        title: {
            text: 'Utenti per servizio'
        },
        tooltip: {
            pointFormat: '{series.name}: <b>{point.percentage:.1f}%</b>'
        },
        accessibility: {
            point: {
                valueSuffix: '%'
            }
        },
        plotOptions: {
            pie: {
                allowPointSelect: true,
                cursor: 'pointer',
                dataLabels: {
                    enabled: true,
                    format: '<b>{point.name}</b>: {point.percentage:.1f} %'
                }
            }
        },
        series: [{
            name: 'Utenti',
            colorByPoint: true,
            data: getDataUsersPerService(props.items)
        }]
    }

这是组件:

return (
        <HighchartsReact
            highcharts={Highcharts}
            options={currentOptions}
            immutable={true}
            callback={props.callback}
        />
    );
xsuvu9jc

xsuvu9jc1#

自Highcharts v10.1.0(2022年4月29日)起添加了警告
更改日志:https://www.highcharts.com/blog/changelog/
要禁用辅助功能,请设置:

accessibility: {
    enabled: false
  }

现场演示:http://jsfiddle.net/BlackLabel/mvnjskqr/
API参考:https://api.highcharts.com/highcharts/accessibility.enabled

相关问题