juijs-chart
Advanced tools
Comparing version 2.6.4 to 2.6.5
@@ -26,3 +26,3 @@ import jui from '../src/main.js' | ||
server: 120, | ||
client: 3 | ||
client: 0 | ||
}] | ||
@@ -29,0 +29,0 @@ }], |
{ | ||
"name": "juijs-chart", | ||
"version": "2.6.4", | ||
"version": "2.6.5", | ||
"sideEffects": false, | ||
@@ -5,0 +5,0 @@ "description": "SVG-based JUI chart that can be used in the browser and Node.js. Support many types of charts. (Dashboard, Map, Topology, Full 3D)", |
@@ -109,5 +109,7 @@ import jui from '../main.js'; | ||
const g = this.svg.group(); | ||
g.append(r); | ||
g.append(this.createTextElement(width, height, text)); | ||
if(value > 0) { | ||
g.append(r); | ||
g.append(this.createTextElement(width, height, text)); | ||
} | ||
if(this.svg.getTextSize(tooltip).width < width) | ||
@@ -167,2 +169,3 @@ g.append(this.createTooltipElement(width, tooltip)); | ||
this.eachData((data, i) => { | ||
const nonZeroKeys = keys.filter(k => data[k] > 0); | ||
const sumValues = keys.reduce((acc, cur) => data[acc] + data[cur]); | ||
@@ -172,3 +175,3 @@ let startX = 0; | ||
keys.forEach((key, j) => { | ||
nonZeroKeys.forEach((key, j) => { | ||
const width = this.axis.x.rate(data[key], sumValues); | ||
@@ -182,4 +185,4 @@ const percent = Math.round((data[key] / sumValues) * this.axis.x.max()); | ||
const r = this.createBarElement(i, j, width, height, | ||
j == 0 || keys.length == 1 ? style.borderRadius : 0, | ||
j == keys.length-1 || keys.length == 1 ? style.borderRadius : 0, | ||
j == 0 || nonZeroKeys.length == 1 ? style.borderRadius : 0, | ||
j == nonZeroKeys.length-1 || keys.length == 1 ? style.borderRadius : 0, | ||
text, tooltip); | ||
@@ -186,0 +189,0 @@ |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
4290813
96052