-
Notifications
You must be signed in to change notification settings - Fork 19.6k
-
Notifications
You must be signed in to change notification settings - Fork 19.6k
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
[Feature] Set default legend icon for different series types #20339
Comments
The icon in the legend represents that of that series. So it doesn't always make sense to use the same icon for the same series. |
I agree that being able to assign different icons to different series of the same chart type, either via series symbols or the legend's data array, is a desired behavior. But I think there is also value in being able to choose the default or fallback icon for a given series type. The specific problem I'm trying to solve in my app is that the rounded rectangle legend elements don't look good with our design language. I would like them to be normal rectangles or squares. but if I set the icon property to 'rectangle' in the theme file using the legend's icon property, it also changes the icon for all line series, even though I've defined 'emptyCircle' as the default symbol for all line series. |
please provide code example for your theme problem.
setting legend icons is very flexible, even for bars - Demo |
What problem does this feature solve?
I have not been able to figure out a way to do this. I think you should be able to declare a default icon type in the legend for each different series, for example:
bar series: star icon
line series: triangle icon
I know that setting a different symbol on a line series will change the icon in the legend, but there is no way to do this for bar charts
What does the proposed API look like?
bar: {
icon: 'star',
},
line: {
icon: 'triangle',
}
The text was updated successfully, but these errors were encountered: