MCPcopy
hub / github.com/apache/echarts / getLabelPositionForHorizontal

Function getLabelPositionForHorizontal

src/chart/bar/BarView.ts:1274–1281  ·  view source on GitHub ↗
(layout: RectLayout, coordSys: CoordSysOfBar)

Source from the content-addressed store, hash-verified

1272}
1273
1274function getLabelPositionForHorizontal(layout: RectLayout, coordSys: CoordSysOfBar): 'top' | 'bottom' {
1275 if (layout.height === 0) {
1276 // For zero height, determine position based on axis inverse status
1277 const valueAxis = (coordSys as Cartesian2D).getOtherAxis((coordSys as Cartesian2D).getBaseAxis());
1278 return valueAxis.inverse ? 'bottom' : 'top';
1279 }
1280 return layout.height > 0 ? 'bottom' : 'top';
1281}
1282
1283function getLabelPositionForVertical(layout: RectLayout, coordSys: CoordSysOfBar): 'left' | 'right' {
1284 if (layout.width === 0) {

Callers 1

updateStyleFunction · 0.85

Calls 2

getBaseAxisMethod · 0.65
getOtherAxisMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…