Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(marker): fix marker label formatter can't get series information #19898

Merged
merged 1 commit into from
May 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@
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 @@
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 @@ -243,7 +259,7 @@
}
}

interface MarkerModel<Opts extends MarkerOption = MarkerOption> extends DataFormatMixin {}

Check warning on line 262 in src/component/marker/MarkerModel.ts

View workflow job for this annotation

GitHub Actions / lint (18.x)

'Opts' is defined but never used
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.