mirror of
https://github.com/freqtrade/frequi.git
synced 2024-11-11 02:33:51 +00:00
Improve plot helper typing
This commit is contained in:
parent
77952ec2c9
commit
7d2be4e6df
|
@ -1,15 +1,17 @@
|
||||||
import { IndicatorConfig } from '@/types';
|
import { IndicatorConfig } from '@/types';
|
||||||
import { SeriesOption } from 'echarts';
|
import { BarSeriesOption, LineSeriesOption, ScatterSeriesOption } from 'echarts';
|
||||||
import randomColor from '../randomColor';
|
import randomColor from '../randomColor';
|
||||||
|
|
||||||
|
export type SupportedSeriesTypes = LineSeriesOption | BarSeriesOption | ScatterSeriesOption;
|
||||||
|
|
||||||
export function generateCandleSeries(
|
export function generateCandleSeries(
|
||||||
colDate: number,
|
colDate: number,
|
||||||
col: number,
|
col: number,
|
||||||
key: string,
|
key: string,
|
||||||
value: IndicatorConfig,
|
value: IndicatorConfig,
|
||||||
axis = 0,
|
axis = 0,
|
||||||
): SeriesOption {
|
): SupportedSeriesTypes {
|
||||||
const sp: SeriesOption = {
|
const sp: SupportedSeriesTypes = {
|
||||||
name: key,
|
name: key,
|
||||||
type: value.type || 'line',
|
type: value.type || 'line',
|
||||||
xAxisIndex: axis,
|
xAxisIndex: axis,
|
||||||
|
|
Loading…
Reference in New Issue
Block a user