Skip to content

Commit

Permalink
refactor(axis): add isEllipsised into the callback parameters of th…
Browse files Browse the repository at this point in the history
…e axis label tooltip.
  • Loading branch information
plainheart committed Apr 29, 2024
1 parent 6f66ab7 commit 33b9fdd
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
5 changes: 3 additions & 2 deletions src/component/axis/AxisBuilder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,9 @@ import {shouldShowAllLabels} from '../../coord/axisHelper';
import { AxisBaseModel } from '../../coord/AxisBaseModel';
import { ZRTextVerticalAlign, ZRTextAlign, ECElement, ColorString } from '../../util/types';
import { AxisBaseOption } from '../../coord/axisCommonTypes';
import Element from 'zrender/src/Element';
import type Element from 'zrender/src/Element';
import { PathStyleProps } from 'zrender/src/graphic/Path';
import type TSpan from 'zrender/src/graphic/TSpan';
import OrdinalScale from '../../scale/Ordinal';
import { prepareLayoutList, hideOverlap } from '../../label/labelLayoutHelper';

Expand Down Expand Up @@ -841,7 +842,7 @@ function buildAxisLabel(
componentModel: axisModel,
itemName: formattedLabel,
formatterParamsExtra: {
getTickLabel: () => textEl,
isEllipsised: () => formattedLabel !== (textEl.childrenRef()[0] as TSpan).style.text,
tickIndex: index
}
});
Expand Down
3 changes: 1 addition & 2 deletions test/axisLabel.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 33b9fdd

Please sign in to comment.