/
monthly_income_chart.php
93 lines (85 loc) · 2.72 KB
/
monthly_income_chart.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
<?php
include_once './class.php';
$db = new reports();
?>
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>aLpha</title>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script>
<style type="text/css">
html, body {
height:100%;
}
#box {
height:80%;
background:#331266;
}
#container {
position:relative;
height:100%;
}
tspan{
font-size: 100% !important;
}
</style>
<script type="text/javascript">
var chart1;
$(function () {
var newh = $("#box").height();
$(window).resize(function () {
newh = $("#box").height();
chart1.redraw();
chart1.reflow();
});
chart1 = new Highcharts.Chart({
chart: {
renderTo: 'container',
type: 'line'
},
title: {
text: 'Monthly Income chart'
},
subtitle: {
text: ''
},
xAxis: {
categories: [ 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']
},
yAxis: {
title: {
text: 'Monthly Income'
}
},
plotOptions: {
line: {
dataLabels: {
enabled: true
},
enableMouseTracking: false
}
},
series: [{
name: 'Income',
<?php
$report_data = $db->show_expense_month_wise();
echo'data:[';
foreach ($report_data as $data) {
echo "[$data[3]],";
}
echo ']';
?> }]
});
});
</script>
</head>
<body>
<script src="https://code.highcharts.com/highcharts.js"></script>
<script src="https://code.highcharts.com/highcharts-3d.js"></script>
<script src="https://code.highcharts.com/modules/exporting.js"></script>
<div id="box">
<div id="container"></div>
</div>
</body>
</html>