diff --git a/src/pages/studyView/charts/scatterPlot/StudyViewDensityScatterPlot.tsx b/src/pages/studyView/charts/scatterPlot/StudyViewDensityScatterPlot.tsx index b502ff26c77..66a9e12ac95 100644 --- a/src/pages/studyView/charts/scatterPlot/StudyViewDensityScatterPlot.tsx +++ b/src/pages/studyView/charts/scatterPlot/StudyViewDensityScatterPlot.tsx @@ -493,6 +493,14 @@ export default class StudyViewDensityScatterPlot , ]; let correlationLabels; + + const pearson = _.isNumber(this.props.pearsonCorr) + ? this.props.pearsonCorr.toFixed(4) + : this.props.pearsonCorr; + const spearman = _.isNumber(this.props.spearmanCorr) + ? this.props.spearmanCorr.toFixed(4) + : this.props.spearmanCorr; + if (this.numSamples > 2) { // otherwise p-values are null @@ -512,7 +520,7 @@ export default class StudyViewDensityScatterPlot y={rectY + rectHeight + 55} dy={'-0.3em'} > - {this.props.pearsonCorr.toFixed(4)} + {pearson} , - {this.props.spearmanCorr.toFixed(4)} + {spearman} ,