Skip to content

Commit

Permalink
fix: 修复 ts 错误
Browse files Browse the repository at this point in the history
  • Loading branch information
visiky committed Oct 18, 2021
1 parent dde22e1 commit 07b24cb
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/plots/bidirectional-bar/adaptor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,11 @@ function label(params: Params<BidirectionalBarOptions>): Params<BidirectionalBar
leftLabelCfg.style = deepAssign({}, leftLabelCfg.style, { textAlign: textAlignMap[textAlign] });
} else {
const positionMap = { top: 'bottom', bottom: 'top', middle: 'middle' };
cfg.position = positionMap[leftLabelCfg.position];
if (typeof cfg.position === 'string') {
cfg.position = positionMap[cfg.position];
} else if (typeof cfg.position === 'function') {
cfg.position = (...args) => positionMap[(cfg.position as Function).apply(this, args)];
}
// 设置 textBaseline 默认值
const textBaseline = leftLabelCfg.style?.textBaseline || 'bottom';
leftLabelCfg.style = deepAssign({}, leftLabelCfg.style, { textBaseline });
Expand Down

0 comments on commit 07b24cb

Please sign in to comment.