Skip to content
Open
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
19 changes: 19 additions & 0 deletions src/chart/radar/RadarSeries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,10 @@ export interface RadarSeriesOption

data?: (RadarSeriesDataItemOption | RadarSeriesDataValue)[]
}
export interface RadarCallbackDataParams extends CallbackDataParams {
indicatorIndex: number,
indicatorName:string
}

class RadarSeriesModel extends SeriesModel<RadarSeriesOption> {

Expand Down Expand Up @@ -102,6 +106,21 @@ class RadarSeriesModel extends SeriesModel<RadarSeriesOption> {
});
}

/**
* @overwrite
*/
getDataParams(dataIndex: number, dataType: any, el?: Element): RadarCallbackDataParams {
const params = super.getDataParams(dataIndex) as RadarCallbackDataParams;
// indicatorIndex && indicatorName
const indicatorIndex = (el && (el as any).__dimIdx) !== undefined ? (el as any).__dimIdx : null;
if (indicatorIndex != null) {
const indicatorAxis = this.coordinateSystem.getIndicatorAxes()[indicatorIndex];
params.indicatorIndex = indicatorIndex;
params.indicatorName = indicatorAxis.name;
}
return params;
}

formatTooltip(
dataIndex: number,
multipleSeries?: boolean,
Expand Down
4 changes: 2 additions & 2 deletions src/component/tooltip/TooltipView.ts
Original file line number Diff line number Diff line change
Expand Up @@ -673,8 +673,8 @@ class TooltipView extends ComponentView {
if (tooltipTrigger != null && tooltipTrigger !== 'item') {
return;
}

const params = dataModel.getDataParams(dataIndex, dataType);
const el = e.target;
const params = dataModel.getDataParams(dataIndex, dataType, el);
const markupStyleCreator = new TooltipMarkupStyleCreator();
// Pre-create marker style for makers. Users can assemble richText
// text in `formatter` callback and use those markers style.
Expand Down
129 changes: 129 additions & 0 deletions test/radar-axis-indicatorIndex.html

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