-
Notifications
You must be signed in to change notification settings - Fork 19.8k
K线图 图例颜色问题 #4649
Copy link
Copy link
Closed
Labels
staleInactive for a long time. Will be closed in 7 days.Inactive for a long time. Will be closed in 7 days.
Description
One-line summary [问题简述]
K线图的图例颜色和阴线或阳线都不匹配。
有不止一个图例的时候,点击图例出现的只是坐标轴变化,并不是图表中相应的item消失或渲染。
Version & Environment [版本及环境]
- ECharts version [ECharts 版本]:Echarts 2
- Browser version [浏览器类型和版本]: google
- OS Version [操作系统类型和版本]:win10
Expected behaviour [期望结果]
图例颜色与当前的阴线或阳线匹配。
ECharts option [ECharts配置项]
option = {
title : {
text: '2013年上半年上证指数'
},
tooltip : {
trigger: 'axis',
formatter: function (params) {
var res = params[0].seriesName + ' ' + params[0].name;
res += '<br/> 开盘 : ' + params[0].value[0] + ' 最高 : ' + params[0].value[3];
res += '<br/> 收盘 : ' + params[0].value[1] + ' 最低 : ' + params[0].value[2];
return res;
}
},
legend: {
data:['上证指数', '上证指数2']
},
toolbox: {
show : true,
feature : {
mark : {show: true},
dataZoom : {show: true},
dataView : {show: true, readOnly: false},
magicType: {show: true, type: ['line', 'bar']},
restore : {show: true},
saveAsImage : {show: true}
}
},
dataZoom : {
show : true,
realtime: true,
start : 50,
end : 100
},
xAxis : [
{
type : 'category',
boundaryGap : true,
axisTick: {onGap:false},
splitLine: {show:false},
data : [
"2013/1/24", "2013/1/25", "2013/1/28", "2013/1/29", "2013/1/30",
"2013/1/31", "2013/2/1", "2013/2/4", "2013/2/5", "2013/2/6",
"2013/2/7", "2013/2/8", "2013/2/18", "2013/2/19", "2013/2/20",
"2013/2/21", "2013/2/22", "2013/2/25", "2013/2/26", "2013/2/27",
"2013/2/28", "2013/3/1", "2013/3/4", "2013/3/5", "2013/3/6",
"2013/3/7", "2013/3/8", "2013/3/11", "2013/3/12", "2013/3/13",
"2013/3/14", "2013/3/15", "2013/3/18", "2013/3/19", "2013/3/20",
"2013/3/21", "2013/3/22", "2013/3/25", "2013/3/26", "2013/3/27",
"2013/3/28", "2013/3/29", "2013/4/1", "2013/4/2", "2013/4/3",
"2013/4/8", "2013/4/9", "2013/4/10", "2013/4/11", "2013/4/12",
"2013/4/15", "2013/4/16", "2013/4/17", "2013/4/18", "2013/4/19",
"2013/4/22", "2013/4/23", "2013/4/24", "2013/4/25", "2013/4/26",
"2013/5/2", "2013/5/3", "2013/5/6", "2013/5/7", "2013/5/8",
"2013/5/9", "2013/5/10", "2013/5/13", "2013/5/14", "2013/5/15",
"2013/5/16", "2013/5/17", "2013/5/20", "2013/5/21", "2013/5/22",
"2013/5/23", "2013/5/24", "2013/5/27", "2013/5/28", "2013/5/29",
"2013/5/30", "2013/5/31", "2013/6/3", "2013/6/4", "2013/6/5",
"2013/6/6", "2013/6/7", "2013/6/13"
]
}
],
yAxis : [
{
type : 'value',
scale:true,
boundaryGap: [0.01, 0.01]
}
],
series : [
{
name:'上证指数',
type:'k',
itemStyle: {
normal: {
color: 'yellow',
color0: 'blue'
}
},
data:[ // 开盘,收盘,最低,最高
[2383.49,2397.18,2370.61,2397.94],
[2378.82,2325.95,2309.17,2378.82],
[2322.94,2314.16,2308.76,2330.88],
[2320.62,2325.82,2315.01,2338.78],
[2313.74,2293.34,2289.89,2340.71],
[2297.77,2313.22,2292.03,2324.63],
[2322.32,2365.59,2308.92,2366.16],
[2364.54,2359.51,2330.86,2369.65],
[2332.08,2273.4,2259.25,2333.54],
[2274.81,2326.31,2270.1,2328.14],
[2333.61,2347.18,2321.6,2351.44],
[2340.44,2324.29,2304.27,2352.02],
[2326.42,2318.61,2314.59,2333.67],
[2314.68,2310.59,2296.58,2320.96],
[2309.16,2286.6,2264.83,2333.29],
[2282.17,2263.97,2253.25,2286.33],
]
},
{
name:'上证指数2',
type:'k',
itemStyle: {
normal: {
color: 'green',
color0: '#54FF9F'
}
},
data:[ // 开盘,收盘,最低,最高
[2322.32,2365.59,2308.92,2366.16],
[2364.54,2359.51,2330.86,2369.65],
[2332.08,2273.4,2259.25,2333.54],
[2274.81,2326.31,2270.1,2328.14],
[2333.61,2347.18,2321.6,2351.44],
[2340.44,2324.29,2304.27,2352.02],
[2326.42,2318.61,2314.59,2333.67],
[2314.68,2310.59,2296.58,2320.96],
[2309.16,2286.6,2264.83,2333.29],
[2282.17,2263.97,2253.25,2286.33],
[2196.24,2211.59,2180.67,2212.59]
]
}
]
};
Other comments [其他信息]
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
staleInactive for a long time. Will be closed in 7 days.Inactive for a long time. Will be closed in 7 days.

