echarts使用笔记四:双Y轴
1.双Y轴显示数量和占比
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','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',
axisLabel : {
show : true,
interval : 'auto',
formatter : '{value} '
},
splitNumber : 10,
splitLine : {
show : true,
lineStyle : {
type : 'dashed'
}
},
splitArea : {
show : false
}
} ,
{
type : 'value',
axisLabel : {
show : true,
interval : 'auto',
formatter : '{value} %'
},
splitNumber : 10,
splitLine : {
show : true,
lineStyle : {
type : 'dashed'
}
},
splitArea : {
show : false
}
}
],
series : [ //用于指定图标显示类型
{
name : 'one',
type : 'bar',
barMaxWidth:100,
yAxisIndex : '0',//使用第一个y轴
itemStyle : {
normal : {
color : 'rgba(139,26,26,1)', //柱子颜色
borderType : 'dashed',
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 : '比例',
type : 'line',
symbol : 'emptyCircle',
showAllSymbol : true, //动画效果
symbolSize : 12,
smooth : true, //光滑的曲线
yAxisIndex : '1',
itemStyle : {
normal : {
color : 'rgba(139,26,26,1)',
label : {
show : true,
formatter : '{c}%',
textStyle : {
color : '#000000'
}
}
}
},
data : [1, 5, 20, 33, 39, 33, 22]
},
]
};
echarts使用笔记四:双Y轴的更多相关文章
- Python科学计算技巧积累四——双y轴图像绘制
双y轴图像具有单y轴图像没有的对比效果,在MATLAB中有plotyy函数可以实现,Python的实现方式没有MATLAB那样方便,不过实现效果却也不见得差. 以往我常用的绘图命令是import ma ...
- highchart 设置双Y轴坐标 双x轴坐标方法
我们的图表一旦引入了两种不同单位或者数量级相差很大的数据以后,这时候需要两种坐标对其进行计量. 下面以设置双Y轴为例, y轴坐标的参数设置成: yAxis: [{ title: { text: '坐标 ...
- 绘制复数图形和双y轴图形
clearclct=0:0.1:2*pi;x=sin(t);y=cos(t);z=x+i*y;subplot(1,3,1)plot(t,z,'r') %注:这种方式下,不论参数t,z哪个是复数,都将忽 ...
- Jqplot使用总结之二(双Y轴)
最近需要用Jqplot做双Y轴的Chart图,首先我找到了文档上的例子并对数据做了一些调整: 1.例子展示: var s1 = [["2002-01-01", 112000], [ ...
- MSChart使用之双Y轴使用
protected void SearchChart() { Chart1.ChartAreas.Clear(); Chart1.Series.Clear(); ChartArea _ChartAre ...
- 【Python】matplotlib 双y轴绘制及合并图例
1.双y轴绘制 关键函数:twinx() 问题在于此时图例会有两个. # -*- coding: utf-8 -*- import numpy as np import matplotlib.pypl ...
- matlab画二维直方图以及双y轴坐标如何修改另一边y轴的颜色
1.首先讲一下如何用hist画二维直方图 x=[- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ...
- Python教程:matplotlib 绘制双Y轴曲线图
前言 本文的文字及图片来源于网络,仅供学习.交流使用,不具有任何商业用途,版权归原作者所有,如有问题请及时联系我们以作处理. 作者:数据皮皮侠 双X轴的可以理解为共享y轴 ax1=ax.twiny() ...
- Python实现双X轴双Y轴绘图
诈尸人口回归.这一年忙着灌水忙到头都掉了,最近在女朋友的提醒下终于想起来博客的账号密码,正好今天灌水的时候需要画一个双X轴双Y轴的图,研究了两小时终于用Py实现了.找资料的过程中没有发现有系统的文章, ...
随机推荐
- This network connection does not exist
This network connection does not exist 在windows server 2008上面map了一个磁盘,共享的folder被我停止共享后,点击该磁盘的disconn ...
- LeetCode算法题-Remove Linked List Elements(Java实现)
这是悦乐书的第189次更新,第191篇原创 01 看题和准备 今天介绍的是LeetCode算法题中Easy级别的第48题(顺位题号是203).移除单链表中节点值为val的节点.例如: 输入:1-> ...
- February 23rd, 2018 Week 8th Friday
It takes a strong man to save himself, and a great man to save another. 强者自救,圣者渡人. When you are not ...
- java操作elasticsearch实现批量添加数据(bulk)
java操作elasticsearch实现批量添加主要使用了bulk 代码如下: //bulk批量操作(批量添加) @Test public void test7() throws IOExcepti ...
- JavaScript数据类型之数字类型
引言 JavaScript不区分整数值和浮点数值,全部使用浮点数值表示.当一个数字直接出现在JavaScript程序中,我们称之为数字直接量(numeric litertal).JavaScript支 ...
- SpringCloud之初识Feign ----- 分布式负载自动拼接请求的URL
在前面的学习中,我们使用了Ribbon的负载均衡功能,大大简化了远程调用时的代码: String baseUrl = "http://user-service/user/"; Us ...
- Teradata数据库访问链条
- ab和jmeter进行GET/POST压力测试的使用心得和比较
引言: 互联网服务压测是非常重要的评价方法,ab,webbench,jmeter等都是业界流行的测试工具,ab和webbench作为shell模式下轻量级的测试工具,jmeter则作为有GUI界面的更 ...
- Kafka 0.11新功能介绍:空消费组延迟rebalance
Kafka 0.11新功能介绍:空消费组延迟rebalance 在0.11之前的版本中,多个consumer实例加入到一个空消费组将导致多次的rebalance,这是由于每个consumer inst ...
- BSOJ 4062 -- 【清华集训2012】串珠子
Description 铭铭有n个十分漂亮的珠子和若干根颜色不同的绳子.现在铭铭想用绳子把所有的珠子连接成一个整体. 现在已知所有珠子互不相同,用整数1到n编号.对于第i个珠子和第j个珠子,可以选择不 ...