1 Star 0 Fork 0

前端 / char_demo

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
charge_sum.html 5.29 KB
一键复制 编辑 原始数据 按行查看 历史
ok_fish 提交于 2018-08-04 11:17 . a
<script src="https://apps.bdimg.com/libs/jquery/2.1.4/jquery.min.js"></script>
<div class="Statistics" id="container_all" style="height:320px"></div>
<script src="https://cdn.hcharts.cn/highcharts/highcharts.js"></script>
<script type="text/javascript">
$(function () {
fill_highchars('container_all',"总充值数据",["2018-05-03","2018-05-04","2018-05-05","2018-05-06","2018-05-07","2018-05-08","2018-05-09","2018-05-10","2018-05-11","2018-05-12","2018-05-13","2018-05-14","2018-05-15","2018-05-16","2018-05-17","2018-05-18","2018-05-19","2018-05-20","2018-05-21","2018-05-22","2018-05-23","2018-05-24","2018-05-25","2018-05-26","2018-05-27","2018-05-28","2018-05-29","2018-05-30","2018-05-31","2018-06-01","2018-06-02","2018-06-03","2018-06-04","2018-06-05","2018-06-06","2018-06-07","2018-06-08","2018-06-09","2018-06-10","2018-06-11","2018-06-12","2018-06-13","2018-06-14","2018-06-15","2018-06-16","2018-06-17","2018-06-18","2018-06-19","2018-06-20","2018-06-21","2018-06-22","2018-06-23","2018-06-24","2018-06-25","2018-06-26","2018-06-27","2018-06-28","2018-06-29","2018-06-30","2018-07-01","2018-07-02","2018-07-03","2018-07-04","2018-07-05","2018-07-06","2018-07-07","2018-07-08","2018-07-09","2018-07-10","2018-07-11","2018-07-12","2018-07-13","2018-07-14","2018-07-15","2018-07-16","2018-07-17","2018-07-18","2018-07-19","2018-07-20","2018-07-21","2018-07-22","2018-07-23","2018-07-24","2018-07-25","2018-07-26","2018-07-27","2018-07-28","2018-07-29","2018-07-30","2018-07-31","2018-08-01","2018-08-02","2018-08-03","2018-08-04"],[5627,8597,4322,4228,3111,4389,3400,2626,4038,4838,5502,1566,1808,611,717,637,898,1211,697,1650,648,344,518,653,597,423,292,381,42,2490,243,841,202,602,66,986,1003,619,433,711,168,1245,276,675,490,1542,1036,391,293,559,501,657,252,352,311,277,81,95,79,1612,427,637,348,361,478,708,115,172,1108,2882,4024,4634,1546,14640,1108,3131,1776,2180,1083,2597,722,1567,668,1554,701,1956,480,1770,713,3341,770,905,277,494],[99,111,79,64,47,66,56,45,45,57,51,24,22,39,45,36,41,43,32,38,27,23,31,28,25,30,12,15,9,18,12,22,19,20,13,24,34,14,14,17,10,22,14,14,12,13,10,7,9,11,11,15,10,10,8,14,6,10,7,14,14,13,9,11,9,13,8,12,15,13,60,63,34,48,22,39,29,37,35,33,19,32,18,27,14,25,17,26,16,23,17,13,8,8]);
});
</script>
<script type="text/javascript">
function fill_highchars(container,title,x_day,y_charge,y_charge_num){
$('#'+container).highcharts({
credits:{
enabled:false // 禁用版权信息
},
chart: {
zoomType: 'xy'
},
title: {
text:title
},
subtitle: {
text: ' '
},
xAxis: [
{
categories: x_day,
crosshair: true
}
],
plotOptions: {
column: {
dataLabels: {
format: '{y} ',
enabled: true // 开启数据标签
},
enableMouseTracking: true // 关闭鼠标跟踪,对应的提示框、点击事件会失效
},
spline: {
dataLabels: {
format: '{y} %',
enabled: true, // 开启数据标签
},
enableMouseTracking: true // 关闭鼠标跟踪,对应的提示框、点击事件会失效
},
},
yAxis: [
{ // Secondary yAxis
gridLineWidth: 0,
title: {
text: '金额',
style: {
color: Highcharts.getOptions().colors[0]
}
},
labels: {
format: '¥{value} .00',
style: {
color: Highcharts.getOptions().colors[0]
}
},
// tickPositions: [0, 20, 40, 60, 80, 100, 120, 140, 160, 180, 200],
}
],
tooltip: {
shared: true
},
legend: {
layout: 'horizontal',
align: 'center',
verticalAlign: 'bottom',
backgroundColor: (Highcharts.theme && Highcharts.theme.legendBackgroundColor) || '#FFFFFF'
},
series: [
{
name: '充值金额',
type: 'column',
data: y_charge,
tooltip: {
valuePrefix: ''
}
},
{
name: '充值人数',
type: 'column',
data: y_charge_num,
tooltip: {
valueSuffix: ''
}
}
]
});
}
</script>
1
https://gitee.com/webcode1234/char_demo.git
git@gitee.com:webcode1234/char_demo.git
webcode1234
char_demo
char_demo
master

搜索帮助