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

[charts] Pie chart loading text not localizable #16963

Open
damiangreen opened this issue Mar 14, 2025 · 2 comments
Open

[charts] Pie chart loading text not localizable #16963

damiangreen opened this issue Mar 14, 2025 · 2 comments
Labels
bug 🐛 Something doesn't work component: charts This is the name of the generic UI component, not the React module! l10n localization

Comments

@damiangreen
Copy link

damiangreen commented Mar 14, 2025

Steps to reproduce

  const xScale = useXScale();
  const yScale = useYScale();
  const { left, width, height } = useDrawingArea();

  const bandWidth = xScale.bandwidth();

  const [bottom, top] = yScale.range();

  return (
    <g>
      {xScale.domain().map((item, index) => {
        const ratio = ratios[index % ratios.length];
        const barHeight = ratio * (bottom - top);

        return (
          <LoadingRect
            key={index}
            x={xScale(item)}
            width={bandWidth}
            y={bottom - barHeight}
            height={height}
          />
        );
      })}
      <LoadingText x={left + width / 2} y={top + height / 2}>
        Loading data ...
      </LoadingText>
    </g>
  );
}

Current behavior

Loading data.. is not localisable. hard coded in

Expected behavior

should be localisable

Context

No response

Your environment

npx @mui/envinfo
 System:
    OS: Linux 6.11 Ubuntu 24.10 24.10 (Oracular Oriole)
  Binaries:
    Node: 20.16.0 - /usr/bin/node
    npm: 9.2.0 - /usr/bin/npm
    pnpm: 9.15.5 - /usr/local/bin/pnpm
  Browsers:
    Chrome: Not Found

~$ 

Search keywords: Loading Data...

@damiangreen damiangreen added bug 🐛 Something doesn't work status: waiting for maintainer These issues haven't been looked at yet by a maintainer labels Mar 14, 2025
@github-actions github-actions bot added the component: charts This is the name of the generic UI component, not the React module! label Mar 14, 2025
@damiangreen damiangreen changed the title Pie chart loading texdt not localisable Pie chart loading text not localisable Mar 14, 2025
@michelengelen michelengelen changed the title Pie chart loading text not localisable [charts] Pie chart loading text not localisable Mar 14, 2025
@michelengelen michelengelen added the l10n localization label Mar 14, 2025
@michelengelen michelengelen changed the title [charts] Pie chart loading text not localisable [charts] Pie chart loading text not localizable Mar 14, 2025
@michelengelen michelengelen removed the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label Mar 14, 2025
@michelengelen
Copy link
Member

Thanks for raising this @damiangreen ... i've added it to the board for the team to have a look! 👍🏼

@alexfauquette
Copy link
Member

You can customize this message with slotsProps https://mui.com/x/react-charts/styling/#custom-overlay

The hardcoded one was just for demo purpose

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 Something doesn't work component: charts This is the name of the generic UI component, not the React module! l10n localization
Projects
None yet
Development

No branches or pull requests

3 participants