Compare commits
2 Commits
main
...
bar-chart-
Author | SHA1 | Date |
---|---|---|
vargburz | 43ecf4ae78 | 3 years ago |
vargburz | 50f9b43dfc | 3 years ago |
6 changed files with 68 additions and 9 deletions
@ -0,0 +1,29 @@
|
||||
import { CoreSeries } from '@chartwerk/core'; |
||||
import { ScatterData, PointType, LineType } from '../types'; |
||||
|
||||
import * as _ from 'lodash'; |
||||
|
||||
const DEFAULT_POINT_SIZE = 4; |
||||
|
||||
const SCATTER_DATA_DEFAULTS = { |
||||
pointType: PointType.CIRCLE, |
||||
lineType: LineType.NONE, |
||||
pointSize: DEFAULT_POINT_SIZE, |
||||
colorFormatter: undefined |
||||
}; |
||||
|
||||
export class ScatterSeries extends CoreSeries<ScatterData> { |
||||
|
||||
constructor(series: ScatterData[]) { |
||||
super(series); |
||||
} |
||||
|
||||
protected get defaults(): ScatterData { |
||||
return { ...this._coreDefaults, ...SCATTER_DATA_DEFAULTS }; |
||||
} |
||||
|
||||
// move to parent
|
||||
public getSerieByTarget(target: string): ScatterData | undefined { |
||||
return _.find(this.visibleSeries, serie => serie.target === target); |
||||
} |
||||
} |
@ -0,0 +1,29 @@
|
||||
import { CoreSeries } from '@chartwerk/core'; |
||||
import { ScatterData, PointType, LineType } from '../types'; |
||||
|
||||
import * as _ from 'lodash'; |
||||
|
||||
const DEFAULT_POINT_SIZE = 4; |
||||
|
||||
const SCATTER_DATA_DEFAULTS = { |
||||
pointType: PointType.CIRCLE, |
||||
lineType: LineType.NONE, |
||||
pointSize: DEFAULT_POINT_SIZE, |
||||
colorFormatter: undefined |
||||
}; |
||||
|
||||
export class ScatterSeries extends CoreSeries<ScatterData> { |
||||
|
||||
constructor(series: ScatterData[]) { |
||||
super(series); |
||||
} |
||||
|
||||
protected get defaults(): ScatterData { |
||||
return { ...this._coreDefaults, ...SCATTER_DATA_DEFAULTS }; |
||||
} |
||||
|
||||
// move to parent
|
||||
public getSerieByTarget(target: string): ScatterData | undefined { |
||||
return _.find(this.visibleSeries, serie => serie.target === target); |
||||
} |
||||
} |
Loading…
Reference in new issue