Commit aa53c10 1 parent 96a63bc commit aa53c10 Copy full SHA for aa53c10
File tree 1 file changed +4
-2
lines changed
superset-frontend/plugins/plugin-chart-echarts/src/BigNumber/BigNumberWithTrendline
1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -125,8 +125,10 @@ export default function transformProps(
125
125
if ( compareIndex < sortedData . length ) {
126
126
const compareValue = sortedData [ compareIndex ] [ 1 ] ;
127
127
// compare values must both be non-nulls
128
- if ( bigNumber !== null && compareValue !== null && compareValue !== 0 ) {
129
- percentChange = ( bigNumber - compareValue ) / Math . abs ( compareValue ) ;
128
+ if ( bigNumber !== null && compareValue !== null ) {
129
+ percentChange = compareValue
130
+ ? ( bigNumber - compareValue ) / Math . abs ( compareValue )
131
+ : 0 ;
130
132
formattedSubheader = `${ formatPercentChange (
131
133
percentChange ,
132
134
) } ${ compareSuffix } `;
You can’t perform that action at this time.
0 commit comments