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

更新版本后,散点图的markpoint中label文字颜色有bug #6503

Closed
dingzhang opened this issue Aug 23, 2017 · 2 comments
Closed

更新版本后,散点图的markpoint中label文字颜色有bug #6503

dingzhang opened this issue Aug 23, 2017 · 2 comments

Comments

@dingzhang
Copy link

One-line summary [问题简述]

地图散点图,为了给每个markpoint设置不同的字体颜色,在data中的label.normal.textStyle.color设置颜色,以前版本是好的,更新版本后,颜色设置失效

Version & Environment [版本及环境]

  • ECharts version [ECharts 版本]: 3.7.1
  • Browser version [浏览器类型和版本]: chrome 55
  • OS Version [操作系统类型和版本]: windows && macos

Expected behaviour [期望结果]

每个markpoint中字体设置为正确颜色

ECharts option [ECharts配置项]

option = {
    backgroundColor: '#404a59',
    title: {
        text: '全国主要城市空气质量',
        subtext: 'data from PM25.in',
        sublink: 'http://www.pm25.in',
        left: 'center',
        textStyle: {
            color: '#fff'
        }
    },
    tooltip : {
        trigger: 'item'
    },
    legend: {
        orient: 'vertical',
        y: 'bottom',
        x:'right',
        data:['pm2.5'],
        textStyle: {
            color: '#fff'
        }
    },
    geo: {
        map: 'china',
        label: {
            emphasis: {
                show: false
            }
        },
        roam: true,
        itemStyle: {
            normal: {
                areaColor: '#323c48',
                borderColor: '#111'
            },
            emphasis: {
                areaColor: '#2a333d'
            }
        }
    },
    series : [
        {
            name: 'pm2.5',
            type: 'scatter',
            coordinateSystem: 'geo',
            markPoint: {
                data: [{
                    value: 'drwe',
                    coord: [119.867413, 32.891544],
                    itemStyle: {
                    normal: {
                        color: 'blue',
                        shadowColor: 'rgba(0, 0, 0, 0.5)',
                        shadowBlur: 10,
                        opacity: 0.9
                    }
                },
                    label: {
                    normal: {
                        show: true,
                        formatter: '{c}',
                        textStyle: {
                            fontFamily: 'Monaco',
                            color: 'red'
                        }
                    },
                    emphasis: {
                        show: true,
                        textStyle: {
                            fontFamily: 'Monaco',
                            fontSize: 16
                        }
                    }
                },
                }],
                symbol: 'pin',
                itemStyle: {
                    normal: {
                        color: '#fff',
                        shadowColor: 'rgba(0, 0, 0, 0.5)',
                        shadowBlur: 10,
                        opacity: 0.9
                    }
                }
            },
            // data: convertData(data),
            symbolSize: function (val) {
                return val[2] / 10;
            },
            itemStyle: {
                normal: {
                    color: '#ddb926'
                }
            }
        }
    ]
};

Other comments [其他信息]

@dingzhang
Copy link
Author

并没有像更新记录里说的那样,可以兼容以前的写法。

@100pah
Copy link
Member

100pah commented Sep 1, 2017

可以把 textStyle 层级去掉:

normal: {
    show: true,
    formatter: '{c}',
    fontFamily: 'Monaco',
    color: 'red'
},
emphasis: {
    show: true,
    fontFamily: 'Monaco',
    fontSize: 16
}

这个地方的兼容被落调了,会补上。

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

No branches or pull requests

2 participants