[charts][BarChart] position the bar labels above the bars using BarPlot #15660
Labels
bug 🐛
Something doesn't work
component: charts
This is the name of the generic UI component, not the React module!
customization: logic
Logic customizability
Current behavior
By default, the labels are positioned like this:
After using the BarPlot, it looks like this (see video attached):
Screen.Recording.2024-11-28.at.11.48.04.PM.mov
Expected behavior
I want the final output to look like this, with a faded effect (the faded effect is missing in this image):
Context
I'm using
BarChart
, and I'm trying to render the bar labels above the bars. By default, the labels are positioned at the center of the bars. To move the labels above the bars, I attempted to use theslots
property in theBarPlot
component, but it didn't work as expected.Specifically, when I use the slots property at the initial render, the height of the bars is set to 0. However, when I move my mouse over the chart, the labels update and appear as expected.
What I'm looking for:
I need a solution to ensure that the bar labels are consistently placed above the bars, without the height issue at initial render. Is there any other workaround besides using
BarPlot
?Code
Your environment
npx @mui/envinfo
Search keywords: BarChart, BarPlot
The text was updated successfully, but these errors were encountered: