msyavuz commented on code in PR #36989:
URL: https://github.com/apache/superset/pull/36989#discussion_r2676816412


##########
superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/transformProps.ts:
##########
@@ -479,6 +480,39 @@ export default function transformProps(
     yAxisMin = calculateLowerLogTick(minPositiveValue);
   }
 
+  // For horizontal bar charts, calculate max from data to avoid cutting off 
labels
+  if (
+    isHorizontal &&
+    seriesType === EchartsTimeseriesSeriesType.Bar &&
+    truncateYAxis
+  ) {
+    let dataMax: number | undefined;
+    let dataMin: number | undefined;
+    rawSeries.forEach(s => {
+      if (s.data && Array.isArray(s.data)) {
+        (s.data as [number, any][]).forEach((datum: [number, any]) => {
+          const value = datum[0];

Review Comment:
   We already have this loop in the file, can we use that?



-- 
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