fix chart margins

This commit is contained in:
gingervitis 2020-11-28 18:14:08 -08:00
parent f691678105
commit 3822e49591
4 changed files with 15 additions and 22 deletions

View file

@ -1,6 +1,6 @@
import { LineChart } from 'react-chartkick'
import styles from '../../styles/styles.module.css';
import 'chart.js'
import 'chart.js';
const defaultProps = {
active: false,
@ -49,17 +49,18 @@ export default function Chart({ data, title, color, unit, dataCollections }: Cha
});
return (
<LineChart
className={styles.lineChartContainer}
xtitle="Time"
ytitle={title}
suffix={unit}
legend="bottom"
color={color}
data={renderData}
download={title}
/>
)
<div className={styles.lineChartContainer}>
<LineChart
xtitle="Time"
ytitle={title}
suffix={unit}
legend="bottom"
color={color}
data={renderData}
download={title}
/>
</div>
);
}
Chart.defaultProps = {

View file

@ -100,9 +100,7 @@ const series = [
/>
</Row>
<div className="chart-container">
<Chart title="% used" dataCollections={series} color="#FF7700" unit="%" />
</div>
<Chart title="% used" dataCollections={series} color="#FF7700" unit="%" />
</div>
</div>
);

View file

@ -120,9 +120,7 @@ export default function ViewersOverTime() {
prefix={<UserOutlined />}
/>
</Row>
<div className="chart-container">
<Chart title="Viewers" data={viewerInfo} color="#2087E2" unit="" />
</div>
<Chart title="Viewers" data={viewerInfo} color="#2087E2" unit="" />
<Table dataSource={clients} columns={columns} rowKey={(row) => row.userAgent} />
</div>
);

View file

@ -35,10 +35,6 @@ pre {
border-radius: .5em;
}
.recharts-wrapper {
font-size: 12px;
}
@media (prefers-color-scheme: dark) {
@import "~antd/dist/antd.dark";
pre {