Pārlūkot izejas kodu

[notebook] Fix issue with bar chart label positioning

Enrico Berti 10 gadi atpakaļ
vecāks
revīzija
a6860d5

+ 1 - 1
desktop/core/src/desktop/static/desktop/js/nv.d3.growingDiscreteBarChart.js

@@ -65,7 +65,7 @@ nv.models.growingDiscreteBarChart = function() {
   //------------------------------------------------------------
 
   var showTooltip = function(e, offsetElement) {
-    var left = e.e.clientX,
+    var left = ($.browser.msie && $.browser.version.indexOf("9.") > -1) ? e.e.clientX : e.e.layerX,
         top = e.pos[1] + ( offsetElement.offsetTop || 0),
         x = xAxis.tickFormat()(discretebar.x()(e.point, e.pointIndex)),
         y = yAxis.tickFormat()(discretebar.y()(e.point, e.pointIndex)),

+ 1 - 1
desktop/core/src/desktop/static/desktop/js/nv.d3.lineWithBrushChart.js

@@ -303,7 +303,7 @@ nv.models.lineWithBrushChart = function() {
       }
 
       function disableBrush() {
-        g.selectAll('.nv-brush').attr('display', 'none');
+        if (g) g.selectAll('.nv-brush').attr('display', 'none');
       }
 
 

+ 1 - 1
desktop/core/src/desktop/static/desktop/js/nv.d3.multiBarWithBrushChart.js

@@ -94,7 +94,7 @@ nv.models.multiBarWithBrushChart = function() {
   //------------------------------------------------------------
 
   var showTooltip = function(e, offsetElement) {
-    var left = e.e.clientX,
+    var left = ($.browser.msie && $.browser.version.indexOf("9.") > -1) ? e.e.clientX : e.e.layerX,
         top = e.pos[1] + ( offsetElement.offsetTop || 0),
         x = xAxis.tickFormat()(multibar.x()(e.point, e.pointIndex)),
         y = yAxis.tickFormat()(multibar.y()(e.point, e.pointIndex)),

+ 2 - 2
desktop/core/src/desktop/static/desktop/js/nv.d3.scatter.js

@@ -213,8 +213,8 @@ nv.models.scatter = function() {
                 .attr('r', clipRadius);
             pointClips.exit().remove();
             pointClips
-                .attr('cx', function(d) { return d[0] })
-                .attr('cy', function(d) { return d[1] });
+                .attr('cx', function(d) { return isNaN(d[0]) ? 0 : d[0] })
+                .attr('cy', function(d) { return isNaN(d[1]) ? 0 : d[1] });
 
             wrap.select('.nv-point-paths')
                 .attr('clip-path', 'url(#nv-points-clip-' + id + ')');