konzen commented on code in PR #21739:
URL: https://github.com/apache/echarts/pull/21739#discussion_r3807420139


##########
src/component/tooltip/seriesFormatTooltip.ts:
##########
@@ -142,14 +149,23 @@ function formatTooltipArrayValue(
                 markerColor: colorStr,
                 name: dimInfo.displayName,
                 value: val,
-                valueType: dimInfo.type
+                valueType: dimInfo.type,
+                timeZone: getDimensionTimeZone(series, dimInfo)
             }));
         }
         else {
             inlineValues.push(val);
             inlineValueTypes.push(dimInfo.type);
+            inlineTimeZones.push(getDimensionTimeZone(series, dimInfo));
         }
     }
 
-    return { inlineValues, inlineValueTypes, blocks };
+    return { inlineValues, inlineValueTypes, inlineTimeZones, blocks };
+}
+
+function getDimensionTimeZone(series: SeriesModel, dimInfo: {coordDim?: 
string}): string {
+    const axis = series.coordinateSystem?.getAxis?.(dimInfo.coordDim);
+    return axis && isTimeScale(axis.scale)
+        ? axis.scale.getTimeZone()
+        : series.ecModel.getTimeZone();
 }

Review Comment:
   Fixed in 438a10760. getAxis is now called only when coordDim is defined; 
otherwise the tooltip falls back to the global time zone. A unit test also 
verifies that getAxis(undefined) is not called.



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to