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