(axis: Axis, ctx: AxisLabelsComputingContext)
| 116 | * CAUTION: Do not modify the result. |
| 117 | */ |
| 118 | export 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. |
no test coverage detected
searching dependent graphs…