提交 f7d03d17 编写于 作者: nengyuangzhang's avatar nengyuangzhang

Merge branch 'develop'

...@@ -10,7 +10,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). ...@@ -10,7 +10,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- updated space export, import and clone functions in myems-api - updated space export, import and clone functions in myems-api
### Fixed ### Fixed
- None - fixed chart issues in myems-web
### Removed ### Removed
- None - None
......
...@@ -50,7 +50,7 @@ const CustomizeMap = ({Latitude, Longitude, Zoom,t}) => { ...@@ -50,7 +50,7 @@ const CustomizeMap = ({Latitude, Longitude, Zoom,t}) => {
.catch(e => { .catch(e => {
console.log(e); console.log(e);
}); });
}, []); }, [t, Latitude, Longitude, zoom]);
return ( return (
// Initialize map container, use div tag as the map container, and assign an id attribute to the div // Initialize map container, use div tag as the map container, and assign an id attribute to the div
......
...@@ -84,7 +84,7 @@ const BarChart = ({ ...@@ -84,7 +84,7 @@ const BarChart = ({
datasets: datasets datasets: datasets
}); });
} }
}, []); }, [data, compareData]);
const config = { const config = {
options: { options: {
......
...@@ -76,7 +76,7 @@ const ChartSpacesStackBar = ({ labels, inputData, costData, title, childSpaces, ...@@ -76,7 +76,7 @@ const ChartSpacesStackBar = ({ labels, inputData, costData, title, childSpaces,
datasets: dataArray datasets: dataArray
}) })
} }
}, []) }, [labels, inputData, costData, option])
const options = { const options = {
scales: { scales: {
x: { x: {
......
...@@ -50,7 +50,7 @@ const CustomizeMapBox = ({Latitude, Longitude, Zoom, Geojson, t}) => { ...@@ -50,7 +50,7 @@ const CustomizeMapBox = ({Latitude, Longitude, Zoom, Geojson, t}) => {
map.current.addControl(mapboxLanguage); map.current.addControl(mapboxLanguage);
}, []); }, [t, Latitude, Longitude, Zoom]);
useEffect(() => { useEffect(() => {
var lang = language; var lang = language;
...@@ -192,7 +192,7 @@ const CustomizeMapBox = ({Latitude, Longitude, Zoom, Geojson, t}) => { ...@@ -192,7 +192,7 @@ const CustomizeMapBox = ({Latitude, Longitude, Zoom, Geojson, t}) => {
}); });
}); });
} }
}, []) }, [language, Geojson])
return ( return (
<div id="container" className="map" style={{width:'100%', height: '100%'}} ref={mapContainer} /> <div id="container" className="map" style={{width:'100%', height: '100%'}} ref={mapContainer} />
......
...@@ -58,7 +58,7 @@ const LineChart = ({ ...@@ -58,7 +58,7 @@ const LineChart = ({
}; };
setLineData(chartData); setLineData(chartData);
} }
}, []); }, [data, option, labels]);
const config = { const config = {
options: { options: {
......
...@@ -93,7 +93,7 @@ const MixedLineChart = ({ ...@@ -93,7 +93,7 @@ const MixedLineChart = ({
}; };
setLineData(chartData); setLineData(chartData);
} }
}, []); }, [data, option, labels, options]);
const config = { const config = {
options: { options: {
......
...@@ -111,7 +111,7 @@ const MultiTrendChart = ({ ...@@ -111,7 +111,7 @@ const MultiTrendChart = ({
}; };
setLineData(chartData); setLineData(chartData);
} }
}, []); }, [baseData, reportingData, option, baseLabels, reportingLabels, rates]);
const config = { const config = {
plugins: [ChartDataLabels], plugins: [ChartDataLabels],
......
...@@ -134,7 +134,7 @@ const MultipleLineChart = ({ ...@@ -134,7 +134,7 @@ const MultipleLineChart = ({
setLinaLabels(labels[values[0]]); setLinaLabels(labels[values[0]]);
setValues(['a0']); setValues(['a0']);
setOldValues(['a0']) setOldValues(['a0'])
}, []); }, [data, labels, options]);
useEffect(() => { useEffect(() => {
let tempNodes = [...nodes]; let tempNodes = [...nodes];
...@@ -195,7 +195,7 @@ const MultipleLineChart = ({ ...@@ -195,7 +195,7 @@ const MultipleLineChart = ({
} }
setNodes(tempNodes); setNodes(tempNodes);
setLinaLabels(labels[values[0]]); setLinaLabels(labels[values[0]]);
}, []); }, [lastMoment]);
let getOption = () => { let getOption = () => {
return { return {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册