質問編集履歴
1
ソースコードの記載
title
CHANGED
File without changes
|
body
CHANGED
@@ -6,6 +6,51 @@
|
|
6
6
|
|
7
7
|
|
8
8
|
|
9
|
-
### 試したこと
|
10
9
|
|
10
|
+
### ソースコード
|
11
|
+
```
|
12
|
+
ドロップダウン
|
13
|
+
import React, { useState } from 'react';
|
14
|
+
import { CSSTransition } from 'react-transition-group';
|
15
|
+
function Selecter() {
|
16
|
+
return(
|
17
|
+
<Selecterbar>
|
18
|
+
<SelecterbuttonA>
|
19
|
+
<DropdownMenuA />
|
20
|
+
</SelecterbuttonA>
|
21
|
+
<SelecterbuttonB>
|
22
|
+
<DropdownMenuB />
|
23
|
+
</SelecterbuttonB>
|
24
|
+
</Selecterbar>
|
25
|
+
)
|
26
|
+
}
|
27
|
+
|
28
|
+
~中略~
|
29
|
+
|
30
|
+
<DropdownItem >
|
31
|
+
<text >A</text>
|
32
|
+
</DropdownItem>
|
33
|
+
<DropdownItem >B</DropdownItem>
|
34
|
+
|
35
|
+
グラフ
|
36
|
+
import React, { Component } from "react";
|
37
|
+
import ReactEcharts from "echarts-for-react";
|
38
|
+
|
39
|
+
class Graph extends Component {
|
40
|
+
getOption = () => ({
|
41
|
+
|
42
|
+
~中略~
|
43
|
+
|
44
|
+
render() {
|
45
|
+
return (
|
46
|
+
<div className="App">
|
47
|
+
<ReactEcharts option={this.getOption()} style={{ height: 630 }} />
|
48
|
+
</div>
|
49
|
+
);
|
50
|
+
}
|
51
|
+
}
|
52
|
+
|
53
|
+
export default Graph;
|
54
|
+
```
|
55
|
+
|
11
|
-
ドロップダウンとグラフは別のコンポーネントなので
|
56
|
+
ドロップダウンとグラフは別のコンポーネントなのでデータ受け渡しをしようと思い調べてみましたがいまいちわかりません。参考になるサイトなどありましたらご教授願いたいです。
|