-
Notifications
You must be signed in to change notification settings - Fork 0
/
teste.php
37 lines (34 loc) · 1.29 KB
/
teste.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"></script>
<script type="text/javascript">
google.load("visualization","1", {packages:['corechart']});
//chamada da função
google.setOnLoadCallback(drawChart);
//função para montar o gráfico
function drawChart(){
//variável matriz
var data =google.visualization.arrayToDataTable([
['Entradas e Saídas', 'R$', { role: 'style' } ],
['Receitas', 1000, 'color: blue'],
['Despesas', 800, 'color: red'],
]);
//opções
var options ={title: 'Entradas e Saídas',
};
//cria objeto pieChart e recebe por parâmetro a div onde será exibido
var barras = new google.visualization.BarChart(document.getElementById('barras_div'));
//criar o desenho
barras.draw(data,options);
}
</script>
</head>
<body>
<div id="barras_div" style="width: 500px; height:400px;"></div>
</body>
</html>