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
series[i]-parallel.data[i].lineStyle(.normal).color不起作用
series[i]-parallel.data[i].lineStyle(.normal).color
根据数据具体情况选择特定颜色渲染Parallel数据折线,按照配置项文档说明设置实际上没有起作用
option = { ..., series: [{ type: "parallel", data: [ { "value": [ "韶关", "63.37", "38.41", "72.15", "57.33", "84.56", "82.66" ], "lineStyle": { "normal": { "color": "#749f83", } } }, { "value": [ "湛江", "31.42", "99.18", "44.09", "3.62", "5.65", "63.37" ], "lineStyle": { "normal": { "color": "#ca8622", } } } ] }] }
经查阅源码,发现chart/parallel/ParallelView.js的function updateElCommon第196~203行:
chart/parallel/ParallelView.js
function updateElCommon
line.useStyle(zrUtil.extend( lineStyle, { fill: null, stroke: data.getItemVisual(dataIndex, 'color'), opacity: data.getItemVisual(dataIndex, 'opacity') } ));
data项设置的color/opacity属性会被全局默认值或series[i]-parallel.lineStyle覆盖,如果将lineStyle改成zrUtil.extend函数调用的第二个参数,则可得到期望的渲染效果。
data
color/opacity
series[i]-parallel.lineStyle
lineStyle
zrUtil.extend
不知此处是编写失误还是有意为之?
另外配置项文档中对series[i]-parallel.data[i].lineStyle的说明,其子项包括normal/emphasis,也包括color/width/type/opacity等,这些color/width/type/opacity应该放在lineStyle下还是该放在lineStyle.normal下还是两者都可以,没有任何说明,让人有点懵逼。。。
series[i]-parallel.data[i].lineStyle
normal/emphasis
color/width/type/opacity
lineStyle.normal
The text was updated successfully, but these errors were encountered:
a7c9c58
No branches or pull requests
billy-poon commentedMar 27, 2017
•
edited
One-line summary [问题简述]
series[i]-parallel.data[i].lineStyle(.normal).color
不起作用Version & Environment [版本及环境]
Expected behaviour [期望结果]
根据数据具体情况选择特定颜色渲染Parallel数据折线,按照配置项文档说明设置实际上没有起作用
ECharts option [ECharts配置项]
Other comments [其他信息]
经查阅源码,发现
chart/parallel/ParallelView.js
的function updateElCommon
第196~203行:data
项设置的color/opacity
属性会被全局默认值或series[i]-parallel.lineStyle
覆盖,如果将lineStyle
改成zrUtil.extend
函数调用的第二个参数,则可得到期望的渲染效果。不知此处是编写失误还是有意为之?
另外配置项文档中对
series[i]-parallel.data[i].lineStyle
的说明,其子项包括normal/emphasis
,也包括color/width/type/opacity
等,这些color/width/type/opacity
应该放在lineStyle
下还是该放在lineStyle.normal
下还是两者都可以,没有任何说明,让人有点懵逼。。。The text was updated successfully, but these errors were encountered: