forked from rakannimer/react-google-charts
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
63 lines (61 loc) · 1.07 KB
/
index.js
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
import React from "react";
import ReactDOM from "react-dom";
import Chart from "react-google-charts";
const pieOptions = {
title: "",
pieHole: 0.6,
slices: [
{
color: "#2BB673"
},
{
color: "#d91e48"
},
{
color: "#007fad"
},
{
color: "#e9a227"
}
],
legend: {
position: "bottom",
alignment: "center",
textStyle: {
color: "233238",
fontSize: 14
}
},
tooltip: {
showColorCode: true
},
chartArea: {
left: 0,
top: 0,
width: "100%",
height: "80%"
},
fontName: "Roboto"
};
class App extends React.Component {
state = {
chartImageURI: ""
};
render() {
return (
<div className="App">
<Chart
chartType="PieChart"
data={[["Age", "Weight"], ["a", 12], ["b", 5.5]]}
options={pieOptions}
graph_id="PieChart"
width={"100%"}
height={"400px"}
legend_toggle
/>
</div>
);
}
}
const rootElement = document.getElementById("root");
ReactDOM.render(<App />, rootElement);