打开APP
userphoto
未登录

开通VIP,畅享免费电子书等14项超值服

开通VIP
echarts画有三角形柱形的柱状图
引言
在设计可视化大屏时,由于页面的上方已经有了条形柱状图,为了让页面显得不那么单一,我们开始思考如何将下方需要通过柱状图来展示的数据变得更多元化。
解决方案
在头部我们引入echarts,并且设置一个固定大小的背景框架。初始化echarts示例后开始指定图标的配置项和数据。设置好x轴、y轴之后,引入内容数据时,我们将symbol这一项改为triangle,最后再佐以剩余的数据即可。
代码清单
var option = {
title: {
text: "Monthly traffic",
textStyle:{//主标题
color:'#fff'
},
padding:[0,0,100,100]
},
legend: {
type:'plain',
top:'1%',
selected:{
'sales':true,
},
textStyle:{
color:'#fff',
},
tooltip:{
show:true,
color:'red',
},
data:[/
{
name:'sales',
icon:'circle',
textStyle:{
color:'#fff',
}
}
],
},
tooltip: {
show:true,
trigger:'item',
axisPointer:{
type:'shadow',
axis:'auto',
},
padding:5,
textStyle:{
color:"#fff",
},
},
grid:{
show:false,
top:80,
containLabel:false,
tooltip:{
show:true,
trigger:'item',
textStyle:{
color:'white',
},
}
},
xAxis: {
show:true,
position:'bottom',
name:'month',
nameLocation:'end',
nameTextStyle:{
color:"#fff",
padding:[5,0,0,-5],
},
nameGap:15,
axisLine:{
show:true,
lineStyle:{
color:'#fff',
width:1,
type:'solid',
},
},
axisTick:{
show:true,
inside:true,
lengt:3,
lineStyle:{
//color:'red',
width:1,
type:'solid',
},
},
axisLabel:{
show:true,
inside:false,
rotate:0,
margin: 5,
//color:'red',
},
splitLine:{
show:false,
lineStyle:{
},
},
splitArea:{
show:false,
},
data: ["1","2","3","4","5","6","7","8"],
},
yAxis: {
show:true,
position:'left',
type:'value',
name:'sales',
nameLocation:'end',
nameTextStyle:{
color:"#fff",
padding:[5,0,0,5],
},
nameGap:15,
axisLine:{
show:true,
lineStyle:{
color:'#fff',
width:1,
type:'solid',
},
},
axisTick:{
show:true,
inside:true,
lengt:3,
lineStyle:{
width:1,
type:'solid',
},
},
axisLabel:{
show:true,
inside:false,
rotate:0,
margin: 8,
},
splitLine:{
show:true,
lineStyle:{
color:'#666',
width:1,
type:'dashed',
},
},
splitArea:{
show:false,
}
},
series: [
{
name: 'sales',
type: 'pictorialBar',
legendHoverLink:true,
label:{
show:false,
position:'insideTop',
rotate:0,
color:'#eee',
},
itemStyle:{
color:'blue',
barBorderRadius:[18,18,0,0],
},
barWidth:'20',
barCategoryGap:'20%',
symbol:'triangle',
data: [4600,6900,2980,3020,5020,5900,3500,2350]
}
]
};
实习编辑:李欣容
稿件来源:深度学习与文旅应用实验室(DLETA)
本站仅提供存储服务,所有内容均由用户发布,如发现有害或侵权内容,请点击举报
打开APP,阅读全文并永久保存 查看更多类似文章
猜你喜欢
类似文章
【热】打开小程序,算一算2024你的财运
Echarts 折线波峰/高低峰图
vue引入echart
用Python分析BOSS直聘的薪资数据,年后找工作有方向了!
Echarts柱状图tooltip超出外层div部分被挡住
手把手教你做出数据可视化项目(七)可视化图表数据动态获取及界面跳转
python最全画地图,可视化数据
更多类似文章 >>
生活服务
热点新闻
分享 收藏 导长图 关注 下载文章
绑定账号成功
后续可登录账号畅享VIP特权!
如果VIP功能使用有故障,
可点击这里联系客服!

联系客服