You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@echarts.apache.org by Changlin Yang <cy...@ucsc.edu.INVALID> on 2020/07/14 00:44:17 UTC

散点图颜色不改变问题

根据:

data1 = [
[[1,2,3],'Mon'],
[[2,3,4],'Tues'],
[[3,4,5],'Wed']
]

构造散点图。现在想使用if 判断让散点图显示同一个颜色或者根据['Mon','Tues','Wed']显示不同颜色。
比如:

var C = 1;
var option = {
...
color: C == '1' ? ['#eb8146',] : ['#d95850','#eb8146','#ffb248'],
....
}

但是这样做颜色并不会改变。
What is expected?

散点图颜色根据if判断改变
What is actually happening?

散点图颜色未改变



https://github.com/apache/incubator-echarts/issues/12963


Thanks

Re: 散点图颜色不改变问题

Posted by Ovilia <ov...@gmail.com>.
Hi,

I see that your issue has been answered in GitHub.

And we appreciate using English in our mailing list for more people to
understand.

Thanks

*Ovilia*


On Wed, Jul 15, 2020 at 6:06 AM Changlin Yang <cy...@ucsc.edu.invalid>
wrote:

> 根据:
>
> data1 = [
> [[1,2,3],'Mon'],
> [[2,3,4],'Tues'],
> [[3,4,5],'Wed']
> ]
>
> 构造散点图。现在想使用if 判断让散点图显示同一个颜色或者根据['Mon','Tues','Wed']显示不同颜色。
> 比如:
>
> var C = 1;
> var option = {
> ...
> color: C == '1' ? ['#eb8146',] : ['#d95850','#eb8146','#ffb248'],
> ....
> }
>
> 但是这样做颜色并不会改变。
> What is expected?
>
> 散点图颜色根据if判断改变
> What is actually happening?
>
> 散点图颜色未改变
>
>
>
> https://github.com/apache/incubator-echarts/issues/12963
>
>
> Thanks
>