(
axis: Axis,
tickModel: Model<CategoryTickLabelSplitBuildingOption>,
opt?: Pick<ScaleGetTicksOpt, 'breakTicks' | 'pruneByBreak'>
)
| 143 | * @param tickModel For example, can be axisTick, splitLine, splitArea. |
| 144 | */ |
| 145 | export function createAxisTicks( |
| 146 | axis: Axis, |
| 147 | tickModel: Model<CategoryTickLabelSplitBuildingOption>, |
| 148 | opt?: Pick<ScaleGetTicksOpt, 'breakTicks' | 'pruneByBreak'> |
| 149 | ): AxisTicksCreated { |
| 150 | const scale = axis.scale; |
| 151 | const custom = axis.getTickModel().get('customValues'); |
| 152 | if (custom) { |
| 153 | return { |
| 154 | ticks: parseTickLabelCustomValues(custom, scale) |
| 155 | }; |
| 156 | } |
| 157 | // Only ordinal scale support tick interval |
| 158 | return axis.type === 'category' |
| 159 | ? makeCategoryTicks(axis, tickModel) |
| 160 | : {ticks: scale.getTicks(opt)}; |
| 161 | } |
| 162 | |
| 163 | function parseTickLabelCustomValues( |
| 164 | customValues: AxisTickLabelCustomValuesOption, |
no test coverage detected
searching dependent graphs…