mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-10 09:11:55 +00:00
backtest-report: use segment control
This commit is contained in:
parent
1557423229
commit
a9ab77f6d3
|
@ -1,6 +1,8 @@
|
|||
import React, {useEffect, useRef, useState} from 'react';
|
||||
import {tsvParse} from "d3-dsv";
|
||||
import {Button} from '@mantine/core';
|
||||
import { SegmentedControl } from '@mantine/core';
|
||||
|
||||
|
||||
// https://github.com/tradingview/lightweight-charts/issues/543
|
||||
// const createChart = dynamic(() => import('lightweight-charts'));
|
||||
|
@ -483,17 +485,16 @@ const TradingViewChart = (props: TradingViewChartProps) => {
|
|||
return () => resizeObserver.current.disconnect();
|
||||
}, []);
|
||||
|
||||
|
||||
return (
|
||||
<div>
|
||||
<span>
|
||||
{intervals.map((interval) => {
|
||||
return <Button key={interval} compact onClick={() => {
|
||||
setCurrentInterval(interval)
|
||||
}}>
|
||||
{interval}
|
||||
</Button>
|
||||
})}
|
||||
</span>
|
||||
<div>
|
||||
<SegmentedControl
|
||||
data={intervals.map((interval) => { return { label: interval, value: interval } })}
|
||||
onChange={setCurrentInterval}
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div ref={chartContainerRef} style={{'flex': 1, 'minHeight': 300}}>
|
||||
</div>
|
||||
</div>
|
||||
|
|
Loading…
Reference in New Issue
Block a user