11import { Spin } from 'antd'
22import React , { useState , useEffect , useRef } from 'react'
3- import * as echarts from 'echarts/core' ;
3+ import * as echarts from 'echarts/core'
44import {
55 DatasetComponent ,
66 DatasetComponentOption ,
@@ -16,14 +16,14 @@ import {
1616 VisualMapComponentOption ,
1717 DataZoomComponent ,
1818 DataZoomComponentOption
19- } from 'echarts/components' ;
19+ } from 'echarts/components'
2020import {
2121 CandlestickChart ,
2222 CandlestickSeriesOption ,
2323 BarChart ,
2424 BarSeriesOption
25- } from 'echarts/charts' ;
26- import { CanvasRenderer } from 'echarts/renderers' ;
25+ } from 'echarts/charts'
26+ import { CanvasRenderer } from 'echarts/renderers'
2727
2828echarts . use ( [
2929 DatasetComponent ,
@@ -36,19 +36,19 @@ echarts.use([
3636 CandlestickChart ,
3737 BarChart ,
3838 CanvasRenderer
39- ] ) ;
39+ ] )
4040
4141type 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+ >
5252
5353export const DayKLineChart : React . FC < { id : string } > = ( { id} ) => {
5454
@@ -58,10 +58,10 @@ export const DayKLineChart: React.FC<{id: string}> = ({id}) => {
5858 const [ data , setData ] = useState ( { } )
5959
6060 useEffect ( ( ) => {
61- const myChart = echarts . init ( chartRef . current ) ;
61+ const myChart = echarts . init ( chartRef . current )
6262 } , [ id ] )
6363
6464 return < Spin spinning = { loading } >
6565 < div ref = { chartRef } > </ div >
66- </ Spin >
66+ </ Spin >
6767}
0 commit comments