Ox.Chart: make sure bars are at least 1px wide
This commit is contained in:
parent
cc4b2824e0
commit
619f498dae
1 changed files with 2 additions and 2 deletions
4
source/Ox.UI/js/List/Chart.js
vendored
4
source/Ox.UI/js/List/Chart.js
vendored
|
@ -152,7 +152,7 @@ Ox.Chart = function(options, self) {
|
||||||
function getWidths(values) {
|
function getWidths(values) {
|
||||||
var max, maxKeys,
|
var max, maxKeys,
|
||||||
total = Ox.sum(values),
|
total = Ox.sum(values),
|
||||||
totalWidth = Math.round(total / self.max * self.valueWidth),
|
totalWidth = Math.ceil(total / self.max * self.valueWidth),
|
||||||
widths = {};
|
widths = {};
|
||||||
Ox.forEach(values, function(value, key) {
|
Ox.forEach(values, function(value, key) {
|
||||||
widths[key] = Math.round(value / total * totalWidth);
|
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) + ')'
|
+ ' (' + Ox.formatPercent(value * self.options.rows, self.sum, 2) + ')'
|
||||||
})
|
})
|
||||||
.css({
|
.css({
|
||||||
width: Math.round(value / self.max * self.valueWidth) + 'px',
|
width: Math.ceil(value / self.max * self.valueWidth) + 'px',
|
||||||
height: '14px',
|
height: '14px',
|
||||||
borderRadius: '4px',
|
borderRadius: '4px',
|
||||||
marginLeft: '-4px'
|
marginLeft: '-4px'
|
||||||
|
|
Loading…
Reference in a new issue