Improve plot helper typing

This commit is contained in:
Matthias 2023-05-04 07:21:00 +02:00
parent 77952ec2c9
commit 7d2be4e6df

View File

@ -1,15 +1,17 @@
import { IndicatorConfig } from '@/types';
import { SeriesOption } from 'echarts';
import { BarSeriesOption, LineSeriesOption, ScatterSeriesOption } from 'echarts';
import randomColor from '../randomColor';
export type SupportedSeriesTypes = LineSeriesOption | BarSeriesOption | ScatterSeriesOption;
export function generateCandleSeries(
colDate: number,
col: number,
key: string,
value: IndicatorConfig,
axis = 0,
): SeriesOption {
const sp: SeriesOption = {
): SupportedSeriesTypes {
const sp: SupportedSeriesTypes = {
name: key,
type: value.type || 'line',
xAxisIndex: axis,