Toggle navigation
对称图
By
名***取
2019-05-28 05:59:57
脚本
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
图表已生成
整理代码
刷新
代码
var timeData = ['2019-1', '2019-2', '2019-3', '2019-4', '2019-5', '2019-6', '2019-7', '2019-8', '2019-9', '2019-10', '2019-11', '2019-12']; var practiceData = [ {name: '正向', value: [571, 522, 633, 675, 424, 384, 514, 482, 274, 0, 0, 0, 0]}, {name: '违纪', value: [211, 555, 348, 225, 306, 351, 246, 288, 579, 0, 0, 0, 0]}, ]; var legendData = practiceData.map(function(item) { return item.name }) option = { color: ['#FA4D41', 'orange'], tooltip: { trigger: 'axis', formatter: function(e) { return e[0].name + '
' + e[0].marker + e[0].seriesName + ':' + e[0].value + '
' + e[1].marker + e[1].seriesName + ':' + e[1].value } }, legend: { icon: 'roundRect', itemWidth: 14, itemHeight: 14, itemGap: 15, left: "right", data: legendData, textStyle: { // color: '#fff' } }, axisPointer: { link: { xAxisIndex: 'all' }, lineStyle: { color: 'red', width: 2 } }, dataZoom: [{ show: true, realtime: true, // 拖动时,是否实时更新系列的视图 start: 1, end: 40, height: 20, bottom: 50, xAxisIndex: [0, 1], handleSize: '0', // 滑动条的 左右2个滑动小块的大小 handleIcon: 'path://M306.1,413c0,2.2-1.8,4-4,4h-59.8c-2.2,0-4-1.8-4-4V200.8c0-2.2,1.8-4,4-4h59.8c2.2,0,4,1.8,4,4V413z', fillerColor: '#3C62C0', // 拖动条的颜色 borderColor: "none", backgroundColor: 'rgba(60, 98, 192, 0.302)', showDetail: false, // 即拖拽时候是否显示详细数值信息 默认true }, { type: 'inside', realtime: true, start: 1, end: 40, xAxisIndex: [0, 1] } ], grid: [{ top: 50, left: 56, right: 50, height: '40%', containLabel: true }, { left: 50, right: 50, top: '45%', height: '40%', containLabel: true }], xAxis: [{ // show: false, // 隐藏 x 轴 type: 'category', data: timeData, position: 'bottom', axisTick: { show: false // 是否显示坐标轴刻度 }, axisLine: { lineStyle: { color: 'orange' // 刻度坐标线的颜色 } }, axisLabel: { textStyle: { // 只展示一个坐标系的文字,把当前的置透明 color: 'rgba(255,255,255,0)' } }, boundaryGap: true, // boundaryGap: ['1%', '1%'] // 左右2侧留白 }, { gridIndex: 1, type: 'category', data: timeData, position: 'top', axisTick: { show: false, // 是否显示坐标轴刻度 }, axisLine: { lineStyle: { color: 'orange' // 刻度坐标线的颜色 } }, axisLabel: { // 设置轴上字体的颜色 show: true, textStyle: { color: "#333", fontSize: 14, fontWeight: 600 } }, boundaryGap: true, // boundaryGap: ['10%', '10%'] // 左右2侧留白 } ], yAxis: [{ type: 'value', gridIndex: 0, splitNumber: 4, // 坐标轴的分割段数 axisLine: { lineStyle: { color: 'orange' } }, splitLine: { show: true, // 分割线 lineStyle: { color: "orange", // 分割线背景色 // width: 1 // 分割线宽度 } }, axisLabel: { margin: 15, // 刻度标签与轴线之间的距离 textStyle: { color: "#000", fontSize: 14 } } }, { type: 'value', gridIndex: 1, inverse: true, // 翻转 splitNumber: 4, // 坐标轴的分割段数 axisLine: { lineStyle: { color: 'orange' } }, splitLine: { show: true, // 分割线 lineStyle: { color: "orange", // 分割线背景色 // width: 1 // 分割线宽度 } }, axisLabel: { margin: 15, // 刻度标签与轴线之间的距离 textStyle: { color: "#000", fontSize: 14 }, formatter: function(e) { if (e === 0) return e; return '-' + e; } } } ], series: [{ name: practiceData[0].name, type: 'line', xAxisIndex: 1, yAxisIndex: 1, symbol: 'circle', // 调整为实心远 symbolSize: 8, // 节点的圆点大小 hoverAnimation: true, // 节点的圆点动画 data: practiceData[0].value }, { name: practiceData[1].name, type: 'line', symbol: 'circle', // 调整为实心远 symbolSize: 8, hoverAnimation: true, data: practiceData[1].value } ] };