Skip to content

Commit

Permalink
fix: fix bug of format in waterfall totalLabel
Browse files Browse the repository at this point in the history
  • Loading branch information
xuefei1313 committed Apr 28, 2024
1 parent 3126478 commit a8fe5f9
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion packages/vchart/src/component/label/total-label.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ export class TotalLabel extends BaseLabelComponent {
);

const series = this._getSeries();
series.setTotalLabelStyle?.(this._textMark);
series.initTotalLabelMarkStyle?.(this._textMark);
}

protected _initLabelComponent() {
Expand Down
1 change: 0 additions & 1 deletion packages/vchart/src/series/interface/series.ts
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,6 @@ export interface ISeries extends IModel {
initLabelMarkStyle?: (labelMark: ILabelMark) => void;
/** 设置总计标签配置 */
initTotalLabelMarkStyle?: (labelMark: ILabelMark) => void;
setTotalLabelStyle?: (labelMark: ILabelMark) => void;
getTotalLabelComponentStyle?: (info: Pick<ILabelInfo, 'baseMark' | 'labelMark'>) => any;

getGroupFields: () => string[];
Expand Down
2 changes: 1 addition & 1 deletion packages/vchart/src/series/waterfall/waterfall.ts
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ export class WaterfallSeries<T extends IWaterfallSeriesSpec = IWaterfallSeriesSp
// 首先执行这里的 mark.style
// 然后执行用户的 formatMethod
// 最后执行下方的 getTotalLabelComponentStyle 。如果在下方实现值函数,就会导致用户format无法生效
setTotalLabelStyle(labelMark: ILabelMark) {
initTotalLabelMarkStyle(labelMark: ILabelMark) {
this.setMarkStyle(labelMark, {
text: (datum: Datum) => {
if (!('end' in datum)) {
Expand Down

0 comments on commit a8fe5f9

Please sign in to comment.