Built output

This commit is contained in:
Nick Downie 2014-07-08 23:13:29 +01:00
parent aa7975e4f7
commit 529d582f03
2 changed files with 109 additions and 108 deletions

31
Chart.js vendored
View File

@ -873,7 +873,7 @@
yMin;
helpers.each(this.datasets, function(dataset){
dataCollection = dataset.points || dataset.bars || dataset.segments;
if (dataCollection[dataIndex]){
if (dataCollection[dataIndex] && dataCollection[dataIndex].hasValue()){
Elements.push(dataCollection[dataIndex]);
}
});
@ -1037,6 +1037,9 @@
x : this.x,
y : this.y
};
},
hasValue: function(){
return isNumber(this.value);
}
});
@ -1993,7 +1996,6 @@
this.datasets.push(datasetObject);
helpers.each(dataset.data,function(dataPoint,index){
if (helpers.isNumber(dataPoint)){
//Add a new point for each piece of data, passing any required data to draw.
datasetObject.bars.push(new this.BarClass({
value : dataPoint,
@ -2004,7 +2006,6 @@
highlightFill : dataset.highlightFill || dataset.fillColor,
highlightStroke : dataset.highlightStroke || dataset.strokeColor
}));
}
},this);
},this);
@ -2119,7 +2120,6 @@
addData : function(valuesArray,label){
//Map the values array for each of the datasets
helpers.each(valuesArray,function(value,datasetIndex){
if (helpers.isNumber(value)){
//Add a new point for each piece of data, passing any required data to draw.
this.datasets[datasetIndex].bars.push(new this.BarClass({
value : value,
@ -2131,7 +2131,6 @@
strokeColor : this.datasets[datasetIndex].strokeColor,
fillColor : this.datasets[datasetIndex].fillColor
}));
}
},this);
this.scale.addXLabel(label);
@ -2168,6 +2167,7 @@
//Draw all the bars for each dataset
helpers.each(this.datasets,function(dataset,datasetIndex){
helpers.each(dataset.bars,function(bar,index){
if (bar.hasValue()){
bar.base = this.scale.endPoint;
//Transition then draw
bar.transition({
@ -2175,6 +2175,7 @@
y : this.scale.calculateY(bar.value),
width : this.scale.calculateBarWidth(this.datasets.length)
}, easingDecimal).draw();
}
},this);
},this);
@ -2467,8 +2468,6 @@
helpers.each(dataset.data,function(dataPoint,index){
//Best way to do this? or in draw sequence...?
if (helpers.isNumber(dataPoint)){
//Add a new point for each piece of data, passing any required data to draw.
datasetObject.points.push(new this.PointClass({
value : dataPoint,
@ -2479,7 +2478,6 @@
highlightFill : dataset.pointHighlightFill || dataset.pointColor,
highlightStroke : dataset.pointHighlightStroke || dataset.pointStrokeColor
}));
}
},this);
this.buildScale(data.labels);
@ -2586,7 +2584,6 @@
//Map the values array for each of the datasets
helpers.each(valuesArray,function(value,datasetIndex){
if (helpers.isNumber(value)){
//Add a new point for each piece of data, passing any required data to draw.
this.datasets[datasetIndex].points.push(new this.PointClass({
value : value,
@ -2596,7 +2593,6 @@
strokeColor : this.datasets[datasetIndex].pointStrokeColor,
fillColor : this.datasets[datasetIndex].pointColor
}));
}
},this);
this.scale.addXLabel(label);
@ -2633,10 +2629,12 @@
//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 (point.hasValue()){
point.transition({
y : this.scale.calculateY(point.value),
x : this.scale.calculateX(index)
}, easingDecimal);
}
},this);
@ -2665,6 +2663,7 @@
ctx.strokeStyle = dataset.strokeColor;
ctx.beginPath();
helpers.each(dataset.points,function(point,index){
if (point.hasValue()){
if (index>0){
if(this.options.bezierCurve){
ctx.bezierCurveTo(
@ -2684,6 +2683,7 @@
else{
ctx.moveTo(point.x,point.y);
}
}
},this);
ctx.stroke();
@ -2701,7 +2701,9 @@
//A little inefficient double looping, but better than the line
//lagging behind the point positions
helpers.each(dataset.points,function(point){
if (point.hasValue()){
point.draw();
}
});
},this);
@ -3071,8 +3073,6 @@
this.datasets.push(datasetObject);
helpers.each(dataset.data,function(dataPoint,index){
//Best way to do this? or in draw sequence...?
if (helpers.isNumber(dataPoint)){
//Add a new point for each piece of data, passing any required data to draw.
var pointPosition;
if (!this.scale.animation){
@ -3089,7 +3089,6 @@
highlightFill : dataset.pointHighlightFill || dataset.pointColor,
highlightStroke : dataset.pointHighlightStroke || dataset.pointStrokeColor
}));
}
},this);
},this);
@ -3204,7 +3203,6 @@
//Map the values array for each of the datasets
this.scale.valuesCount++;
helpers.each(valuesArray,function(value,datasetIndex){
if (helpers.isNumber(value)){
var pointPosition = this.scale.getPointPosition(this.scale.valuesCount, this.scale.calculateCenterOffset(value));
this.datasets[datasetIndex].points.push(new this.PointClass({
value : value,
@ -3214,7 +3212,6 @@
strokeColor : this.datasets[datasetIndex].pointStrokeColor,
fillColor : this.datasets[datasetIndex].pointColor
}));
}
},this);
this.scale.labels.push(label);
@ -3261,7 +3258,9 @@
//Transition each point first so that the line and point drawing isn't out of sync
helpers.each(dataset.points,function(point,index){
if (point.hasValue()){
point.transition(this.scale.getPointPosition(index, this.scale.calculateCenterOffset(point.value)), easeDecimal);
}
},this);
@ -3288,7 +3287,9 @@
//A little inefficient double looping, but better than the line
//lagging behind the point positions
helpers.each(dataset.points,function(point){
if (point.hasValue()){
point.draw();
}
});
},this);

4
Chart.min.js vendored

File diff suppressed because one or more lines are too long