浏览代码

HUE-2300 [search] Fix multibar JS error

Enrico Berti 11 年之前
父节点
当前提交
59d2cb022b
共有 2 个文件被更改,包括 2 次插入2 次删除
  1. 1 1
      desktop/core/static/js/nv.d3.growingMultiBar.js
  2. 1 1
      desktop/core/static/js/nv.d3.legend.js

+ 1 - 1
desktop/core/static/js/nv.d3.growingMultiBar.js

@@ -169,7 +169,7 @@ nv.models.growingMultiBar = function() {
         .append('rect');
       wrap.select('#nv-edge-clip-' + id + ' rect')
           .attr('width', availableWidth)
-          .attr('height', availableHeight);
+          .attr('height', nv.utils.NaNtoZero(availableHeight) >= 0 ? nv.utils.NaNtoZero(availableHeight) : 0);
 
       g   .attr('clip-path', clipEdge ? 'url(#nv-edge-clip-' + id + ')' : '');
 

+ 1 - 1
desktop/core/static/js/nv.d3.legend.js

@@ -186,7 +186,7 @@ nv.models.legend = function() {
 
         //position legend as far right as possible within the total width
         if (rightAlign) {
-           g.attr('transform', 'translate(' + (width - margin.right - legendWidth) + ',' + margin.top + ')');
+           g.attr('transform', 'translate(' + nv.utils.NaNtoZero(width - margin.right - legendWidth) + ',' + margin.top + ')');
         }
         else {
            g.attr('transform', 'translate(0' + ',' + margin.top + ')');