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,但是自己并不喜欢那种大而全的东西~什么都给你准备好了,自己好像一个机器人一样赶 ...
随机推荐
- .net的mvc的fw版本为4.5发布到阿里云【云虚拟主机】上.
注意:云虚拟主机和云服务器(ECS)不是同一个产品,请注意分别. 云服务器ECS: 云虚拟主机: 我用的是云虚拟主机也是第二个,版本是window server 声明:默认,已经把域名[已备案]绑定 ...
- LeetCode算法题-Find All Anagrams in a String(Java实现)
这是悦乐书的第228次更新,第240篇原创 01 看题和准备 今天介绍的是LeetCode算法题中Easy级别的第95题(顺位题号是438).给定一个字符串s和一个非空字符串p,找到s中p的字谜的所有 ...
- Pycharm用鼠标滚轮控制字体大小
一.pycharm字体放大的设置 File —> setting —> Keymap —>在搜寻框中输入:increase —> Increase Font Size(双击) ...
- 【大数据技术】Sqoop
1.Sqoop是什么 Sqoop:SQL-to-Hadoop,传统数据库与Hadoop间数据同步工具.(MySQL.Oracle <==> HDFS.HBase.Hive) Sqoop ...
- line-height
如何实现左右两边有小竖线,但是高度比中间的字短? 用line-height,把line-height设置得跟height一样大,同时把font-size设置比line-height大即可
- 寒假训练——搜索——C - Robot
The Robot Moving Institute is using a robot in their local store to transport different items. Of co ...
- zuul重试配置
#retry#该参数用来开启重试机制spring.cloud.loadbalancer.retry.enabled=true#断路器的超时时间,断路器的超时时间需要大于ribbon的超时时间,不然不会 ...
- 深度学习之Attention Model(注意力模型)
1.Attention Model 概述 深度学习里的Attention model其实模拟的是人脑的注意力模型,举个例子来说,当我们观赏一幅画时,虽然我们可以看到整幅画的全貌,但是在我们深入仔细地观 ...
- wordpress数据表分析
wordpress一共是有12个表的:|wp_commentmeta || wp_comments || wp_links || wp_options || wp_postmeta || wp_pos ...
- selenium:解决页面元素display:none的方法
在UI自动化测试中,有时候会遇到页面元素无法定位的问题,包括xpath等方法都无法定位,是因为前端元素被设置为不可见导致. 这篇博客,介绍下如何通过JavaScript修改页面元素属性来定位的方法.. ...