Index: lams_central/web/includes/javascript/chart.js =================================================================== diff -u -rd9bd1a0e26977326e557246c8440c8d13d2debc9 -rf0d5446b84ebc33056658c6971317ced40c46ce8 --- lams_central/web/includes/javascript/chart.js (.../chart.js) (revision d9bd1a0e26977326e557246c8440c8d13d2debc9) +++ lams_central/web/includes/javascript/chart.js (.../chart.js) (revision f0d5446b84ebc33056658c6971317ced40c46ce8) @@ -58,11 +58,15 @@ .attr('height', 15) .attr('fill', scaleColor(d.name)); // label + var val = Math.round(+d.value); + if (isNaN(val)) { + val = 0; + } legend.append('text') .attr('x', 20) .attr('y', index * 30 + 11) .attr('text-anchor', 'start') - .text(d.name + ' (' + Math.round(+d.value) + ' %)'); + .text(d.name + ' (' + val + ' %)'); }); } @@ -125,8 +129,8 @@ .attr('class', 'bar') .attr("x", function(d) {return scaleX(d.name)}) .attr("width", scaleX.bandwidth()) - .attr("y", function(d) {return y(d.value)}) - .attr("height", function(d){return height - y(d.value)}) + .attr("y", function(d) {return isNaN(d.value) ? 0 : y(d.value)}) + .attr("height", function(d){return height - (isNaN(d.value) ? height : y(d.value))}) .attr('fill', function(d) {return scaleColor(d.name)}) .on('mouseover', function(d) { if (tooltip) {