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

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

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

  1. 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
这是我传递给组件的选项:

  1. const optionNUsersPerService = {
  2. chart: {
  3. plotBackgroundColor: null,
  4. plotBorderWidth: null,
  5. plotShadow: false,
  6. type: 'pie'
  7. },
  8. title: {
  9. text: 'Utenti per servizio'
  10. },
  11. tooltip: {
  12. pointFormat: '{series.name}: <b>{point.percentage:.1f}%</b>'
  13. },
  14. accessibility: {
  15. point: {
  16. valueSuffix: '%'
  17. }
  18. },
  19. plotOptions: {
  20. pie: {
  21. allowPointSelect: true,
  22. cursor: 'pointer',
  23. dataLabels: {
  24. enabled: true,
  25. format: '<b>{point.name}</b>: {point.percentage:.1f} %'
  26. }
  27. }
  28. },
  29. series: [{
  30. name: 'Utenti',
  31. colorByPoint: true,
  32. data: getDataUsersPerService(props.items)
  33. }]
  34. }

这是组件:

  1. return (
  2. <HighchartsReact
  3. highcharts={Highcharts}
  4. options={currentOptions}
  5. immutable={true}
  6. callback={props.callback}
  7. />
  8. );
xsuvu9jc

xsuvu9jc1#

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

  1. accessibility: {
  2. enabled: false
  3. }

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

相关问题