$(function() {
Highcharts.setOptions({
global: {
useUTC: false
}
});
var chart = new Highcharts.Chart({
chart: {
renderTo: 'container', //图表放置的容器,DIV
defaultSeriesType: 'spline', //图表类型为曲线图
events: {
load: function() { }
}
},
title: {
text: '网络接收流量' //图表标题
},
xAxis: { //设置X轴
type: 'datetime', //X轴为日期时间类型
tickPixelInterval: 150 //X轴标签间隔
},
yAxis: { //设置Y轴
title:{
text: '网络接收流量'
},
max: 102400, //Y轴最大值
min: 0, //Y轴最小值
labels: {
formatter: function() {
return this.value/1000 +'KB';
}
}
},
tooltip: {//当鼠标悬置数据点时的提示框
formatter: function() { //格式化提示信息
// return '网络流量'+
// Highcharts.dateFormat('%H:%M:%S', this.x) +''+
// Highcharts.numberFormat(this.y, 2)+'%';
}
},
legend: {
enabled: false //设置图例不可见
},
exporting: {
enabled: false //设置导出按钮不可用
},
credits: {
text: '', //设置LOGO区文字
url: '' //设置LOGO链接地址
},
series: [{
data: (function() { //设置默认数据,
var data = [],
time = (new Date()).getTime(),
i; for (i = -19; i <= 0; i++) {
data.push({
x: 1410213036000,
y: 1250
});
} return data;
})()
}]
});
});
<!doctype html>
<html lang="en">
<head>
<script type="text/javascript" src="http://cdn.hcharts.cn/jquery/jquery-1.8.3.min.js"></script>
<script type="text/javascript" src="http://cdn.hcharts.cn/highcharts/highcharts.js"></script>
<script type="text/javascript" src="http://cdn.hcharts.cn/highcharts/exporting.js"></script>
<script>
//左侧Javascript代码
</script>
</head>
<body>
<div id="container" style="min-width:700px;height:400px"></div>
</body>
</html>

最新文章

  1. Flexible 弹性盒子模型之CSS flex-grow 属性
  2. 移动端全兼容的flexbox速成班
  3. IOS学习笔记 O1
  4. WinCE项目应用之虚拟仪器(VI)
  5. 使用花生壳6.5客户端FTP设置
  6. .naturalWidth 和naturalHeight属性,
  7. 关于UIView的autoresizingMask属性的研究【转】
  8. swift 子类继承父类
  9. [Js]基础知识
  10. Image.FromFile 方法锁住文件解决方法
  11. HBase笔记--自定义filter
  12. 面向对象程序设计-C++_课时12访问限制
  13. SQL 2005 中查询或执行另外的数据库操作的方法
  14. 关于webconsole报../website/console.go:35: undefined: ssh.InsecureIgnoreHostkey 错误解决方案
  15. MySQL—概念,用户的创建,主键,外键,数据类型,表格创建
  16. 解析-ESP01模块开发Arduino物联网wifi开关模块
  17. ConditionalOnProperty
  18. 浏览器预览office文件(word,Excel,等)
  19. CSS中position:fixed的相关用法
  20. python strip()函数 os.popen()

热门文章

  1. C++直接初始化和复制初始化1
  2. FPGA设计者必须精通的5项基本功
  3. 第四章.使用ant编译hadoop eclipse插件
  4. CentOS 7 安装Httpd(转)
  5. 数据结构和算法之单向链表二:获取倒数第K个节点
  6. dubbo 梗概及使用示例
  7. 关于where和having的直观理解
  8. SharePreferences基本用法
  9. Vue使用echarts
  10. 跟我学算法-SVM(支持向量机)