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

feat(radar): Radar series tooltip support dimensionIndex #20677

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
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
1 change: 1 addition & 0 deletions src/component/tooltip/TooltipView.ts
Original file line number Diff line number Diff line change
Expand Up @@ -681,6 +681,7 @@ class TooltipView extends ComponentView {
params.marker = markupStyleCreator.makeTooltipMarker(
'item', convertToColorString(params.color), renderMode
);
params.dimensionIndex = dispatcher.__dimIdx;

const seriesTooltipResult = normalizeTooltipFormatResult(
dataModel.formatTooltip(dataIndex, false, dataType)
Expand Down
6 changes: 4 additions & 2 deletions src/core/echarts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1067,14 +1067,15 @@ class ECharts extends Eventful<ECEventDefinition> {
const handler = (e: ElementEvent) => {
const ecModel = this.getModel();
const el = e.target;
let dispatcher: ECElement | undefined;
let params: ECElementEvent;
const isGlobalOut = eveName === 'globalout';
// no e.target when 'globalout'.
if (isGlobalOut) {
params = {} as ECElementEvent;
}
else {
el && findEventDispatcher(el, (parent) => {
else if (el) {
dispatcher = findEventDispatcher(el, (parent) => {
const ecData = getECData(parent);
if (ecData && ecData.dataIndex != null) {
const dataModel = ecData.dataModel || ecModel.getSeriesByIndex(ecData.seriesIndex);
Expand Down Expand Up @@ -1131,6 +1132,7 @@ class ECharts extends Eventful<ECEventDefinition> {

params.event = e;
params.type = eveName;
params.dimensionIndex = dispatcher ? dispatcher.__dimIdx : undefined;
AielloChan marked this conversation as resolved.
Show resolved Hide resolved

(this._$eventProcessor as ECEventProcessor).eventInfo = {
targetEl: el,
Expand Down
5 changes: 5 additions & 0 deletions src/util/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,11 @@ export interface ECElement extends Element {
* Force disable morphing
*/
disableMorphing?: boolean

/**
* From RadarSymbol
*/
__dimIdx?: number;
}

export interface DataHost {
Expand Down