Browse Source

bar 【显示0标注】无效问题修复

zhuth 6 years ago
parent
commit
05e499c9fc

+ 1 - 1
src/components/chartDesigner/sections/style/bar.jsx

@@ -176,7 +176,7 @@ class BarStyle extends React.Component {
                                                 formatterKey: checked,
                                                 formatter: !checked ? (params) => {
                                                     const { value } = params;
-                                                    return value === 0 ? '' : value;
+                                                    return Number(value) === 0 ? '' : value;
                                                 } : '{c}'
                                             } },
                                         });

+ 1 - 1
src/models/parseChartOption.js

@@ -129,7 +129,7 @@ function barOption(data, barConfig, themeConfig, styleConfig) {
                         rotate: (labelRotate === '' || labelRotate === null || labelRotate === undefined) ? 0 : Number(labelRotate),
                         formatter: !labelZeroVisible ? (params) => {
                             const { value } = params;
-                            return value === 0 ? '' : value;
+                            return Number(value) === 0 ? '' : value;
                         } : '{c}'
                     }
                 }