<!--
为了方便我们能够复现和修复 bug,请遵从下面的规范描述您的问题。
-->


### One-line summary [问题简述]
legend中的icon颜色和对应的气泡图中的颜色不一样



### Version & Environment [版本及环境]
+ ECharts version [ECharts 版本]: 4.1.0
+ Browser version [浏览器类型和版本]: Google Chrome 版本 71.0.3564.0(正式版本)canary (64 位)
+ OS Version [操作系统类型和版本]: MacBook Air 10.13.6 (17G65)





### Expected behaviour [期望结果]
legend中的icon颜色和对应的气泡图中的颜色完全一样




### ECharts option [ECharts配置项]
<!-- Copy and paste your 'echarts option' here. -->
<!-- [下方贴你的option,注意不要删掉下方 ```javascript 和 尾部的 ``` 字样。最好是我们能够直接运行的 
option。如何得到能运行的 option 参见上方的 guidelines for contributing] -->
```javascript
option = {
  // color: ["#4883FB", "#ED5555", "#F49857"],
        hoverAnimation: false,
        legend: {
            animation: false,
          itemWidth: 12,
          itemHeight: 12,
          itemGap: 20,
          right: 40,
          textStyle: {
            fontFamily: "PingFangSC-Regular",
            fontSize: 12,
            color: "#4a4a4a"
          },
          data: ["Customer", "New Customer", "Old Customer"]
        },
        grid: {
          top: 29, 
          right: 53, 
          bottom: 20,
          left: 50, 
          containLabel: true
        },
        xAxis: {
          show: true,
          data: 
["0~1","2~8","9~20","21~36","37~66","67~109","110~119","120~120"],
          boundaryGap: false,
          name: 'Mins',
          nameLocation: "end",
          nameGap: 10,
          nameTextStyle: {
            fontFamliy: "PingFangSC-Regular",
            fontWeight: "normal",
            fontSize: 12,
            lineHeight: 14,
            color: "#7D7D7D"
          },
          // axisLabel的params从data中取值
          axisLabel: {
            show: true,
            showMinLabel: true,
            // interval: 0,
            margin: 5,
            fontFamily: "PingFangSC-Regular",
            fontWeight: "normal",
            fontSize: 12,
            lineHeight: 14,
            color: "#4A4A4A",
            formatter: value => value
          },
          axisLine: {
            show: true,
            lineStyle: {
              width: 1,
              type: "solid",
              color: "#C9D4E9"
            }
          },
          axisTick: {
            show: false
          },
          splitLine: {
            show: true,
            lineStyle: {
              width: 1,
              type: "solid",
              color: "#C9D4E9",
              opacity: 0.4
            }
          }
        },
        yAxis: {
          show: true,
          name: 'ppl',
          nameLocation: "end",
          nameTextStyle: {
            fontFamily: "PingFangSC-Regular",
            fontSize: 12,
            color: "#7D7D7D"
          },
          axisLabel: {
            show: true,
            showMinLabel: false,
            margin: 5,
            fontSize: 12,
            lineHeight: 14,
            fontFamily: "PingFangSC-Regular",
            fontWeight: "normal",
            color: "#4A4A4A",
            formatter: value => value
          },
          axisLine: {
            show: true,
            lineStyle: {
              type: "solid",
              color: "#C9D4E9",
              width: 1
            }
          },
          axisTick: {
            show: false
          },
          splitLine: {
            lineStyle: {
              width: 1,
              type: "solid",
              color: "#C9D4E9",
              opacity: 0.4
            }
          }
        },
        series: [
          {
            name: "Customer",
            type: "scatter",
            silent: true,
            animation: false,
            data: [38,38,38,38,38,38,38,38],
            symbol: "circle",
            symbolSize: function (data) {
              if (data) {
                return 16
              } else {
                return 0
              }
            },
            label: {
              emphasis: {
                show: true,
                formatter: params => {
                  return params.value
                },
                color: "#000",
                position: "top"
              }
            },
            itemStyle: {
                color: "#4883FB"
            },
            emphasis: {
                itemStyle: {
                    color: "#4883FB"
                }
            }
          },
          {
            type: "scatter",
            name: "New Customer",
            data: [30,30,30,30,30,30,30,30],
            symbol: "circle",
            symbolSize: function (data) {
              if (data) {
                return 16
              } else {
                return 0
              }
            },
            label: {
              emphasis: {
                show: true,
                formatter: params => {
                  return params.value
                },
                color: "#000",
                position: "top"
              }
            },
            itemStyle: {
                color: "#ED5555"
            },
            emphasis: {
                itemStyle: {
                    color: "#ED5555"
                }
            }
          },
          {
            type: "scatter",
            name: "Old Customer",
            animation: false,
            data: [8,8,8,8,8,8,8,8],
            symbol: "circle",
            symbolSize: function (data) {
              if (data) {
                return 16;
              } else {
                return 0
              }
            },
            label: {
              emphasis: {
                show: true,
                formatter: params => {
                  return params.value
                },
                color: "#000",
                position: "top"
              }
            },
            itemStyle: {
                color: "#F49857"
            },
            emphasis: {
                itemStyle: {
                    color: "#F49857"
                }
            }
          }
        ]
}

```




### Other comments [其他信息]
<!-- For example: Screenshot or Online demo -->
<!-- [例如,截图或线上实例 (JSFiddle/JSBin/Codepen)] -->
Echarts Gallery: 
[legend中的icon颜色和对应的气泡图中的颜色不一样](http://gallery.echartsjs.com/editor.html?c=xPNZe_dJ-I&v=1)


[ Full content available at: 
https://github.com/apache/incubator-echarts/issues/9146 ]
This message was relayed via gitbox.apache.org for [email protected]

Reply via email to