-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathcharts.html
More file actions
40 lines (34 loc) · 1.16 KB
/
charts.html
File metadata and controls
40 lines (34 loc) · 1.16 KB
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
<!DOCTYPE html>
<html lang="pt-BR">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Exemplo de Gráfico com ApexCharts</title>
<!-- Link para o CDN do ApexCharts -->
<script src="https://cdn.jsdelivr.net/npm/apexcharts"></script>
</head>
<body>
<!-- Div onde o gráfico será renderizado -->
<div id="grafico"></div>
<script>
// Configuração dos dados do gráfico
var options = {
chart: {
type: 'bar', // Tipo de gráfico (linha, barra, etc.)
height: 350
},
series: [{
name: 'Vendas',
data: [30, 40, 35, 50, 49, 60, 70, 91, 125] // Dados da série
}],
xaxis: {
categories: ['Jan', 'Fev', 'Mar', 'Abr', 'Mai', 'Jun', 'Jul', 'Ago', 'Set'] // Categorias do eixo X
}
};
// Criação do gráfico
var chart = new ApexCharts(document.querySelector("#grafico"), options);
// Renderiza o gráfico
chart.render();
</script>
</body>
</html>