echarts 图表建立步骤
需要引用的文件
<script src="web/mobile/js/jquery-1.8.3.min.js"></script>
<script src="web/mobile/js/echarts.js"></script>
html页面:
<div id="main2" style="width: 500px;height: 280px;"></div>
js部分:
$(function () {
// 运动/饥饿感/饮食echarts散点图
var myChart = echarts.init(document.getElementById('main2'));
option = {
color:['#A3C902'],
legend: {
data:['饮食']
},
grid: {
height:'200',
width:'450',
containLabel: true,
x: '9%',
x2: '1.5%',
y: '12%',
y2: '5%'
},
xAxis: {
name: '日期',
nameLocation: 'end',
nameTextStyle:{
color:'#1790CF',
align:'right',
baseline:'top'
},
type: 'category',
boundaryGap: false,
data: ['1', '', '3', '', '5', '', '7', '', '9', '', '11', '','13','','15','','17','','19','','21','','23','','25','','27','','29','','31'],
splitLine: {
show: true,
lineStyle:{
color: '#94999b',
width: 1,
type: 'solid'
}
},
axisLine: {
show: true,
lineStyle:{
color:'#94999b',
width: 0.5,
type: 'solid'
}
},
axisLabel: {
show: true,
interval:0
},
axisTick:{
show:true,
lineStyle:{
color:'#ccc'
}
}
},
yAxis: {
type: 'category',
boundaryGap: false,
data: ['6:00','','','','','','00:00','','','','','','18:00','','','','','', '12:00','','','','','','6:00'],
axisLabel: {
show:true,
interval:0
},
splitLine: {
show: true,
lineStyle:{
color: '#94999b',
width: 1,
type: 'solid'
}
},
axisLine: {
show: true,
lineStyle:{
color:'#94999b',
width: 0.5,
type: 'solid'
}
},
axisTick:{
show:true,
lineStyle:{
color:'#94999b'
}
}
},
series: [
name:'饮食',
type: 'scatter',
symbol:'rect',
data:[24,9.8, 9.7, 9.6, 9.2,8.9,0],
markPoint : {
symbol:'rect',
symbolSize:4,
itemStyle:{
normal:{
color:'#A3C902'
}
// 使用刚指定的配置项和数据显示图表。
myChart.setOption(option);
echarts 图表建立步骤的更多相关文章
- 【可视化】DataV接入ECharts图表库 可视化利器强强联手
DataV接入ECharts图表库 可视化利器强强联手 摘要: 两个扛把子级产品的结合,而且文末有彩蛋. DataV 数据可视化是搭建每年天猫双十一作战大屏的幕后功臣,ECharts 是广受数据可视化 ...
- C#WinForm应用程序中嵌入ECharts图表
C#WinForm应用程序中嵌入ECharts图表 程序运行效果: 下载ECharts: 官网下载ECharts :http://echarts.baidu.com/download.html 或者直 ...
- vue table中使用多选的问题(翻页后如何保存已选项),联动echarts图表实现流量监控
流量监控项目需求: 根据表格数据,添加多选功能,默认全选,根据已选项更新图表视图 1.表格需要多选 2.要联动图表,所以关键是要利用表格多选的触发回调函数 vue table中使用多选: 很简单,只需 ...
- vue中添加Echarts图表的使用,Echarts的学习笔记
项目中需要使用一些折线图.柱状图.饼状图等等,之前使用过heightCharts(关于heightCharts请看我的另一篇 http://www.cnblogs.com/jasonwang2y60/ ...
- echarts图表的封装
其实echarts官网有个快速上手的教程,一般人看一遍也知道是怎么回事,先给个传送门吧--五分钟上手 引入方式多种多样就自己去官网看了--这里简单介绍echarts怎么用,下方的封装函数比较重要 1. ...
- echarts图表第一个案例
1.action中获取到数据 @Override public String execute() throws Exception { List<Student> find = echar ...
- echarts图表标签(axisLabel)折行
在项目中遇到了一个echarts图表标签过长需折行的需求,so引出这篇总结,啦啦啦有帮助就多多支持啦,撒花撒花撒花~~~~ 在此不对echarts其他用法做解释,详细见echarts文档(点击前往) ...
- ECharts图表中级入门之formatter:夜谈关于ECharts图表内的数据格式化方法
来源于:http://www.ithao123.cn/content-3751220.html 格式化之所以存在,主要是因为我们想把一些不够人性化的内容通过某种处理让其变得人性化,便于用户更好地理解内 ...
- Echarts图表控件使用总结2(Line,Bar)—问题篇
Echarts图表控件使用总结1(Line,Bar):http://www.cnblogs.com/hanyinglong/p/Echarts.html 1.前言 a.前两天简单写了一篇在MVC中如何 ...
随机推荐
- python中locals和globals函数
参考:http://www.cnblogs.com/wanxsb/archive/2013/05/07/3064783.html Python有两个内置的函数,locals() 和globals(), ...
- lintcode-87-删除二叉查找树的节点
87-删除二叉查找树的节点 给定一棵具有不同节点值的二叉查找树,删除树中与给定值相同的节点.如果树中没有相同值的节点,就不做任何处理.你应该保证处理之后的树仍是二叉查找树. 样例 给出如下二叉查找树: ...
- springmvc文件上传,出现400 的错误问题
遇见的原因是公司系统上的图片上传忽然不好使了,报错400.单独针对这个模块调了好长时间都没解决,后来才发现前几天做过一个excel上传导入的功能... 使用SptingMVC3.1.3 对于文件上传提 ...
- powerdesigner 外键生成sql语句设置在创建表里面
根据情况需要将创建外键表的sql语句生成在创建表的sql语句中,如下设置:
- Delphi xe7组件和控件的安装方法
暂时我所遇到的所有控件安装方法大体与下面两种相同. 若有不同大家提出来,一起想办法解决. .dproj格式的组件安装方法: raise组件 安装详细步骤如下: 一.设置搜索路径1. 将本包中的文件连同 ...
- LeetCode--Remove Linked List Element
Remove all elements from a linked list of integers that have value val. ExampleGiven: 1 --> 2 --& ...
- POJ 3693 Maximum repetition substring(最多重复次数的子串)
Maximum repetition substring Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 10461 Ac ...
- [bzoj3886] [USACO15JAN]电影移动Moovie Mooving
题目链接 状压\(dp\). 注意到\(n\leq 20\)且每个只能用一次,所以很显然可以压缩每部电影看过没,记\(f[sta]\)为状态为\(sta\)时最多可以看多久. 转移时先枚举状态,然后枚 ...
- 2018牛客多校第三场 C.Shuffle Cards
题意: 给出一段序列,每次将从第p个数开始的s个数移到最前面.求最终的序列是什么. 题解: Splay翻转模板题.存下板子. #include <bits/stdc++.h> using ...
- React context基本用法
React的context就是一个全局变量,可以从根组件跨级别在React的组件中传递.React context的API有两个版本,React16.x之前的是老版本的context,之后的是新版本的 ...