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

Function createAxisLabels

src/coord/axisTickLabelBuilder.ts:118–138  ·  view source on GitHub ↗
(axis: Axis, ctx: AxisLabelsComputingContext)

Source from the content-addressed store, hash-verified

116 * CAUTION: Do not modify the result.
117 */
118export function createAxisLabels(axis: Axis, ctx: AxisLabelsComputingContext): {
119 labels: AxisLabelInfoDetermined[]
120} {
121 const custom = axis.getLabelModel().get('customValues');
122 if (custom) {
123 const scale = axis.scale;
124 return {
125 labels: zrUtil.map(parseTickLabelCustomValues(custom, scale), (tick, index) => {
126 return {
127 formattedLabel: makeLabelFormatter(axis)(tick, index),
128 rawLabel: scale.getLabel(tick),
129 tick: tick,
130 };
131 }),
132 };
133 }
134 // Only ordinal scale support tick interval
135 return axis.type === 'category'
136 ? makeCategoryLabels(axis, ctx)
137 : makeRealNumberLabels(axis);
138}
139
140/**
141 * CAUTION: Do not modify the result.

Callers 1

getViewLabelsMethod · 0.90

Calls 8

makeLabelFormatterFunction · 0.90
makeCategoryLabelsFunction · 0.85
makeRealNumberLabelsFunction · 0.85
getMethod · 0.45
getLabelModelMethod · 0.45
mapMethod · 0.45
getLabelMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…