Skip to content

Commit

Permalink
feat(axis): allow getting tickLabel and tickIndex in the formatter of…
Browse files Browse the repository at this point in the history
… axis tooltip.
  • Loading branch information
plainheart committed Oct 8, 2022
1 parent b345b4d commit 550a870
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 10 deletions.
6 changes: 5 additions & 1 deletion src/component/axis/AxisBuilder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -813,7 +813,11 @@ function buildAxisLabel(
graphic.setTooltipConfig({
el: textEl,
componentModel: axisModel,
itemName: formattedLabel
itemName: formattedLabel,
formatterParamsExtra: {
getTickLabel: () => textEl,
tickIndex: index
}
});

// Pack data for mouse event
Expand Down
27 changes: 18 additions & 9 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 550a870

Please sign in to comment.