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

Enhance label customization by passing label prop to labelComponent #959

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

vinaygupta98
Copy link

This change allows users to pass the label prop directly to the labelComponent, enabling external customization of the label rendering. Previously, the labelComponent was static and did not accept dynamic input for the label text. With this update, users can now manage the label component and customize its content, style, or behavior outside the LineChart component.

This flexibility is useful when users need to apply custom rendering logic or styles to the labels based on their application-specific requirements.

Changes:

  • Modified labelComponent to accept the label prop as an argument, allowing it to be passed from the parent.
  • Updated the rendering logic for both static and animated labels to use the updated labelComponent signature.

This change allows users to pass the `label` prop directly to the `labelComponent`, enabling external customization of the label rendering. Previously, the `labelComponent` was static and did not accept dynamic input for the label text. With this update, users can now manage the label component and customize its content, style, or behavior outside the `LineChart` component.

This flexibility is useful when users need to apply custom rendering logic or styles to the labels based on their application-specific requirements.

### Changes:
- Modified `labelComponent` to accept the `label` prop as an argument, allowing it to be passed from the parent.
- Updated the rendering logic for both static and animated labels to use the updated `labelComponent` signature.
@Abhinandan-Kushwaha
Copy link
Owner

Hi @vinaygupta98, thanks for this PR.
Can you share an example code to use this label parameter after your changes?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants