diff --git a/xdataweb/web/apps/VegaLab/examples/histogram/histogram.js b/xdataweb/web/apps/VegaLab/examples/histogram/histogram.js
index <HASH>..<HASH> 100644
--- a/xdataweb/web/apps/VegaLab/examples/histogram/histogram.js
+++ b/xdataweb/web/apps/VegaLab/examples/histogram/histogram.js
@@ -107,7 +107,7 @@ function(vis){
                 completed++;
                 if(completed === bins){
                     for(var i=0; i<vis.bins; i++){
-                        vis.dataset.values[i].value = vis.dataset.values[i].count / vis.count;
+                        vis.dataset.values[i].value = vis.dataset.values[i].count / (vis.count === 0 ? 1 : vis.count);
                     }
 
                     if(callback !== undefined){
Added check to avoid division by zero.