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

Set emphasis color same with normal color #11788

Closed
pissang opened this issue Dec 4, 2019 · 2 comments · Fixed by #15172
Closed

Set emphasis color same with normal color #11788

pissang opened this issue Dec 4, 2019 · 2 comments · Fixed by #15172

Comments

@pissang
Copy link
Contributor

pissang commented Dec 4, 2019

Currently there is no way to set emphasis color same with normal color conveniently.

@pissang pissang added this to the 4.8.0 milestone Dec 4, 2019
@pissang pissang modified the milestones: 4.8.0, 5.0.0 Feb 12, 2020
@karl-ford
Copy link

karl-ford commented Jul 1, 2020

Actually You can!

When we set the normal color in echarts, we change the itemStyle.color in each item of data.
If u want to set the color of highlight status, u can change the emphasis.itemStyle.color of the target item.

The javascript looks like that:

...
data: [
    {
        value: 75,
        itemStyle: {
            color: '#0B9BEE'
        },
        emphasis: {
            itemStyle: {
                color: '#0B9BEE'
            }
        }
    },
    {
        value: 25,
        itemStyle: {
            color: '#E5F6FF'
        },
        emphasis: {
            itemStyle: {
                color: '#E5F6FF'
            }
        }
    }
]
...

@zmzimpl
Copy link

zmzimpl commented Nov 18, 2020

Actually You can!

When we set the normal color in echarts, we change the itemStyle.color in each item of data.
If u want to set the color of highlight status, u can change the emphasis.itemStyle.color of the target item.

The javascript looks like that:

...
data: [
    {
        value: 75,
        itemStyle: {
            color: '#0B9BEE'
        },
        emphasis: {
            itemStyle: {
                color: '#0B9BEE'
            }
        }
    },
    {
        value: 25,
        itemStyle: {
            color: '#E5F6FF'
        },
        emphasis: {
            itemStyle: {
                color: '#E5F6FF'
            }
        }
    }
]
...

It's work to change the emphasis.itemStyle.color of the target item. But when the item color was set by option.color, It's not a convenient thing to change option.color and emphasis.itemStyle.color. I think it's awesome to control it by a new property.

@pissang pissang modified the milestones: 5.0.0, 5.1.0 Nov 18, 2020
@pissang pissang modified the milestones: 5.1.0, 5.3.0 Apr 19, 2021
@pissang pissang removed this from the 5.3 milestone Sep 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants