-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrecharts.html
78 lines (67 loc) · 2.34 KB
/
recharts.html
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
<!DOCTYPE html>
<html lang="pt-br">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Recharts</title>
</head>
<link href="css/estilo.css" rel="stylesheet" type="text/css"/>
<body>
<h1>ENTI - Aprendendo React #2</h1>
<h2>Biblioteca</h2>
<a href="http://recharts.org/#/en-US/" target="_">Recharts</a>
<br/>
<a href="https://unpkg.com/recharts/umd/Recharts.min.js" target="_">Recharts Download</a>
<br/>
<a href="https://www.npmjs.com/package/prop-types" target="_">prop-types</a>
<br/>
<a href="https://unpkg.com/prop-types/prop-types.min.js" target="_">prop-types download</a>
<br/>
<a href="http://jsfiddle.net/qbmg1567/?utm_source=website&utm_medium=embed&utm_campaign=qbmg1567" target="_">Ver Exemplo</a>
<br/><br/>
<div id="conteudo"></div>
</body>
<!--React v15.6.1 -->
<script src="js/vendors/react.js"></script>
<script src="js/vendors/react-dom.js"></script>
<script src="js/vendors/babel-core-5.8.38.js"></script>
<script src="js/vendors/prop-types.js"></script>
<script src="js/vendors/Recharts.js"></script>
<script type="text/babel">
const {BarChart, Bar, XAxis, YAxis, CartesianGrid, Tooltip, Legend} = Recharts;
const data = [
{name: 'Page A', uv: 4000, pv: 2400, amt: 2400},
{name: 'Page B', uv: 3000, pv: 1398, amt: 2210},
{name: 'Page C', uv: 2000, pv: 9800, amt: 2290},
{name: 'Page D', uv: 2780, pv: 3908, amt: 2000},
{name: 'Page E', uv: 1890, pv: 4800, amt: 2181},
{name: 'Page F', uv: 2390, pv: 3800, amt: 2500},
{name: 'Page G', uv: 3490, pv: 4300, amt: 2100},
];
let style = {backgroundColor: "white"}
class MyNotification extends React.Component{
render () {
return (
<BarChart width={600} height={300} data={data}
margin={{top: 5, right: 30, left: 20, bottom: 5}}
style = {style}>
<XAxis dataKey="name"/>
<YAxis/>
<CartesianGrid strokeDasharray="3 3"/>
<Tooltip/>
<Legend />
<Bar dataKey="pv" fill="#8884d8" />
<Bar dataKey="uv" fill="#82ca9d" />
</BarChart>
);
}
}
let destino = document.querySelector("#conteudo")
ReactDOM.render(
<div>
<MyNotification />
</div>,destino
)
</script>
</html>