echarts柱状图Demo
2024-10-19 04:22:28
echarts链接:http://gallery.echartsjs.com/editor.html?c=xB1Sfo5JbX
代码:
var xData = ['a', 'b', 'c', 'd', 'e'];
var yData = [80, 87, 51, 81, 23];
option = {
backgroundColor: 'black',
color: ['#3398DB'],
tooltip: {
trigger: 'axis',
axisPointer: {
type: 'line',
lineStyle: {
width: 5 //显示提示线
}
},
/* axisPointer: { //不显示提示线
type: 'line',//none
lineStyle: {
opacity: 0
}
},*/
formatter: function(prams) {
return "数量:" + prams[0].data
}
//formatter: "{a} <br/>{b} : {c} "
},
grid: {
left: '0%',
right: '0%',
bottom: '0%',
top: '7%',
containLabel: true,
z: 22
},
xAxis: [{
type: 'category',
gridIndex: 0,
data: xData,
axisTick: {
alignWithLabel: true
},
axisLine: {
lineStyle: {
color: 'white',
}
},
axisLabel: {
show: true,
color: 'white',
textStyle: {
fontSize: 18
}
}
}],
yAxis: [{
type: 'value',
gridIndex: 0,
splitLine: {
show: false
},
axisTick: {
show: false
},
axisLine: {
lineStyle: {
color: 'white',
}
},
axisLabel: {
color: 'white',
formatter: '{value}',
textStyle: {
fontSize: 18
}
}
}],
series: [{
name: '数量',
type: 'bar',
barWidth: '30%',
xAxisIndex: 0,
yAxisIndex: 0,
label: {
normal: {
show: true,
position: "top",
textStyle: {
color: "#ffc72b",
fontSize: 20
}
}
},
itemStyle: {
normal: {
color: new echarts.graphic.LinearGradient(
0, 0, 0, 1, [{
offset: 0,
color: '#00feff'
},
{
offset: 0.5,
color: '#027eff'
},
{
offset: 1,
color: '#0286ff'
}
]
)
}
},
data: yData,
zlevel: 11 }, ]
};
最新文章
- 7-RandomAccessFile 随机流
- Camelot_floyd&;&;DP
- kettle插入/更新
- leanchat-android
- 机器学习&mdash;&mdash;Logistic回归
- java三种工厂模式
- frameset和iframe--框架对象及元素标签对象
- 使用for循环嵌套实现乘法口诀表
- 人工手动冷备不完全恢复介绍(purge表不完全恢复)
- WebStorm 自定义字体+颜色+语法高亮+导入导出用户设置
- OI黑科技:读入优化
- 安装Androidsdudio时
- linux服务器挂掉自动重启脚本(转)
- 办公室的远程传文件 的命令三种方式linux
- 修复PLSQL Developer 与 Office 2010的集成导出Excel 功能
- vue-8-组件
- MacBook如何用Parallels Desktop安装windows7/8
- csv到mysql数据库如何分割
- attempt to write a readonly database错误的解决(C#,SQLite)
- [错误记录_C] 还未给指针变量正确赋值的情况下,就使用它的值