mirror of
https://github.com/chartjs/Chart.js.git
synced 2025-12-08 20:36:08 +00:00
Target src files from #142
This commit is contained in:
parent
5d8df20b0d
commit
de564326b0
@ -25,6 +25,25 @@
|
||||
this.ctx = context;
|
||||
|
||||
//Variables global to the chart
|
||||
var computeDimension = function(element,dimension)
|
||||
{
|
||||
if (element['offset'+dimension])
|
||||
{
|
||||
return element['offset'+dimension];
|
||||
}
|
||||
else
|
||||
{
|
||||
return document.defaultView.getComputedStyle(element).getPropertyValue(dimension);
|
||||
}
|
||||
}
|
||||
|
||||
var width = this.width = computeDimension(context.canvas,'Width');
|
||||
var height = this.height = computeDimension(context.canvas,'Height');
|
||||
|
||||
// Firefox requires this to work correctly
|
||||
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;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user