From 463bce47c687b607a9c1d6e78ddf2f59c9e3909d Mon Sep 17 00:00:00 2001 From: vargburz Date: Tue, 24 May 2022 15:47:16 +0300 Subject: [PATCH] fix defaults --- src/index.ts | 3 +++ src/models/line-series.ts | 3 +-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/index.ts b/src/index.ts index 80688df..e03acf7 100644 --- a/src/index.ts +++ b/src/index.ts @@ -17,7 +17,9 @@ export class LinePod extends ChartwerkPod { constructor(_el: HTMLElement, _series: LineTimeSerie[] = [], _options: LineOptions = {}) { super(_el, _series, _options); + console.log('coreSeries', this.coreSeries); this.coreSeries = new LineSeries(_series); + console.log('lineseries', this.coreSeries); } renderMetrics(): void { @@ -32,6 +34,7 @@ export class LinePod extends ChartwerkPod { return; } + console.log('series', this.coreSeries.visibleSeries) for(const serie of this.coreSeries.visibleSeries) { this._renderMetric(serie); } diff --git a/src/models/line-series.ts b/src/models/line-series.ts index 4b4f8f2..b14a3a0 100644 --- a/src/models/line-series.ts +++ b/src/models/line-series.ts @@ -14,13 +14,12 @@ const LINE_SERIE_DEFAULTS = { }; export class LineSeries extends CoreSeries { - _lineDefaults = LINE_SERIE_DEFAULTS; constructor(series: LineTimeSerie[]) { super(series); } protected get defaults(): LineTimeSerie { - return { ...this._coreDefaults, ...this._lineDefaults }; + return { ...this._coreDefaults, ...LINE_SERIE_DEFAULTS }; } }