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] Allow to add className to series #15982

Open
smmoosavi opened this issue Dec 22, 2024 · 1 comment
Open

[charts] Allow to add className to series #15982

smmoosavi opened this issue Dec 22, 2024 · 1 comment
Labels
component: charts This is the name of the generic UI component, not the React module! customization: css Design CSS customizability enhancement This is not a bug, nor a new feature

Comments

@smmoosavi
Copy link
Contributor

smmoosavi commented Dec 22, 2024

Summary

It would be good if we could add className or sx to the series directly. especially when ID is dynamic

<LineChart
        sx={{
          '& .tx-line': {
            strokeDasharray: '10 5',
          },
        }}
        series={devices.flatMap((device, index) => [
          { id: `${device}_rxBytes`, dataKey: `${device}_rxBytes`, color: colors[index], className: 'rx-line' },
          { id: `${device}_txBytes`, dataKey: `${device}_txBytes`, color: colors[index], className: 'tx-line' },
                                                                                   // or sx: {strokeDasharray: '10 5'}
        ])}
/>

Examples

No response

Motivation

Make it easier to customize and add style to some lines (not all lines)

Search keywords: linechart classname

@smmoosavi smmoosavi added new feature New feature or request status: waiting for maintainer These issues haven't been looked at yet by a maintainer labels Dec 22, 2024
@oliviertassinari oliviertassinari added the component: charts This is the name of the generic UI component, not the React module! label Dec 22, 2024
@oliviertassinari oliviertassinari changed the title charts: Allow to add className to series [charts] Allow to add className to series Dec 22, 2024
@michelengelen michelengelen added customization: css Design CSS customizability enhancement This is not a bug, nor a new feature and removed new feature New feature or request status: waiting for maintainer These issues haven't been looked at yet by a maintainer labels Dec 23, 2024
@michelengelen
Copy link
Member

Hey @smmoosavi ... Adding a className would be a great addition. Not sure if sx is feasible though. I did add it to the board for the charts team to have a look. 👍🏼

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: charts This is the name of the generic UI component, not the React module! customization: css Design CSS customizability enhancement This is not a bug, nor a new feature
Projects
None yet
Development

No branches or pull requests

3 participants