Skip to content

Commit d35d2bd

Browse files
authored
fix: axis去掉x轴限制 (#2145)
1 parent 86271a2 commit d35d2bd

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

packages/f2/src/components/axis/withAxis.tsx

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -447,10 +447,10 @@ export default (View) => {
447447
// 没找到最佳步长,则保留第一个和最后一个数据,如果总range较大,保留中间的label
448448
if (finalSeq > maxSeq) {
449449
ticks[0].visible = true;
450-
if(range > SHOW_MIDDLE_LABEL_THRESHOLD && !this.hasOverlapAtSeq(ticks, maxSeq)) {
450+
if (range > SHOW_MIDDLE_LABEL_THRESHOLD && !this.hasOverlapAtSeq(ticks, maxSeq)) {
451451
ticks[maxSeq].visible = true;
452452
}
453-
ticks[range].visible = true
453+
ticks[range].visible = true;
454454
return;
455455
}
456456
for (let i = 0; i <= range; i += finalSeq) {
@@ -462,10 +462,9 @@ export default (View) => {
462462
updateCoord() {
463463
const { props } = this;
464464
const { chart, labelAutoRotate = false, labelAutoHide = false } = props;
465-
const dimType = this._getDimType();
466465
const ticks = this.getTicks();
467466

468-
if ((labelAutoRotate || labelAutoHide) && dimType === 'x' && this.hasOverlap(ticks)) {
467+
if ((labelAutoRotate || labelAutoHide) && this.hasOverlap(ticks)) {
469468
if (labelAutoRotate) {
470469
this.findSuitableRotation(ticks);
471470
}

0 commit comments

Comments
 (0)