Skip to content

Commit

Permalink
Merge pull request #125 from sihyeong671/sihyeong
Browse files Browse the repository at this point in the history
Sihyeong
  • Loading branch information
sihyeong671 authored Nov 22, 2021
2 parents 363a7af + fed743b commit 58a0a9a
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 18 deletions.
34 changes: 19 additions & 15 deletions client/src/components/pages/chart/chart.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,21 +44,24 @@ function Chart(props){
name: '',
data: []
};
tmpPrice.name = key;
tmpPrice.data = value?.map(elements => {
return [elements[0], elements[1]];
});
priceData.push(tmpPrice);
tmpPer.name = key;
tmpPer.data = value?.map(elements => {
return [elements[0], elements[2]];
});
perData.push(tmpPer);
tmpPbr.name = key;
tmpPbr.data = value?.map(elements => {
return [elements[0], elements[3]];
});
pbrData.push(tmpPbr);
if(value.length !== 0){
tmpPrice.name = key;
tmpPrice.data = value?.map(elements => {
return [elements[0], elements[1]];
});
priceData.push(tmpPrice);
tmpPer.name = key;
tmpPer.data = value?.map(elements => {
return [elements[0], elements[2]];
});
perData.push(tmpPer);
tmpPbr.name = key;
tmpPbr.data = value?.map(elements => {
return [elements[0], elements[3]];
});
pbrData.push(tmpPbr);

}
}

return (
Expand All @@ -85,6 +88,7 @@ function Chart(props){
highcharts={HighStock}
constructorType={"stockChart"}
options={pbrOptions(pbrData)}
/>

<HighchartsReact
highcharts={HighStock}
Expand Down
4 changes: 1 addition & 3 deletions client/src/store/reducer/chartreducer.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
import Constants from "../constants"
import _ from "lodash";
const initState = {
price:{},
per:{},
pbr:{}

}

export default function reducer(state=initState, action){
Expand Down

0 comments on commit 58a0a9a

Please sign in to comment.