Toggle navigation
柱状图
By
小***7
2021-02-03 08:45:58
脚本
16
21
作品使用的第三方脚本
数据管理
上传数据
支持小于 5M 任意格式(csv, xlsx, json, xml, ...)的数据文件
上传后可以通过生成的文件链接异步获取托管的数据。
历史数据
0 条
无历史数据
代码修改记录
信息提示
保存作品
对当前截图不满意?你还可以
上传本地截图
重新截图
作品名称
作品描述
标签
geo
grid
legend
markLine
markPoint
bar
effectScatter
line
lines
map
timeline
title
toolbox
tooltip
visualMap
作品默认版本
最新
16
15
14
13
12
11
10
9
8
7
6
5
4
3
2
1
20:11:45
图表已生成
整理代码
刷新
代码
let newData = [{ name: '第一产业', sub: 10000, fund: 8000, revenue: 8000 }, { name: '第二产业', sub: 20000, fund: 16000, revenue: 16000 }, { name: '第三产业', sub: 30000, fund: 30000, revenue: 30000 } ] option = { backgroundColor: "#030A41", grid: { top: '100', right: '70', left: '60', bottom: '40' //图表尺寸大小 }, legend: { textStyle: { color: "#90979c", fontSize: 12 }, }, tooltip: { trigger: "axis", fontSize: 14, formatter: function(val) { console.log(val) return `
●
${val[0].axisValue}
主体数量 :
${newData[val[0]['seriesIndex']].sub}
注册资金 :
${newData[val[0]['seriesIndex']].fund}亿
税      收 :
${newData[val[0]['seriesIndex']].revenue}亿
` } }, xAxis: { type: 'category', color: '#59588D', data: [ "第一产业", "第二产业", "第三产业", ], axisLabel: { margin: 10, color: '#EEEEEE', textStyle: { fontSize: 14 }, }, axisLine: { lineStyle: { color: '#477AA5', } }, axisTick: { show: false }, splitLine: { show: false, }, }, yAxis: [{ min: 0, max: 120, axisLabel: { formatter: '{value}亿', color: '#EEEEEE', textStyle: { fontSize: 14 }, }, axisLine: { lineStyle: { color: '#477AA5', type: 'dashed' } }, axisTick: { show: false }, splitLine: { show: false, } }, { min: 0, max: 30000, type: 'value', axisLabel: { formatter: '{value}', color: '#EEEEEE', textStyle: { fontSize: 14 }, }, axisLine: { lineStyle: { color: '#477AA5', type: 'dashed' } }, axisTick: { show: false }, splitLine: { show: false, } } ], series: [{ type: 'bar', name: "注册资金", data: [20, 60, 110], barWidth: '16', itemStyle: { normal: { color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{ offset: 0, color: 'rgba(35,195,255,1)', }, { offset: 1, color: 'rgba(35,195,255,0)', }, ]), barBorderRadius: [30, 30, 0, 0] //圆角大小 }, }, label: { normal: { show: false, fontSize: 16, fontWeight: 'bold', color: '#333', position: 'top', } } }, { type: 'bar', name: "税收", data: [20, 60, 110], barWidth: '16', itemStyle: { normal: { color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{ offset: 0, color: "rgba(254,215,46,1)", }, { offset: 1, color: "rgba(254,215,46,0)", }, ]), barBorderRadius: [30, 30, 0, 0] //圆角大小 }, }, label: { normal: { show: false, fontSize: 16, fontWeight: 'bold', color: '#333', position: 'top', } } }, { data: [8000, 16000, 20000, 25000], type: 'line', showAllSymbol: true, yAxisIndex: 1, smooth: true, name: '主体数量', symbolSize: 8, symbol: "circle", itemStyle: { normal: { color: "#7BE09A", shadowColor: 'rgba(0, 0, 0, 0)', shadowBlur: 0, shadowOffsetY: 5, shadowOffsetX: 5, }, }, areaStyle: { color: { type: 'linear', x: 0, y: 0, x2: 0, y2: 1, colorStops: [{ offset: 0, color: 'rgba(123,224,154, 0.4)' }, { offset: 1, color: 'rgba(123,224,154, 0)' } ], global: false // 缺省为 false } }, } ] };