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

Method getDataLabelDirection

apps/chart/src/component/boxSeries.ts:785–799  ·  view source on GitHub ↗
(
    rect: RectModel | StackTotalModel,
    centerYAxis?: CenterYAxisData
  )

Source from the content-addressed store, hash-verified

783 }
784
785 getDataLabelDirection(
786 rect: RectModel | StackTotalModel,
787 centerYAxis?: CenterYAxisData
788 ): RectDirection {
789 let direction: RectDirection;
790
791 if (this.isBar) {
792 const basePos = centerYAxis ? this.leftBasePosition : this.basePosition;
793 direction = rect.x < basePos ? 'left' : 'right';
794 } else {
795 direction = rect.y >= this.basePosition ? 'bottom' : 'top';
796 }
797
798 return direction;
799 }
800
801 getOffsetSizeWithDiverging(centerYAxis: CenterYAxisData) {
802 return centerYAxis ? centerYAxis.xAxisHalfSize : this.getOffsetSize() / 2;

Callers 2

makeDataLabelMethod · 0.95
makeTotalDataLabelMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected