fusioncharts / fusioncharts-dist

FusionCharts JavaScript Charting library. Over 95+ charts and 1,400+ maps to choose from, with integrations available for all popular JavaScript frameworks & back-end programming languages.
https://www.fusioncharts.com
Other
84 stars 46 forks source link

Accessibility Extension reports an error in the console and aria-label was added incorrectly #48

Open leon0leon opened 1 year ago

leon0leon commented 1 year ago

The accessibility extension reported the following error on the console:

image

This occurs when the data length of the later series in a scatter chart is less than the data length of the first series. I noticed that this problem was fixed in @fusioncharts\accessibility\src\categories\multiSeries.js (as shown on the left in the screenshot below), but not in Accessibility Extension (as shown on the right in the screenshot below): image

This also causes the aria-label to be added incorrectly, causing incorrect text to be announced by screen readers. Such as in the screenshot below, the data length of the first series (red dots) is 3. Although the data length of the second series (black dots) is greater than 3, it is also incorrectly considered that there are only 3 plots, and only the first 3 points have been added aria-label: image

Another example is the screenshot below. Although the third series (blue) has only one point, which is less than the 35 points of the first series (red), its aria-lable is also added with "Plot 1 of 35". The sentence in the black background in the screenshot below is the text announced by VoiceOver when the data plot in the red circle gets the focus. image

leon0leon commented 1 year ago

Please note that this problem needs to be reproduced with a scatter type chart. The following example can reproduce the problem: https://codesandbox.io/s/accessibility-example-angular-forked-v2h0x4