From 619f498dae7532b972c4d665c3bc648df04fa107 Mon Sep 17 00:00:00 2001 From: rlx <0x0073@0x2620.org> Date: Wed, 24 Oct 2012 12:31:32 +0000 Subject: [PATCH] Ox.Chart: make sure bars are at least 1px wide --- source/Ox.UI/js/List/Chart.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/Ox.UI/js/List/Chart.js b/source/Ox.UI/js/List/Chart.js index 053e6a13..632d3631 100644 --- a/source/Ox.UI/js/List/Chart.js +++ b/source/Ox.UI/js/List/Chart.js @@ -152,7 +152,7 @@ Ox.Chart = function(options, self) { function getWidths(values) { var max, maxKeys, total = Ox.sum(values), - totalWidth = Math.round(total / self.max * self.valueWidth), + totalWidth = Math.ceil(total / self.max * self.valueWidth), widths = {}; Ox.forEach(values, function(value, key) { widths[key] = Math.round(value / total * totalWidth); @@ -202,7 +202,7 @@ Ox.Chart = function(options, self) { + ' (' + Ox.formatPercent(value * self.options.rows, self.sum, 2) + ')' }) .css({ - width: Math.round(value / self.max * self.valueWidth) + 'px', + width: Math.ceil(value / self.max * self.valueWidth) + 'px', height: '14px', borderRadius: '4px', marginLeft: '-4px'