Skip to content

Commit db47abe

Browse files
authored
docs: 子弹图提供自定义 ticks 的 demo (#2520)
1 parent d73fc0b commit db47abe

File tree

1 file changed

+7
-1
lines changed
  • examples/progress-plots/bullet/demo

1 file changed

+7
-1
lines changed

examples/progress-plots/bullet/demo/basic.ts

+7-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,13 @@ const bulletPlot = new Bullet('container', {
2323
xAxis: {
2424
line: null,
2525
},
26-
yAxis: false,
26+
yAxis: {
27+
tickMethod: ({ max }) => {
28+
const interval = Math.ceil(max / 5);
29+
// 自定义刻度 ticks
30+
return [0, interval, interval * 2, interval * 3, interval * 4, max];
31+
},
32+
},
2733
// 自定义 legend
2834
legend: {
2935
custom: true,

0 commit comments

Comments
 (0)