allow decimal values to be shown on the peak graph (#1574)

This commit is contained in:
Lloyd Pick 2016-07-01 19:47:09 +01:00 committed by Andrew Cantino
parent 8aef73e253
commit c3e263d3a4
2 changed files with 6 additions and 6 deletions

View file

@ -1,7 +1,7 @@
.show-view.peak-detector-agent,
.show-view.twitter-stream-agent {
.rickshaw_annotation_timeline {
left: 40px;
left: 60px;
width: 700px;
}
@ -28,7 +28,7 @@
.chart {
position: relative;
left: 40px;
left: 60px;
overflow: hidden;
width: 700px;
}
@ -60,8 +60,8 @@
position: absolute;
top: 0;
bottom: 0;
width: 40px;
width: 60px;
}
}
}
}
}

View file

@ -17,7 +17,7 @@
<script>
$(function() {
var $chart = $(".chart-container.group-<%= index.to_s %>").last();
var data = <%= Utils.jsonify(data.map {|count, time| { :x => time.to_i, :y => count.to_i } }) %>;
var data = <%= Utils.jsonify(data.select {|c, _t| !c.nil? }.map {|count, time| { :x => time.to_i, :y => count.to_f } }) %>;
var peaks = <%= Utils.jsonify((@agent.memory[:peaks] && @agent.memory[:peaks][group_name]) || []) %>;
var name = <%= Utils.jsonify(group_name) %>;
@ -30,4 +30,4 @@
<p>
No data has been received.
</p>
<% end %>
<% end %>