import { CoreSeries } from '@chartwerk/core'; import { BarSerie, SizeType } from '../types'; import * as _ from 'lodash'; const DEFAULT_MIN_ANNOTATION_SIZE = 6; //px const DEFAULT_MAX_ANNOTATION_SIZE = 10; //px const BAR_SERIE_DEFAULTS = { annotation: { enable: false, color: undefined, size: { esimated: { value: undefined, type: (SizeType.PERCENT as SizeType.PERCENT) }, max: DEFAULT_MAX_ANNOTATION_SIZE, min: DEFAULT_MIN_ANNOTATION_SIZE, } }, color: undefined, opacity: 1, }; export class BarSeries extends CoreSeries { constructor(series: BarSerie[]) { super(series, BAR_SERIE_DEFAULTS); } // move to parent public getSerieByTarget(target: string): BarSerie | undefined { return _.find(this.visibleSeries, serie => serie.target === target); } }