Skip to content

Commit

Permalink
Merge pull request #19898 from apache/fix/marker/label-formatter-call…
Browse files Browse the repository at this point in the history
…back-params

fix(marker): fix marker label formatter can't get series information
  • Loading branch information
Ovilia authored May 9, 2024
2 parents 2a2a6e4 + f12a3c7 commit 7e4c703
Show file tree
Hide file tree
Showing 2 changed files with 197 additions and 21 deletions.
20 changes: 18 additions & 2 deletions src/component/marker/MarkerModel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@ import {
AnimationOptionMixin,
Dictionary,
CommonTooltipOption,
ScaleDataValue
ScaleDataValue,
CallbackDataParams,
SeriesDataType
} from '../../util/types';
import Model from '../../model/Model';
import GlobalModel from '../../model/Global';
Expand Down Expand Up @@ -225,6 +227,20 @@ abstract class MarkerModel<Opts extends MarkerOption = MarkerOption> extends Com
this._data = data;
}

getDataParams(
dataIndex: number,
dataType?: SeriesDataType
): CallbackDataParams {
const params = DataFormatMixin.prototype.getDataParams.call(this, dataIndex, dataType);
const hostSeries = this.__hostSeries;
if (hostSeries) {
params.seriesId = hostSeries.id;
params.seriesName = hostSeries.name;
params.seriesType = hostSeries.subType;
}
return params;
}

/**
* Create slave marker model from series.
*/
Expand All @@ -246,4 +262,4 @@ abstract class MarkerModel<Opts extends MarkerOption = MarkerOption> extends Com
interface MarkerModel<Opts extends MarkerOption = MarkerOption> extends DataFormatMixin {}
zrUtil.mixin(MarkerModel, DataFormatMixin.prototype);

export default MarkerModel;
export default MarkerModel;
198 changes: 179 additions & 19 deletions test/markPoint.html

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

0 comments on commit 7e4c703

Please sign in to comment.