minor changes in Ox.Chart

This commit is contained in:
rlx 2012-04-24 10:18:39 +00:00
parent 4a210718ea
commit b4fd0f01ae

View file

@ -58,6 +58,8 @@ Ox.Chart = function(options, self) {
self.subData = {};
}
// fixme: a lot of the sorting is unneeded, since it happens in the list
self.sort = {};
self.totals = {};
Ox.forEach(self.options.data, function(value, key) {
@ -83,8 +85,8 @@ Ox.Chart = function(options, self) {
self.subKeys = Object.keys(self.subData).sort(function(a, b) {
var aValue = self.subData[a],
bValue = self.subData[b];
return a == '' ? 1
: b == '' ? -1
return a === '' ? 1
: b === '' ? -1
//: aValue < bValue ? 1
//: aValue > bValue ? -1
: self.sort[a] < self.sort[b] ? -1