Browse Source

fix defaults

merge-requests/24/head
vargburz 3 years ago
parent
commit
463bce47c6
  1. 3
      src/index.ts
  2. 3
      src/models/line-series.ts

3
src/index.ts

@ -17,7 +17,9 @@ export class LinePod extends ChartwerkPod<LineTimeSerie, LineOptions> {
constructor(_el: HTMLElement, _series: LineTimeSerie[] = [], _options: LineOptions = {}) { constructor(_el: HTMLElement, _series: LineTimeSerie[] = [], _options: LineOptions = {}) {
super(_el, _series, _options); super(_el, _series, _options);
console.log('coreSeries', this.coreSeries);
this.coreSeries = new LineSeries(_series); this.coreSeries = new LineSeries(_series);
console.log('lineseries', this.coreSeries);
} }
renderMetrics(): void { renderMetrics(): void {
@ -32,6 +34,7 @@ export class LinePod extends ChartwerkPod<LineTimeSerie, LineOptions> {
return; return;
} }
console.log('series', this.coreSeries.visibleSeries)
for(const serie of this.coreSeries.visibleSeries) { for(const serie of this.coreSeries.visibleSeries) {
this._renderMetric(serie); this._renderMetric(serie);
} }

3
src/models/line-series.ts

@ -14,13 +14,12 @@ const LINE_SERIE_DEFAULTS = {
}; };
export class LineSeries extends CoreSeries<LineTimeSerie> { export class LineSeries extends CoreSeries<LineTimeSerie> {
_lineDefaults = LINE_SERIE_DEFAULTS;
constructor(series: LineTimeSerie[]) { constructor(series: LineTimeSerie[]) {
super(series); super(series);
} }
protected get defaults(): LineTimeSerie { protected get defaults(): LineTimeSerie {
return { ...this._coreDefaults, ...this._lineDefaults }; return { ...this._coreDefaults, ...LINE_SERIE_DEFAULTS };
} }
} }

Loading…
Cancel
Save