|
@ -40,6 +40,10 @@ GraphGroup.prototype.setItems = function(items) { |
|
|
if (this.options.sort == true) { |
|
|
if (this.options.sort == true) { |
|
|
this.itemsData.sort(function (a,b) {return a.x - b.x;}) |
|
|
this.itemsData.sort(function (a,b) {return a.x - b.x;}) |
|
|
} |
|
|
} |
|
|
|
|
|
// typecast all items to numbers. Takes around 10ms for 500.000 items
|
|
|
|
|
|
for (var i = 0; i < this.itemsData.length; i++) { |
|
|
|
|
|
this.itemsData[i].y = Number(this.itemsData[i].y); |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
else { |
|
|
else { |
|
|
this.itemsData = []; |
|
|
this.itemsData = []; |
|
|