MCPcopy
hub / github.com/nhn/tui.chart / makeDataLabelRangeData

Method makeDataLabelRangeData

apps/chart/src/component/boxSeries.ts:752–771  ·  view source on GitHub ↗
(rect: RectModel)

Source from the content-addressed store, hash-verified

750 }
751
752 makeDataLabelRangeData(rect: RectModel): RectDataLabel[] {
753 const { dataLabels } = this.theme;
754
755 return (rect.value as RangeDataType<number>).reduce<RectDataLabel[]>(
756 (acc, value, index) => [
757 ...acc,
758 {
759 ...rect,
760 value,
761 direction: this.getDataLabelRangeDataDirection(index % 2 === 0),
762 plot: { x: 0, y: 0, size: this.getOffsetSize() },
763 theme: {
764 ...omit(dataLabels, 'stackTotal'),
765 color: dataLabels.useSeriesColor ? rect.color : dataLabels.color,
766 },
767 },
768 ],
769 []
770 );
771 }
772
773 getDataLabelRangeDataDirection(isEven: boolean) {
774 let direction: RectDirection;

Callers 1

renderMethod · 0.95

Calls 3

getOffsetSizeMethod · 0.95
omitFunction · 0.90

Tested by

no test coverage detected