向下钻取按钮位置设置
2017-03-21 00:00
211 查看
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, height=device-height, initial-scale=1.0, maximum-scale=1.0,user-scalable=no" />
<title>请假统计</title>
<link rel="stylesheet" type="text/css" href="../../css/vacate/weui.css" />
<link rel="stylesheet" type="text/css" href="../../css/vacate/weiui_expand.css" />
</head>
<body>
<!--容器-->
<div id="container" style="min-width: 310px; height: 400px; margin: 0 auto">
</div>
<script src="../../js/vacateCount/zepto.min.js"></script>
<script src="https://img.hcharts.cn/highcharts/highcharts.js"></script>
<script src="https://img.hcharts.cn/highcharts/modules/drilldown.js"></script>
<script src="https://img.hcharts.cn/highcharts-plugins/highcharts-zh_CN.js"></script>
<script type="text/javascript">
$(function () {
//按钮文字设置
Highcharts.setOptions({
lang: {
drillUpText: '<<{series.name}',
}
});
Highcharts.chart('container', {
chart: {
type: 'column',
events:{
drillup: function(e) {
// 上钻回调事件
this.title.update({
text:"2016年1月-5月,病假统计"
});
},
drilldown:function(e){
var chart = this,
drilldowns ={
'一月份':{
name: '一月份',
id: 'one',
data: [
[
'呼吸道',
6
],
[
'消化道',
7
],
[
'其他',
7
]
]
},
'二月份':{
name: '二月份',
id: 'two',
data: [
[
'呼吸道',
15
],
[
'消化道',
8
],
[
'其他',
7
]
]
},
'三月份':{
name: '三月份',
id: 'three',
data: [
[
'呼吸道',
5
],
[
'消化道',
3
],
[
'其他',
2
]
]
},
'四月份':{
name: '四月份',
id: 'four',
data: [
[
'呼吸道',
5
],
[
'消化道',
10
],
[
'其他',
15
]
]
},
'五月份':{
name: '五月份',
id: 'five',
data: [
[
'呼吸道',
5
],
[
'消化道',
6
],
[
'其他',
3
]
]
}
},
series = drilldowns[e.point.name];
chart.title.update({
text:series.name+"病假详情",
});
chart.addSeriesAsDrilldown(e.point, series);
}
}
},
title: {
text: '2016年1月-5月,病假统计'
},
xAxis: {
type: 'category'
},
yAxis: {
title: {
text: '总的请假人数'
}
},
legend: {
enabled: false
},
plotOptions: {
series: {
borderWidth: 0,
dataLabels: {
enabled: true,
format: '{point.y}'
}
}
},
tooltip: {
enabled:false
// headerFormat: '<span style="font-size:11px">{series.name}</span><br>',
// pointFormat: '<span style="color:{point.color}">{point.name}</span>: <b>{point.y}人</b> of total<br/>'
},
series: [{
name: '统计',
colorByPoint: true,
data: [{
name: '一月份',
y: 20,
drilldown: true
}, {
name: '二月份',
y: 30,
drilldown: true
}, {
name: '三月份',
y: 10,
drilldown: true
},{
name: '四月份',
y: 25,
drilldown: true
},{
name: '五月份',
y: 14,
drilldown: true
}]
}],
drilldown: {
drillUpButton: {
relativeTo: 'spacingBox',
position: {
y: 0,
x: 0
},
theme: {
fill: 'white',
'stroke-width': 1,
stroke: 'silver',
r: 0,
states: {
hover: {
fill: '#bada55'
},
select: {
stroke: '#039',
fill: '#bada55'
}
}
}
},
series: []
}
});
});
</script>
</body>
</html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, height=device-height, initial-scale=1.0, maximum-scale=1.0,user-scalable=no" />
<title>请假统计</title>
<link rel="stylesheet" type="text/css" href="../../css/vacate/weui.css" />
<link rel="stylesheet" type="text/css" href="../../css/vacate/weiui_expand.css" />
</head>
<body>
<!--容器-->
<div id="container" style="min-width: 310px; height: 400px; margin: 0 auto">
</div>
<script src="../../js/vacateCount/zepto.min.js"></script>
<script src="https://img.hcharts.cn/highcharts/highcharts.js"></script>
<script src="https://img.hcharts.cn/highcharts/modules/drilldown.js"></script>
<script src="https://img.hcharts.cn/highcharts-plugins/highcharts-zh_CN.js"></script>
<script type="text/javascript">
$(function () {
//按钮文字设置
Highcharts.setOptions({
lang: {
drillUpText: '<<{series.name}',
}
});
Highcharts.chart('container', {
chart: {
type: 'column',
events:{
drillup: function(e) {
// 上钻回调事件
this.title.update({
text:"2016年1月-5月,病假统计"
});
},
drilldown:function(e){
var chart = this,
drilldowns ={
'一月份':{
name: '一月份',
id: 'one',
data: [
[
'呼吸道',
6
],
[
'消化道',
7
],
[
'其他',
7
]
]
},
'二月份':{
name: '二月份',
id: 'two',
data: [
[
'呼吸道',
15
],
[
'消化道',
8
],
[
'其他',
7
]
]
},
'三月份':{
name: '三月份',
id: 'three',
data: [
[
'呼吸道',
5
],
[
'消化道',
3
],
[
'其他',
2
]
]
},
'四月份':{
name: '四月份',
id: 'four',
data: [
[
'呼吸道',
5
],
[
'消化道',
10
],
[
'其他',
15
]
]
},
'五月份':{
name: '五月份',
id: 'five',
data: [
[
'呼吸道',
5
],
[
'消化道',
6
],
[
'其他',
3
]
]
}
},
series = drilldowns[e.point.name];
chart.title.update({
text:series.name+"病假详情",
});
chart.addSeriesAsDrilldown(e.point, series);
}
}
},
title: {
text: '2016年1月-5月,病假统计'
},
xAxis: {
type: 'category'
},
yAxis: {
title: {
text: '总的请假人数'
}
},
legend: {
enabled: false
},
plotOptions: {
series: {
borderWidth: 0,
dataLabels: {
enabled: true,
format: '{point.y}'
}
}
},
tooltip: {
enabled:false
// headerFormat: '<span style="font-size:11px">{series.name}</span><br>',
// pointFormat: '<span style="color:{point.color}">{point.name}</span>: <b>{point.y}人</b> of total<br/>'
},
series: [{
name: '统计',
colorByPoint: true,
data: [{
name: '一月份',
y: 20,
drilldown: true
}, {
name: '二月份',
y: 30,
drilldown: true
}, {
name: '三月份',
y: 10,
drilldown: true
},{
name: '四月份',
y: 25,
drilldown: true
},{
name: '五月份',
y: 14,
drilldown: true
}]
}],
drilldown: {
drillUpButton: {
relativeTo: 'spacingBox',
position: {
y: 0,
x: 0
},
theme: {
fill: 'white',
'stroke-width': 1,
stroke: 'silver',
r: 0,
states: {
hover: {
fill: '#bada55'
},
select: {
stroke: '#039',
fill: '#bada55'
}
}
}
},
series: []
}
});
});
</script>
</body>
</html>
相关文章推荐
- ubuntu 窗口控制按钮位置设置(于12.04版本为例)
- Android对话框的高级设置《二》设置对话框按钮的透明度和对话框的在屏幕上的显示位置
- Ubuntu '标题栏按钮'位置设置(2017更新)
- 按下按钮后页面的滚动条向下(或向上)滑动,松开之后便停留在当前位置的效果如何实现?
- Xamarin.iOS 导航栏各个位置按钮设置
- EXT中单击button按钮grid添加一行(光标位置可设置)的实例代码
- html设置按钮的位置方法
- 设置按钮的位置
- Qt中使用GridLayout如何设置一个按钮占两个位置
- android百度地图设置logo,缩放按钮,指南针的位置
- 1014-32-首页13-cell的结构分析---导航栏中间title位置的按钮的尺寸设置---setFrame----
- ubuntu下设置关闭/最小化/最大化按钮左右位置方法
- VC之按钮控件位置大小界面设置
- 按下按钮后页面的滚动条向下(或向上)滑动,松开之后便停留在当前位置的效果如何实现?
- vs2005 MFC界面自绘图形BMP按钮时,设置按钮的位置问题
- EXT中单击button按钮grid添加一行(光标位置可设置)的实例代码
- [转]Qt中使用GridLayout如何设置一个按钮占两个位置
- QT按钮背景颜色设置及文字显示位置设置
- 设置按钮中 图片&文字的位置,文字在左 图片在右
- html 怎样设置按钮的位置