mirror of
https://github.com/chartjs/Chart.js.git
synced 2024-10-06 12:19:08 +02:00
Release 1.0.2
This commit is contained in:
parent
4b120ccbe9
commit
d2b73bdc5b
13
Chart.js
vendored
13
Chart.js
vendored
@ -44,6 +44,8 @@
|
||||
context.canvas.width = width;
|
||||
context.canvas.height = height;
|
||||
|
||||
var width = this.width = context.canvas.width;
|
||||
var height = this.height = context.canvas.height;
|
||||
this.aspectRatio = this.width / this.height;
|
||||
//High pixel density displays - multiply the size of the canvas height/width by the device pixel ratio, then scale.
|
||||
helpers.retinaScale(this);
|
||||
@ -842,7 +844,7 @@
|
||||
},
|
||||
stop : function(){
|
||||
// Stops any current animation loop occuring
|
||||
helpers.cancelAnimFrame.call(root, this.animationFrame);
|
||||
cancelAnimFrame(this.animationFrame);
|
||||
return this;
|
||||
},
|
||||
resize : function(callback){
|
||||
@ -1385,7 +1387,6 @@
|
||||
var halfHeight = this.height/2;
|
||||
|
||||
//Check to ensure the height will fit on the canvas
|
||||
//The three is to buffer form the very
|
||||
if (this.y - halfHeight < 0 ){
|
||||
this.y = halfHeight;
|
||||
} else if (this.y + halfHeight > this.chart.height){
|
||||
@ -1592,7 +1593,7 @@
|
||||
var isRotated = (this.xLabelRotation > 0),
|
||||
// innerWidth = (this.offsetGridLines) ? this.width - offsetLeft - this.padding : this.width - (offsetLeft + halfLabelWidth * 2) - this.padding,
|
||||
innerWidth = this.width - (this.xScalePaddingLeft + this.xScalePaddingRight),
|
||||
valueWidth = innerWidth/(this.valuesCount - ((this.offsetGridLines) ? 0 : 1)),
|
||||
valueWidth = innerWidth/Math.max((this.valuesCount - ((this.offsetGridLines) ? 0 : 1)), 1),
|
||||
valueOffset = (valueWidth * index) + this.xScalePaddingLeft;
|
||||
|
||||
if (this.offsetGridLines){
|
||||
@ -2433,12 +2434,12 @@
|
||||
}
|
||||
},
|
||||
calculateCircumference : function(value){
|
||||
return (Math.PI*2)*(value / this.total);
|
||||
return (Math.PI*2)*(Math.abs(value) / this.total);
|
||||
},
|
||||
calculateTotal : function(data){
|
||||
this.total = 0;
|
||||
helpers.each(data,function(segment){
|
||||
this.total += segment.value;
|
||||
this.total += Math.abs(segment.value);
|
||||
},this);
|
||||
},
|
||||
update : function(){
|
||||
@ -3078,6 +3079,8 @@
|
||||
helpers.each(this.segments,function(segment){
|
||||
segment.save();
|
||||
});
|
||||
|
||||
this.reflow();
|
||||
this.render();
|
||||
},
|
||||
reflow : function(){
|
||||
|
4
Chart.min.js
vendored
4
Chart.min.js
vendored
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue
Block a user