Comments (7)
The Legend example shouldn't conflict with removing the role
from the parent.
I've opened a PR for the change.
from recharts.
Both aria-label
and aria-labelledby
get passed along to the SVG element. However, that SVG element is wrapped in the <div role="region">
, which never receives those extra attributes.
Note that the SVG element itself already has a role
attribute, and it seems like it will always be the same role as the .recharts-wrapper
. My preference is just to remove the role
from the .recharts-wrapper
container element. I believe having 2 identical nested roles is unnecessary, and the SVG element is already receiving the relevant aria labelling attributes.
@ckifer Is there a time when the .recharts-wrapper
has multiple SVG elements nested inside of it? If so, can you point me to one of those examples? Otherwise, what are your thoughts on removing that role?
Anyway, @nermin97, I hope it's easy for you to re-run the scans that are giving you that error. The error message looks like aXe/Deque to me, but I wasn't able to reproduce the error using Lighthouse (which sort of uses aXe). Since I don't know what tool you used for the scan, I'm not sure what will actually get you a clean scan. These options are your best bet for clearing the error today:
- Use the
accessibilityLayer
prop. This will assign a role ofapplication
(and make your chart tooltips accessible to keyboard-only and screen reader users). For example:<LineChart data={myData} accessibilityLayer>
- Overwrite the
role
to something else, like "none".role="none
effectively tells the screen reader that the content is just a pile of text (which, withoutaccessibilityLayer
, is true). For example:<LineChart data={myData} role="none">
.
from recharts.
Thanks for the help.
from recharts.
@julianna-langston thoughts?
from recharts.
@julianna-langston thanks for the detailed reply!
These are the usages of Surface
which is where tags originate from
It looks like two SVGs are rendered in a chart with a Legend
that uses DefaultLegendContent
Inspecting this example reveals that https://master--63da8268a0da9970db6992aa.chromatic.com/?path=/story/examples-barchart--stacked
Otherwise, only 1 <svg>
per chart from what I can see
from recharts.
cherry-picked your commit into master as well. This should be out next patch
from recharts.
released in 2.12.4
from recharts.
Related Issues (20)
- Points property not generating for Area Chart in v2.12.6 HOT 5
- recharts responsive pie chart with legend HOT 2
- BarChart dataKeys that include brackets don't work HOT 5
- Warning about defaultProps Support in XAxis HOT 4
- Area Chart + Brush: Descending data is reversed on brush HOT 9
- responsive container infers the parent div height [low priority] HOT 1
- Storybook Documentation for more visibility HOT 2
- How to make hover tooltip for each individual cell instead of XAxis column HOT 8
- X-axis times ticks are not display major hour like 11:00 12:00 HOT 9
- Auto rotate X-Axis Tick labels when the chart gets smaller HOT 3
- How to apply gradient on the opposite side of the AreaChart line HOT 2
- 3.0 Bug: Brush internal state
- Tooltip and Legend payload sorting
- Move chart synchronisation to Redux HOT 3
- Move Tooltip state to Redux
- Refactor getComposedData
- Remove Customized component HOT 1
- Export and document hooks
- Support React 19 HOT 21
- Use CodeSandbox Storybook Add-on HOT 16
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from recharts.