Toggle navigation
关于series: label normal position 的问题
By
都是最
2017-08-10 05:53:23
脚本
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 option = { tooltip: { trigger: 'axis', }, xAxis: { type: 'category', name: '0', //X轴的名称 nameLocation: 'start', //X轴名称显示的位置,默认: end nameTextStyle: { //设置名称颜色 color: '#AEAEAE', fontWeight: 'bolder', }, data: ['1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月'], axisLine: { //设置X轴的样式 show: true, lineStyle: { color: '#F2F2F2', type: 'solid', width: 3 } }, axisTick: { show: false //是否显示X轴刻度 }, axisLabel: { textStyle: { color: '#999' } } }, yAxis: { show: false, }, series: [{ name: '柱狀图', type: 'bar', label: { normal: { show: true, textStyle: { color: '#666', fontWeight: 'bolder', }, position: 'top' } }, barWidth: '30%', // 设置柱子的宽度,默认自适应 //barMinHeight: 1, //设置柱子的最小高度 // 设置柱子的样色 itemStyle: { normal: { color: function(params) { return params.value > 0 ? '#3ec182' : '#ffa142'; } } }, data: [50000, 70005, 0, {value:-10000,label:{normal:{position:'bottom'}}}, 10000, 20050, 15000, 10000, 95, 10060, 50, 4500] }, { name: '折线', type: 'line', itemStyle: { /*设置折线颜色*/ normal: { color: '#c4cddc' } }, data: [5000, 7005, 10000, -8000, 10000, 2000, 15000, 10000, 95000, 11000, 50000, 45] }] };