-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmarcio.php
54 lines (54 loc) · 1.67 KB
/
marcio.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
<html>
<head>
<link rel="stylesheet" href="http://cdn.oesmith.co.uk/morris-0.4.3.min.css">
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.0/jquery.min.js"></script>
<script src="http://cdnjs.cloudflare.com/ajax/libs/raphael/2.1.0/raphael-min.js"></script>
<script src="http://cdn.oesmith.co.uk/morris-0.4.3.min.js"></script>
</head>
<body>
<div id="morris-chart-area" style="height: 250px;"></div>
<div id="morris-chart-donut" style="height: 250px;"></div>
<div id="morris-chart-line" style="height: 250px;"></div>
<div id="morris-chart-bar" style="height: 250px;"></div>
<?php
$data1 = array ("2011"=>3,"2014"=>5);
$data2 = array ("Hardware"=>3,"Software"=>2, "Outros"=>5,"de pensar"=>85);
?>
<script>// First Chart Example - Area Line Chart
Morris.Area({
// ID of the element in which to draw the chart.
element: 'morris-chart-area',
// Chart data records -- each entry in this array corresponds to a point on
// the chart.
data: [
<?php
foreach ($data1 as $key=>$value) {
echo "{ d: '".$key."', chamados: ".$value." },";
}
?>
{ d: '2014', Chamadosos: 1 } ],
// The name of the data record attribute that contains x-chamadoss.
xkey: 'd',
// A list of names of data record attributes that contain y-chamadoss.
ykeys: ['chamados'],
// Labels for the ykeys -- will be displayed when you hover over the
// chart.
labels: ['Chamados'],
// Disables line smoothing
smooth: false,
});
Morris.Donut({
element: 'morris-chart-donut',
data: [
<?php
foreach ($data2 as $key=>$value) {
echo "{ label: '".$key."', value: ".$value." },";
}
?>
{label: "saporra", value: 5}
],
formatter: function (y) { return y + "%" ;}
});
</script>
</body>
</html>