aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/nodes/DataVizBox/components/Histogram.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'src/client/views/nodes/DataVizBox/components/Histogram.tsx')
-rw-r--r--src/client/views/nodes/DataVizBox/components/Histogram.tsx6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/client/views/nodes/DataVizBox/components/Histogram.tsx b/src/client/views/nodes/DataVizBox/components/Histogram.tsx
index 092718e17..6591581f7 100644
--- a/src/client/views/nodes/DataVizBox/components/Histogram.tsx
+++ b/src/client/views/nodes/DataVizBox/components/Histogram.tsx
@@ -282,7 +282,7 @@ export class Histogram extends React.Component<HistogramProps> {
}
for (let i=0; i<data.length; i++){
let barData = histStringDataSet.filter(each => each[xAxisTitle]==data[i])
- barData[0][yAxisTitle] = barData[0][yAxisTitle] + 1;
+ barData[0][yAxisTitle] = Number(barData[0][yAxisTitle]) + 1;
}
}
histDataSet = histStringDataSet
@@ -340,7 +340,7 @@ export class Histogram extends React.Component<HistogramProps> {
xAxis = d3.axisBottom(x)
.ticks(numBins-1)
}
- const maxFrequency = this.numericalYData? d3.max(histDataSet, function(d) { return d[yAxisTitle]!.replace(/\$/g, '').replace(/\%/g, '').replace(/\</g, '')})
+ const maxFrequency = this.numericalYData? d3.max(histDataSet, function(d: any) { return d[yAxisTitle]!.replace(/\$/g, '').replace(/\%/g, '').replace(/\</g, '')})
: d3.max(bins, function(d) { return d.length; })
var y = d3.scaleLinear()
@@ -366,7 +366,7 @@ export class Histogram extends React.Component<HistogramProps> {
const updateHighlights = () => {
const hoverOverBar = this.hoverOverData;
const selectedData = this.selectedData;
- svg.selectAll('rect').attr("class", function(d) { return ((hoverOverBar && hoverOverBar[0]==d[0]) || selectedData && selectedData[0]==d[0])? 'histogram-bar hover' : 'histogram-bar'; })
+ svg.selectAll('rect').attr("class", function(d: any) { return ((hoverOverBar && hoverOverBar[0]==d[0]) || selectedData && selectedData[0]==d[0])? 'histogram-bar hover' : 'histogram-bar'; })
}
svg.on('click', onPointClick)