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,但是自己并不喜欢那种大而全的东西~什么都给你准备好了,自己好像一个机器人一样赶 ...
随机推荐
- centos下mysql授予权限提示ERROR 1133 (42000): Can't find any matching row in the user table
错误: 给mysql对应的用户授予权限的时候提示报错: 解决方法: 后面才知道原来是同事这边新增了用户没有flush grant all privileges on *.* to 'user'@'%' ...
- 4.12Python数据处理篇之Matplotlib系列(十二)---绘图风格的介绍
目录 目录 前言 (一)不同风格 1.说明: 2.使用: 3.代码使用: (二)例子演示 1.dark_background 2.bmh 3.fivethirtyeight 4.ggplot 5.gr ...
- Java高级教程02
目录 1.Java线程 1.1. 多线程和多进程 1.2. 线程的执行过程: 1.3. 创建线程的方法 (1). 方法1:通过run() (2). 方法2: 复写Runnable接口(推荐) 1.4. ...
- Boolean类型在EF和MySql中的映射关系
MySQL没有Boolean类型.这也是比较奇怪的现象.例: create table xs ( id int primary key, bl boolean ) 这样是可以创建成功,但查看一下建表后 ...
- 浅析 PHP 中的 Generator
浅析 PHP 中的 Generator Miss Wang php开发案例 前天 何为 Generator 从 PHP 5.5 开始,PHP 加入了一个新的特性,那就是 Generator,中文译为生 ...
- NOsql总结
NOsql总结 1.存储: 任意格式的数据:值对存储,列存储,文档存储,图形数据库 灵活的表结构支持:类型动态.scheme动态: 灵活的存储形式:列存储: 弱关系:NoSQL数据库种类繁多,但是一个 ...
- 转://Oracle undo 自动调优
Oracle 10gr2的后续版本中添加了UNDO信息最短保留时间段自动调优的特性,不再仅仅依据参数UNDO_RETENTION的设定,其调优原则如下:1. 当UNDO TABLESPACE为 fix ...
- 第9章 Java中的线程池 第10章 Exector框架
与新建线程池相比线程池的优点 线程池的分类 ThreadPoolExector参数.执行过程.存储方式 阻塞队列 拒绝策略 10.1 Exector框架简介 10.1.1 Executor框架的两级调 ...
- TFT2.2
https://cdn-learn.adafruit.com/downloads/pdf/2-2-tft-display.pdf
- classmethod 和 staticmethod
我一般很少用到. Talk is cheap, show you the code. #!/usr/bin/env python # -*- coding: utf-8 -*- ########### ...