Created
August 13, 2014 07:55
-
-
Save lyuehh/22afef30dbc5dbafc36c to your computer and use it in GitHub Desktop.
// source http://jsbin.com/buyesusicusa/1
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<script src="http://code.jquery.com/jquery-2.1.0.min.js"></script> | |
<script src="http://code.highcharts.com/highcharts.js"></script> | |
<script src="http://cdn.hcharts.cn/highcharts/highcharts-3d.js"></script> | |
<script src="http://jashkenas.github.io/underscore/underscore-min.js"></script> | |
<meta charset="utf-8"> | |
<title>JS Bin</title> | |
</head> | |
<body> | |
<div id="container"></div> | |
<script id="jsbin-javascript"> | |
var a = [{"key":"ct:numeric0","type":"numeric","min":"1"},{"key":"ct:numeric0","type":"numeric","max":"2"}, {'key': '111'}]; | |
var key = 'ct:numeric0'; | |
var opt = 'min'; | |
var ipt = 1; | |
a = _.filter(a, function(i) { | |
//console.log(i[opt]); | |
// debugger; | |
return i.key !== key || (!i[opt] && i[opt] !== ipt); | |
}); | |
console.log(a) | |
var data = [{"name":"lg-miui-op-dev02.bj","data":[5.37324]},{"name":"lg-miui-mibi-stag00.bj","data":[4.88323]},{"name":"hh-miui-cash-vm-zmd0.bj","data":[3.74213]},{"name":"hh-miui-cash-vm2004.bj","data":[3.48015]},{"name":"hh-miui-cash-vm2012.bj","data":[2.86783]},{"name":"hh-miui-cash-bank01.bj","data":[2.65435]},{"name":"hh-miui-cash-bank00.bj","data":[2.62874]},{"name":"hh-miui-cash-vm2010.bj","data":[2.47572]}] | |
$(function () { | |
d0 = data[0]; | |
$('#container').highcharts({ | |
chart: { | |
type: 'column', | |
options3d: { | |
enabled: true, | |
alpha: 15, | |
beta: 15, | |
viewDistance: 25, | |
depth: 40 | |
}, | |
marginTop: 80, | |
marginRight: 40 | |
}, | |
title: { | |
text: 'Total fruit consumption, grouped by gender' | |
}, | |
xAxis: { | |
categories: ['Apples', 'Oranges', 'Pears', 'Grapes', 'Bananas'] | |
}, | |
yAxis: { | |
allowDecimals: false, | |
min: 0, | |
title: { | |
text: 'Number of fruits' | |
} | |
}, | |
tooltip: { | |
headerFormat: '<b>{point.key}</b><br>', | |
pointFormat: '<span style="color:{series.color}">\u25CF</span> {series.name}: {point.y} / {point.stackTotal}' | |
}, | |
plotOptions: { | |
column: { | |
stacking: 'normal', | |
depth: 40 | |
} | |
}, | |
series: [{ | |
name: '', | |
data: [5, 3, 4, 7, 2]//, | |
// stack: 'male' | |
}, { | |
name: 'Joe', | |
data: [3, 4, 4, 2, 5]//, | |
//stack: 'male' | |
}] | |
}); | |
}); | |
</script> | |
</body> | |
</html> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var a = [{"key":"ct:numeric0","type":"numeric","min":"1"},{"key":"ct:numeric0","type":"numeric","max":"2"}, {'key': '111'}]; | |
var key = 'ct:numeric0'; | |
var opt = 'min'; | |
var ipt = 1; | |
a = _.filter(a, function(i) { | |
//console.log(i[opt]); | |
// debugger; | |
return i.key !== key || (!i[opt] && i[opt] !== ipt); | |
}); | |
console.log(a) | |
var data = [{"name":"lg-miui-op-dev02.bj","data":[5.37324]},{"name":"lg-miui-mibi-stag00.bj","data":[4.88323]},{"name":"hh-miui-cash-vm-zmd0.bj","data":[3.74213]},{"name":"hh-miui-cash-vm2004.bj","data":[3.48015]},{"name":"hh-miui-cash-vm2012.bj","data":[2.86783]},{"name":"hh-miui-cash-bank01.bj","data":[2.65435]},{"name":"hh-miui-cash-bank00.bj","data":[2.62874]},{"name":"hh-miui-cash-vm2010.bj","data":[2.47572]}] | |
$(function () { | |
d0 = data[0]; | |
$('#container').highcharts({ | |
chart: { | |
type: 'column', | |
options3d: { | |
enabled: true, | |
alpha: 15, | |
beta: 15, | |
viewDistance: 25, | |
depth: 40 | |
}, | |
marginTop: 80, | |
marginRight: 40 | |
}, | |
title: { | |
text: 'Total fruit consumption, grouped by gender' | |
}, | |
xAxis: { | |
categories: ['Apples', 'Oranges', 'Pears', 'Grapes', 'Bananas'] | |
}, | |
yAxis: { | |
allowDecimals: false, | |
min: 0, | |
title: { | |
text: 'Number of fruits' | |
} | |
}, | |
tooltip: { | |
headerFormat: '<b>{point.key}</b><br>', | |
pointFormat: '<span style="color:{series.color}">\u25CF</span> {series.name}: {point.y} / {point.stackTotal}' | |
}, | |
plotOptions: { | |
column: { | |
stacking: 'normal', | |
depth: 40 | |
} | |
}, | |
series: [{ | |
name: '', | |
data: [5, 3, 4, 7, 2]//, | |
// stack: 'male' | |
}, { | |
name: 'Joe', | |
data: [3, 4, 4, 2, 5]//, | |
//stack: 'male' | |
}] | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment