echarts常用方法,legend颜色自定义,折线label显示问题(五)

更新时间:2023-06-04 20:37:28 阅读: 评论:0

echarts常⽤⽅法,legend颜⾊⾃定义,折线label显⽰问题
(五)
问题描述1:折线图,柱状图结合的双y轴图表的展⽰,使⽤通⽤属性设置echarts的legend时颜⾊不对,需要⼿动修改颜⾊,让颜⾊和柱图折线图⼀致。
问题复现:娲的拼音
通常我们使⽤是定义颜⾊会通过如下⽅式定义:(此⽅法会出现上图问题)
let option = {
color: colorArr,//legend⾃定义颜⾊值数组孕妇可以喝的茶
legend:{
right:'4%',
show:lgendItem && legendShow,
itemWidth:12,
itemHeight:12,
data:lgendItem
},
......
}
修改为如下代码可解决:
riesData.push({
name:item,
写事作文400字
睡前哄女朋友的故事type:"bar",
data:ydata[item],
yAxisIndex:0,
barWidth: "auto",
itemStyle: {
add名词
color: {
type: "linear",
x: 0,
y: 0,
x2: 0,
y2: 1,
colorStops: [{
offt: 0, color:itemSty[index%colg][0]  // 0% 处的颜⾊
},{
offt: 1, color: itemSty[index%colg][1] // 100% 处的颜⾊
}],
globalCoord: fal
}
},
color:colorArr[index%colg], //柱图对应的legend的颜⾊
})
riesData.push({
name:item,
type:"line",
yAxisIndex:1,
data: ydata[item],
游泳的游怎么写
smooth:lineSmooth,
symbol: 'circle',
symbolSize: 5,
地藏圣号showSymbol:symbolShow,
lineStyle:{
color: colorArr[index%colg],
shadowColor:colorArr[index%colg],
shadowBlur: 20,
shadowOfftX: 1,
shadowOfftY: 0,
opacity:1
},鬼神小说
areaStyle: {
color: {
type: 'linear',
x: 0,
y: 0,
x2: 0,
y2: 1,
colorStops: [{
offt: 0, color:areaSty[index%colg][0]  // 0% 处的颜⾊
},{
offt: 1, color: areaSty[index%colg][1] // 100% 处的颜⾊
}],
globalCoord: fal
},
opacity:areaOpacity,
},
color:colorArr[index%colg], //折线图对应的legend颜⾊
})
问题描述2:折线图上⽅的数据显⽰问题。如果设置折线上的item隐藏,则label数据值不显⽰。item设置为显⽰后,对折线图的label做显⽰设置才能正常显⽰出来。

本文发布于:2023-06-04 20:37:28,感谢您对本站的认可!

本文链接:https://www.wtabcd.cn/fanwen/fan/89/988501.html

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。

标签:问题   折线图   设置   折线
相关文章
留言与评论(共有 0 条评论)
   
验证码:
推荐文章
排行榜
Copyright ©2019-2022 Comsenz Inc.Powered by © 专利检索| 网站地图