1
1
import { Spin } from 'antd'
2
2
import React , { useState , useEffect , useRef } from 'react'
3
- import * as echarts from 'echarts/core' ;
3
+ import * as echarts from 'echarts/core'
4
4
import {
5
5
DatasetComponent ,
6
6
DatasetComponentOption ,
@@ -16,14 +16,14 @@ import {
16
16
VisualMapComponentOption ,
17
17
DataZoomComponent ,
18
18
DataZoomComponentOption
19
- } from 'echarts/components' ;
19
+ } from 'echarts/components'
20
20
import {
21
21
CandlestickChart ,
22
22
CandlestickSeriesOption ,
23
23
BarChart ,
24
24
BarSeriesOption
25
- } from 'echarts/charts' ;
26
- import { CanvasRenderer } from 'echarts/renderers' ;
25
+ } from 'echarts/charts'
26
+ import { CanvasRenderer } from 'echarts/renderers'
27
27
28
28
echarts . use ( [
29
29
DatasetComponent ,
@@ -36,19 +36,19 @@ echarts.use([
36
36
CandlestickChart ,
37
37
BarChart ,
38
38
CanvasRenderer
39
- ] ) ;
39
+ ] )
40
40
41
41
type EChartsOption = echarts . ComposeOption <
42
- | DatasetComponentOption
43
- | TitleComponentOption
44
- | ToolboxComponentOption
45
- | TooltipComponentOption
46
- | GridComponentOption
47
- | VisualMapComponentOption
48
- | DataZoomComponentOption
49
- | CandlestickSeriesOption
50
- | BarSeriesOption
51
- > ;
42
+ | DatasetComponentOption
43
+ | TitleComponentOption
44
+ | ToolboxComponentOption
45
+ | TooltipComponentOption
46
+ | GridComponentOption
47
+ | VisualMapComponentOption
48
+ | DataZoomComponentOption
49
+ | CandlestickSeriesOption
50
+ | BarSeriesOption
51
+ >
52
52
53
53
export const DayKLineChart : React . FC < { id : string } > = ( { id} ) => {
54
54
@@ -58,10 +58,10 @@ export const DayKLineChart: React.FC<{id: string}> = ({id}) => {
58
58
const [ data , setData ] = useState ( { } )
59
59
60
60
useEffect ( ( ) => {
61
- const myChart = echarts . init ( chartRef . current ) ;
61
+ const myChart = echarts . init ( chartRef . current )
62
62
} , [ id ] )
63
63
64
64
return < Spin spinning = { loading } >
65
65
< div ref = { chartRef } > </ div >
66
- </ Spin >
66
+ </ Spin >
67
67
}
0 commit comments