echarts使用笔记二:柱子堆叠
1.多个柱子堆叠效果,多用于各部分占比
app.title = '坐标轴刻度与标签对齐';
option = {
title : { //标题
x : 'center',
y : 5,
text : '占比图' //换行用 \n
},
legend : { //图标
show : true,
x : 'center',
y : 30,
itemGap : 10,
itemWidth : 30,
itemHeight : 10,
data : ['one','two','three']
},
color: ['#3398DB'],// 柱状图颜色
tooltip : { //鼠标悬停提示内容
trigger: 'axis',
axisPointer : { // 坐标轴指示器,坐标轴触发有效
type : 'shadow' // 默认为直线,可选为:'line' | 'shadow'
}
},
grid: { //布局 控制图的大小,调整下面这些值就可以
left: '3%',
right: '4%',
bottom: '3%',
containLabel: true
//y2 : 40
// y2可以控制 X轴跟Zoom控件之间的间隔,避免以为倾斜后造成 label重叠到zoom上
},
xAxis : [ //X轴
{
type : 'category',
data : ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'],
axisTick: {
alignWithLabel: true
}
}
],
yAxis : [ //Y轴
{
type : 'value'
}
],
series : [ //用于指定图标显示类型
/*{
name:'直接访问', //柱子的名称
type:'bar', //类型
barWidth: '60%', //宽度
data:[10, 52, 200, 334, 390, 330, 220]
},*/
{
name : 'one',
type : 'bar',
stack : '占比',
barWidth: '60%', //宽度
barMaxWidth:100,//柱子最大宽度
itemStyle : { //设置柱子总体内容
normal : {
color : 'rgba(139,26,26,1)', //柱子颜色
borderType : 'dashed',
barBorderRadius:[10, 10, 10, 10], //柱子圆角
label : { //设置柱子上面的内容
show : false, //数据是否显示在柱子上
position : 'inside',
offset : [ 0, 0 ],
formatter : '{c}', //如果是百分比:formatter : '{c}%',
textStyle : {//字体内容设置
color : '#000000',
fontStyle : 'normal',
fontWeight : 'normal',
fontFamily : 'sans-serif',
fontSize : 6
}
}
}
},
data : [10, 52, 200, 334, 390, 330, 220]
}, {
name : 'two',
type : 'bar',
stack : '占比',
barMaxWidth:100,
itemStyle : {
normal : {
color : 'rgba(205,38,38,1)',
borderType : 'dashed',
barBorderRadius:[10, 10, 10, 10],
label : {
show : true,
position : 'inside',
formatter : '{c}%',
}
}
},
data : [10, 52, 200, 334, 390, 330, 220]
}, {
name : 'three',
type : 'bar',
stack : '占比',
barMaxWidth:100,
itemStyle : {
normal : {
color : 'rgba(205,38,38,0.5)',
barBorderRadius:[10, 10, 10, 10],
}
},
data : [10, 52, 200, 334, 390, 330, 220]
}
]
};
echarts使用笔记二:柱子堆叠的更多相关文章
- echarts使用笔记三:柱子对比
app.title = '坐标轴刻度与标签对齐'; option = { title : { //标题 x : 'center', y : 5, text : '对比图' //换行用 \n }, le ...
- 深入浅出ECharts系列 (二) 折线图
深入浅出ECharts系列(二) 目标 本次教程的目标是实现“折线图堆叠”折线,实现结果如图: 2. 准备工作 a) 首先下载ECharts插件,你可以根据自己的实际需求选择你想要下载 ...
- amazeui学习笔记二(进阶开发3)--HTML/CSS规范Rules
amazeui学习笔记二(进阶开发3)--HTML/CSS规范Rules 一.总结 1.am:以 am 为命名空间 2.模块状态: {命名空间}-{模块名}-{状态描述} 3.子模块: {命名空间}- ...
- 《CMake实践》笔记二:INSTALL/CMAKE_INSTALL_PREFIX
<CMake实践>笔记一:PROJECT/MESSAGE/ADD_EXECUTABLE <CMake实践>笔记二:INSTALL/CMAKE_INSTALL_PREFIX &l ...
- jQuery源码笔记(二):定义了一些变量和函数 jQuery = function(){}
笔记(二)也分为三部分: 一. 介绍: 注释说明:v2.0.3版本.Sizzle选择器.MIT软件许可注释中的#的信息索引.查询地址(英文版)匿名函数自执行:window参数及undefined参数意 ...
- Mastering Web Application Development with AngularJS 读书笔记(二)
第一章笔记 (二) 一.scopes的层级和事件系统(the eventing system) 在层级中管理的scopes可以被用做事件总线.AngularJS 允许我们去传播已经命名的事件用一种有效 ...
- Python 学习笔记二
笔记二 :print 以及基本文件操作 笔记一已取消置顶链接地址 http://www.cnblogs.com/dzzy/p/5140899.html 暑假只是快速过了一遍python ,现在起开始仔 ...
- WPF的Binding学习笔记(二)
原文: http://www.cnblogs.com/pasoraku/archive/2012/10/25/2738428.htmlWPF的Binding学习笔记(二) 上次学了点点Binding的 ...
- webpy使用笔记(二) session/sessionid的使用
webpy使用笔记(二) session的使用 webpy使用系列之session的使用,虽然工作中使用的是django,但是自己并不喜欢那种大而全的东西~什么都给你准备好了,自己好像一个机器人一样赶 ...
随机推荐
- LeetCode算法题-Reverse Bits(Java实现)
这是悦乐书的第185次更新,第187篇原创 01 看题和准备 今天介绍的是LeetCode算法题中Easy级别的第44题(顺位题号是190).给定32位无符号整数,求它的反转位.例如: 输入:4326 ...
- 《Java大学教程》—第4章 方法的实现
4.2~3 声明.实现.调用4.4 数据传递:实参.形参.返回值4.6 变量作用域:局部变量(区域内访问).全局变量4.7 重载:运算符重载.方法重载-->多态 1.答:P67方法(method ...
- Win10 开始运行不保存历史记录原因和解决方法
Win10 开始运行命令以后,再次打开就没有任何历史记录了,常规方法是桌面-右键-个性化-开始-显示最常用的应用..可是打开是灰色的不可选. 每次打开开始都没有以前的记录..比如需要打开下regedi ...
- own address as source address
1222.762730] br0: received packet on nbif0 with own address as source address[ 1222.769697] br0: rec ...
- UEditor学习笔记1
首先对于前段时间遇到的一些总结做下记录: 0 == '' => true transition,渐变属性,其值可以是某属性,也可以是all,如transition: all 0.3s:鼠标放到 ...
- 洛谷P1904
法一,数字太大,可能通过不了 #include <iostream>#include <algorithm>#include <cstdio>using nam ...
- @RequestParam 和@RequestBody 的区别?
@RequestParam用来接收: 1 用来处理简单的参数绑定 2 用来接收 Content-Type 是 application/x-www-form-urlencoded (这种格 式的数据 ...
- 文件是数据的流式IO抽象,mmap是对文件的块式IO抽象
文件是数据的流式IO抽象,mmap是对文件的块式IO抽象
- 深入理解session机制
原文链接https://blog.csdn.net/xihuangwutong/article/details/9819033 1. session概念 2. http协议与状态保持 3. 理解coo ...
- 當 Alexa 遇上 ESP8266 (一)
https://www.birdandgua.net/bird/2017/12/when_alexa_meets_esp8266-1/ 去年的 AWS 的 re:Invent 上,我見識了 Alexa ...