//Draw all the bars for each dataset
helpers.each(this.datasets,function(dataset,datasetIndex){
helpers.each(dataset.bars,function(bar,index){
- if (helpers.isNumber(bar.value)){
+ if (bar.hasValue()){
bar.base = this.scale.endPoint;
//Transition then draw
bar.transition({
yMin;
helpers.each(this.datasets, function(dataset){
dataCollection = dataset.points || dataset.bars || dataset.segments;
- if (dataCollection[dataIndex] && helpers.isNumber(dataCollection[dataIndex].value)){
+ if (dataCollection[dataIndex] && dataCollection[dataIndex].hasValue()){
Elements.push(dataCollection[dataIndex]);
}
});
x : this.x,
y : this.y
};
+ },
+ hasValue: function(){
+ return isNumber(this.value);
}
});
//We can use this extra loop to calculate the control points of this dataset also in this loop
helpers.each(dataset.points,function(point,index){
- if (helpers.isNumber(point.value)){
+ if (point.hasValue()){
point.transition({
y : this.scale.calculateY(point.value),
x : this.scale.calculateX(index)
ctx.strokeStyle = dataset.strokeColor;
ctx.beginPath();
helpers.each(dataset.points,function(point,index){
- if (helpers.isNumber(point.value)){
+ if (point.hasValue()){
if (index>0){
if(this.options.bezierCurve){
ctx.bezierCurveTo(
//A little inefficient double looping, but better than the line
//lagging behind the point positions
helpers.each(dataset.points,function(point){
- if (helpers.isNumber(point.value)){
+ if (point.hasValue()){
point.draw();
}
});