forked from rakannimer/react-google-charts
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
50 lines (48 loc) · 1.11 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
import React from "react";
import ReactDOM from "react-dom";
import Chart from "react-google-charts";
// Ref : https://developers.google.com/chart/interactive/docs/gallery/candlestickchart#Waterfall
const data = [
["Phrases"],
["cats are better than dogs"],
["cats eat kibble"],
["cats are better than hamsters"],
["cats are awesome"],
["cats are people too"],
["cats eat mice"],
["cats meowing"],
["cats in the cradle"],
["cats eat mice"],
["cats in the cradle lyrics"],
["cats eat kibble"],
["cats for adoption"],
["cats are family"],
["cats eat mice"],
["cats are better than kittens"],
["cats are evil"],
["cats are weird"],
["cats eat mice"]
];
const options = {
wordtree: {
format: "implicit",
word: "cats"
}
};
class App extends React.Component {
render() {
return (
<div className="App">
<Chart
chartType="WordTree"
width="100%"
height="400px"
data={data}
options={options}
/>
</div>
);
}
}
const rootElement = document.getElementById("root");
ReactDOM.render(<App />, rootElement);