You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@echarts.apache.org by "Ovilia (via GitHub)" <gi...@apache.org> on 2025/06/12 09:00:25 UTC
Re: [PR] Feature - Radar Chart - Need to show custom tooltip only for actual index [echarts]
Ovilia commented on code in PR #20938:
URL: https://github.com/apache/echarts/pull/20938#discussion_r2142052578
##########
src/chart/radar/RadarSeries.ts:
##########
@@ -71,6 +72,10 @@ export interface RadarSeriesOption
data?: (RadarSeriesDataItemOption | RadarSeriesDataValue)[]
}
+export interface RadarCallbackDataParams extends CallbackDataParams {
+ indicatorIndex: number,
+ indicatorAxes: Array<IndicatorAxis>
Review Comment:
We should not expose indicatorAxes. Try to expose attributes like `indicatorName` instead. You may not return the indicatorAxis array, instead, only return the indicator of interest. If users need to get the names of all indicators, they should save the variable of names of each indicators, just as in other cases of ECharts.
##########
src/chart/radar/RadarSeries.ts:
##########
@@ -102,6 +107,17 @@ class RadarSeriesModel extends SeriesModel<RadarSeriesOption> {
});
}
+ /**
+ * @overwrite
+ */
+ getDataParams(dataIndex: number, dataType: any, el?: Element): RadarCallbackDataParams {
+ const params = super.getDataParams(dataIndex) as RadarCallbackDataParams;
+ // indicatorIndex && indicatorAxes
+ params.indicatorIndex = (el && (el as any).__dimIdx) ?? null;
Review Comment:
Avoid using `??`.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org