Commits

Simon Cross committed 20aa0fe

Remove old labels.

  • Participants
  • Parent commits 0fc3ed0

Comments (0)

Files changed (1)

File lib/stats.js

             ];
         },
         update_plot: function(plot) {
+            d3.selectAll(".fire-plot-text").remove();
+
             var svg = plot.svg;
             var chart = plot.chart;
             var series = chart.series[0];
                 var shape = d3.select(this);
                 var content = d.aggField[0];
 
-                var height = shape.attr("height");
-                var width = shape.attr("width");
+                var height = parseFloat(shape.attr("height"));
+                var width = parseFloat(shape.attr("width"));
 
                 svg.append("text")
+                    .attr("class", "fire-plot-text")
                     // position centre
                     .attr("x", parseFloat(shape.attr("x")) + width * 1.1)
-                    .attr("y", parseFloat(shape.attr("y")) - height - 10)
+                    .attr("y", parseFloat(shape.attr("y")) + height - 10)
                     // centre align
                     .style("text-anchor", "left")
                     .style("font-size", "1.5em")