diff --git a/app/assets/javascripts/visualizations/highvis/histogram.coffee b/app/assets/javascripts/visualizations/highvis/histogram.coffee index 6e629eef9..88a395a6d 100644 --- a/app/assets/javascripts/visualizations/highvis/histogram.coffee +++ b/app/assets/javascripts/visualizations/highvis/histogram.coffee @@ -60,15 +60,27 @@ $ -> text: '' tooltip: formatter: -> - str = "" + xField = @series.xAxis.options.title.text idx = data.fields.map((x) -> fieldTitle(x)).indexOf(xField) - str += "" - str += "" - str += "" - if @y isnt 0 - str += "" - str += "" + str = "
" + str += "Bin #{@x}
" + str += "Contains #{@total} Items
" + str += "Within the Range #{@x - document.getElementById("bin-size").value / 2}" + str += "- #{@x + document.getElementById("bin-size").value / 2}

" + str += "
#{xField}: #{@point.realValue}
Bin:#{@x}
# Occurrences:#{@total}
#{@series.name}:
#{@y}
" + str += "" + str += "" + if @y > 0 + if @y is 1 + # Print specific value + str += "" + else + # Print amount in bin + str += "" + str += "" str += "
Group : #{@series.name}
#{xField} : " + str += if (@point.realValue == undefined) then "1 in this Bin" else "#{@point.realValue}" + str += "
Data Points : #{@y} in this Bin
" useHTML: true plotOptions: