
--- client/views/component/chart/Chart11.jsx
+++ client/views/component/chart/Chart11.jsx
... | ... | @@ -4,8 +4,14 @@ |
4 | 4 |
import am5themes_Animated from "@amcharts/amcharts5/themes/Animated"; |
5 | 5 |
import CommonUtil from "../../../resources/js/CommonUtil"; |
6 | 6 |
|
7 |
+var globalObject = {} |
|
8 |
+ |
|
7 | 9 |
export default function Chart11({ data }) { |
8 |
- const createChart = () => { |
|
10 |
+ const createChart = (drawChart) => { |
|
11 |
+ if (globalObject[drawChart]) { |
|
12 |
+ globalObject[drawChart].dispose() |
|
13 |
+ } |
|
14 |
+ |
|
9 | 15 |
let root = am5.Root.new("Chart11"); |
10 | 16 |
root._logo.dispose(); |
11 | 17 |
|
... | ... | @@ -140,6 +146,8 @@ |
140 | 146 |
// Make stuff animate on load |
141 | 147 |
// https://www.amcharts.com/docs/v5/concepts/animations/ |
142 | 148 |
chart.appear(1000, 100); |
149 |
+ |
|
150 |
+ globalObject[drawChart] = root |
|
143 | 151 |
} |
144 | 152 |
|
145 | 153 |
React.useEffect(() => { |
--- client/views/pages/equipment/EquipmentData.jsx
+++ client/views/pages/equipment/EquipmentData.jsx
... | ... | @@ -1,21 +1,16 @@ |
1 | 1 |
import React from "react"; |
2 | 2 |
import { useNavigate, useLocation } from "react-router"; |
3 | 3 |
import { useSelector } from "react-redux"; |
4 |
-import SubTitle from "../../component/SubTitle.jsx"; |
|
5 |
-import Modal from "../../component/Modal.jsx"; |
|
6 | 4 |
|
7 | 5 |
import House from "../../../resources/files/icon/house.png"; |
8 | 6 |
import Arrow from "../../../resources/files/icon/arrow.png"; |
7 |
+ |
|
8 |
+import SubTitle from "../../component/SubTitle.jsx"; |
|
9 | 9 |
import Pagination from "../../component/Pagination.jsx"; |
10 | 10 |
import Chart11 from "../../component/chart/Chart11.jsx"; |
11 |
- |
|
12 | 11 |
import CommonUtil from "../../../resources/js/CommonUtil.js"; |
13 | 12 |
|
14 |
-import DatePicker from 'react-datepicker'; |
|
15 |
-import 'react-datepicker/dist/react-datepicker.css'; |
|
16 |
- |
|
17 | 13 |
export default function EquipmentData() { |
18 |
- const navigate = useNavigate(); |
|
19 | 14 |
const location = useLocation(); |
20 | 15 |
|
21 | 16 |
//전역 변수 저장 객체 |
... | ... | @@ -222,6 +217,7 @@ |
222 | 217 |
</ul> |
223 | 218 |
</div> |
224 | 219 |
</div> |
220 |
+ |
|
225 | 221 |
<div className="right"> |
226 | 222 |
<div className="flex equip-tab"> |
227 | 223 |
<SubTitle explanation={"선택한 기관의 통계 자료입니다."} /> |
Add a comment
Delete comment
Once you delete this comment, you won't be able to recover it. Are you sure you want to delete this comment?