mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-10 09:11:55 +00:00
73 lines
2.0 KiB
JavaScript
73 lines
2.0 KiB
JavaScript
import Paper from '@mui/core/Paper';
|
|
import Box from '@mui/core/Box';
|
|
import Tabs from '@mui/core/Tabs';
|
|
import Tab from '@mui/core/Tab';
|
|
import React from 'react';
|
|
import TradingVolumeBar from './TradingVolumeBar';
|
|
import { makeStyles } from '@mui/core/styles';
|
|
import Grid from '@mui/core/Grid';
|
|
import Typography from '@mui/core/Typography';
|
|
|
|
const useStyles = makeStyles((theme) => ({
|
|
tradingVolumeBarBox: {
|
|
height: 400,
|
|
},
|
|
paper: {
|
|
margin: theme.spacing(2),
|
|
padding: theme.spacing(2),
|
|
},
|
|
}));
|
|
|
|
export default function TradingVolumePanel() {
|
|
const [period, setPeriod] = React.useState('day');
|
|
const [segment, setSegment] = React.useState('exchange');
|
|
const classes = useStyles();
|
|
const handlePeriodChange = (event, newValue) => {
|
|
setPeriod(newValue);
|
|
};
|
|
|
|
const handleSegmentChange = (event, newValue) => {
|
|
setSegment(newValue);
|
|
};
|
|
|
|
return (
|
|
<Paper className={classes.paper}>
|
|
<Typography variant="h4" gutterBottom>
|
|
Trading Volume
|
|
</Typography>
|
|
|
|
<Grid container spacing={0}>
|
|
<Grid item xs={12} md={6}>
|
|
<Tabs
|
|
value={period}
|
|
onChange={handlePeriodChange}
|
|
indicatorColor="primary"
|
|
textColor="primary"
|
|
>
|
|
<Tab label="Day" value={'day'} />
|
|
<Tab label="Month" value={'month'} />
|
|
<Tab label="Year" value={'year'} />
|
|
</Tabs>
|
|
</Grid>
|
|
<Grid item xs={12} md={6}>
|
|
<Grid container justifyContent={'flex-end'}>
|
|
<Tabs
|
|
value={segment}
|
|
onChange={handleSegmentChange}
|
|
indicatorColor="primary"
|
|
textColor="primary"
|
|
>
|
|
<Tab label="By Exchange" value={'exchange'} />
|
|
<Tab label="By Symbol" value={'symbol'} />
|
|
</Tabs>
|
|
</Grid>
|
|
</Grid>
|
|
</Grid>
|
|
|
|
<Box className={classes.tradingVolumeBarBox}>
|
|
<TradingVolumeBar period={period} segment={segment} />
|
|
</Box>
|
|
</Paper>
|
|
);
|
|
}
|