Skip to content

Commit 934107e

Browse files
committed
feat(axis): add customValues option for axisLabel and axisTick (apache/echarts#19919)
1 parent 670e4a2 commit 934107e

File tree

3 files changed

+66
-0
lines changed

3 files changed

+66
-0
lines changed
21.9 KB
Loading

en/option/component/axis-common.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,23 @@ Options are:
213213

214214
Whether to hide overlapped labels.
215215

216+
##${prefix} customValues(Array)
217+
218+
{{ use: partial-version(
219+
version = "5.5.1"
220+
) }}
221+
222+
To customize label positions. For example,
223+
224+
```ts
225+
axisLabel: {
226+
customValues: [0, 4, 7, 8, 9]
227+
}
228+
```
229+
230+
![600xauto](~axis-tick-label-custom-values.png)
231+
232+
216233
{{ use: partial-text-style(
217234
prefix = '#' + ${prefix},
218235
defaultColor = "'#333'"
@@ -310,6 +327,22 @@ Line style of axis ticks.
310327

311328
Color of axis label is set to be [axisLine.lineStyle.color](~${componentType}.axisLine.lineStyle.color) by default.
312329

330+
##${prefix} customValues(Array)
331+
332+
{{ use: partial-version(
333+
version = "5.5.1"
334+
) }}
335+
336+
To customize tick positions. For example,
337+
338+
```ts
339+
axisTick: {
340+
alignWithLabel: true,
341+
customValues: [0, 0.5, 1, 1.5, 2, 8, 9]
342+
}
343+
```
344+
345+
![600xauto](~axis-tick-label-custom-values.png)
313346

314347

315348
{{ target: partial-axis-common-minor-tick }}

zh/option/component/axis-common.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,23 @@ X 轴或者 Y 轴的轴线是否在另一个轴的 0 刻度上,只有在另一
211211

212212
是否隐藏重叠的标签。
213213

214+
##${prefix} customValues(Array)
215+
216+
{{ use: partial-version(
217+
version = "5.5.1"
218+
) }}
219+
220+
自定义要显示的标签位置。例如:
221+
222+
```ts
223+
axisLabel: {
224+
customValues: [0, 4, 7, 8, 9]
225+
}
226+
```
227+
228+
![600xauto](~axis-tick-label-custom-values.png)
229+
230+
214231
{{ use: partial-text-style(
215232
prefix = '#' + ${prefix},
216233
defaultColor = "'#333'"
@@ -308,6 +325,22 @@ textStyle: {
308325

309326
刻度线的颜色,默认取 [axisTick.lineStyle.color](~${componentType}.axisTick.lineStyle.color)
310327

328+
##${prefix} customValues(Array)
329+
330+
{{ use: partial-version(
331+
version = "5.5.1"
332+
) }}
333+
334+
自定义要显示的坐标轴刻度位置。例如:
335+
336+
```ts
337+
axisTick: {
338+
alignWithLabel: true,
339+
customValues: [0, 0.5, 1, 1.5, 2, 8, 9]
340+
}
341+
```
342+
343+
![600xauto](~axis-tick-label-custom-values.png)
311344

312345

313346
{{ target: partial-axis-common-minor-tick }}

0 commit comments

Comments
 (0)