Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] Incorrect data for aria-label #20063

Open
semla opened this issue Jun 22, 2024 · 6 comments
Open

[Bug] Incorrect data for aria-label #20063

semla opened this issue Jun 22, 2024 · 6 comments
Labels
en This issue is in English not-a-bug

Comments

@semla
Copy link

semla commented Jun 22, 2024

Version

5.5.0

Link to Minimal Reproduction

https://echarts.apache.org/examples/en/editor.html?c=candlestick-simple&code=PYBwLglsB2AEC8sDeAoWsCGAnCGBcSAptBgEYA2hAJnmFgK6EC-ANGrAB4CCHEAznmTt0VDGHywA2gHIATAAYAjAHYAtIvmrZAFmktYcpWo1aArHoMKV6zbIBsFw9ZOzl0gLrtW7AJ49-gkje6HyEOIQCUsJC6LGwYD4ghILSAMYY0FSUfJCpANZ60SJiEpJFsZIK-gDM2voaNQAc7mxxcZLa8jWmNV2wpvIt5eiS1YpNNdX62tpDbRXVjfU9_dOynvMbsUzsnkwA3EA

Steps to Reproduce

Look at the aria-label in the link.

Current Behavior

aria-label="This is a chart with type Candlestick.The data is as follows: the data for 2017-10-24 is 0, 20, 34, 10, 38, the data for 2017-10-25 is 1, 40, 35, 30, 50, the data for 2017-10-26 is 2, 31, 38, 33, 44, the data for 2017-10-27 is 3, 38, 15, 5, 42. "

an extra number is inserted before the correct data

Expected Behavior

aria-label="This is a chart with type Candlestick.The data is as follows: the data for 2017-10-24 is 20, 34, 10, 38, the data for 2017-10-25 is 40, 35, 30, 50, the data for 2017-10-26 is 31, 38, 33, 44, the data for 2017-10-27 is 38, 15, 5, 42. "

Environment

- OS:
- Browser:
- Framework:

Any additional comments?

Ran into it when working with 20038
Here is another example where the data for aria-label seems more confusing

@semla semla added the bug label Jun 22, 2024
@echarts-bot echarts-bot bot added en This issue is in English pending We are not sure about whether this is a bug/new feature. labels Jun 22, 2024
@helgasoft
Copy link

Your code just enables aria without setting the label (?!)
Demo works.

<div id="chart-container" _echarts_instance_="ec_1719277587102" 
 aria-label="This is a chart with type Candlestick.The data is as follows: the data for 2017-10-24 is 0, 20, 34, 10, 38, the data for 2017-10-25 is 1, 40, 35, 30, 50, the data for 2017-10-26 is 2, 31, 38, 33, 44, the data for 2017-10-27 is 3, 38, 15, 5, 42. " 
 style="user-select: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0);"><div style="position: relative; width: 501px; height: 575px; padding: 0px; margin: 0px; border-width: 0px; cursor: default;"><canvas data-zr-dom-id="zr_0" width="551" height="632" style="position: absolute; left: 0px; top: 0px; width: 501px; height: 575px; user-select: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); padding: 0px; margin: 0px; border-width: 0px;"></canvas></div>
</div>

📌 please close issue if problem solved.

@Ovilia Ovilia added not-a-bug waiting-for: author and removed bug pending We are not sure about whether this is a bug/new feature. labels Jun 26, 2024
@semla
Copy link
Author

semla commented Jun 26, 2024

Your code just enables aria without setting the label (?!)

I am pretty sure the aria-label is generated if not set? What I was referring to was the data generated that seems incorrect.

@semla
Copy link
Author

semla commented Jun 28, 2024

Seems like on some charts like bar, line, candlestick (not exhaustive list) each data item has an extra data point. It is the first one and seems like an index ("the data for Mon is 0, 1, the data for Tue is 1, -2,.. etc)

Here is a "naive" theory that maybe is useful?
I took a quick look at the code for the dataview in the toolbox, and it looks like there is a separation of chart-types:

* Group series into two types
* 1. on category axis, like line, bar
* 2. others, like scatter, pie

In aria.ts it looks like it just returns the values from getData regardless of the type of chart:
const data = seriesModel.getData();

@semla
Copy link
Author

semla commented Jun 28, 2024

@Ovilia Are you sure it is not a bug?

@Ovilia
Copy link
Contributor

Ovilia commented Jun 28, 2024

Although I won't say this is the best thing we could do since the code in ARIA may be somewhat straightforward, I don't think this should be regarded as a bug. You may make a pull request to improve it.

#20038 tries to fix this by providing an option to let developers hide certain dimensions, while you could also change the default dimensions to display, like using the second instead of all in the case of candlestick series. Both plans solves the problem to some extent and it's either way works.

@semla
Copy link
Author

semla commented Jun 28, 2024

Ok, yes #20038 should be usable to avoid the extra index data.

Here the data in aria-label is also repeated.

You may make a pull request to improve it.

Not sure I know enough but maybe I'll give it a shot. Is it a good idea to look at the code for the dataview ? iiuc that code deals differently with cartesian2D charts like lines, bar, candlestick - which seems to be the ones that are problematic

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
en This issue is in English not-a-bug
Projects
None yet
Development

No branches or pull requests

3 participants