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/02/25 15:22:25 UTC

[GitHub] [superset] kgabryje commented on a change in pull request #18947: fix(chartviz): make to allow the custome of x & y axis title margin i…

kgabryje commented on a change in pull request #18947:
URL: https://github.com/apache/superset/pull/18947#discussion_r814857591



##########
File path: superset-frontend/src/chart/Chart.jsx
##########
@@ -256,6 +256,13 @@ class Chart extends React.PureComponent {
 
     const isLoading = chartStatus === 'loading';
     const isFaded = refreshOverlayVisible && !errorMessage;
+    // redefine the formData because the x & y axis title margin of formData is string type in case of custom value. And so these should be always number.
+    /* eslint radix: ["error", "as-needed"] */
+    const formData = {
+      ...this.props.formData,
+      x_axis_title_margin: parseInt(this.props.formData.x_axis_title_margin),

Review comment:
       I think Chart.jsx shouldn't be aware of such plugin specific controls. I'd suggest parsing those values in `plugins/plugin-chart-echarts/src/Timeseries/transformProps.ts` (and wherever else they're used, I think Echarts Boxplot and MixedTimeseries).
   You could create a helper function in `plugins/plugin-chart-echarts/src/utils` that would return a parsed number or 0 if NaN




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