You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by GitBox <gi...@apache.org> on 2022/08/08 23:17:42 UTC

[GitHub] [superset] diegomedina248 commented on a diff in pull request #21015: fix(charts): Hide Values greater than Max Y Axis Bound on Mixed Time Series with Bar series

diegomedina248 commented on code in PR #21015:
URL: https://github.com/apache/superset/pull/21015#discussion_r940741445


##########
superset-frontend/plugins/plugin-chart-echarts/src/utils/series.ts:
##########
@@ -313,3 +314,19 @@ export function getAxisType(dataType?: GenericDataType): AxisType {
   }
   return 'category';
 }
+
+export function getOverMaxHiddenFormatter(
+  config: {
+    max?: number;
+  } = {},
+) {
+  const { max } = config;
+  // Only apply this logic if there's a MAX set in the controls
+  const shouldHideIfOverMax = !!max || max === 0;
+
+  return new NumberFormatter({
+    formatFunc: value =>
+      `${shouldHideIfOverMax ? (value > max ? '' : value) : value}`,

Review Comment:
   `shouldHideIfOverMax && value > max ? '' : value`?



-- 
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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org