Skip to content

Instantly share code, notes, and snippets.

@Hexagon
Created October 14, 2014 20:58
Show Gist options
  • Save Hexagon/87b5357a91e7e7ef3487 to your computer and use it in GitHub Desktop.
Save Hexagon/87b5357a91e7e7ef3487 to your computer and use it in GitHub Desktop.
// Measure space usage on axises, we need to do this before drawing anything
i = 0;
while ((dataset = this.datasets[i++])) {
axises = [[this.yAxises[dataset.y.axis],1,2],[this.xAxises[dataset.x.axis],3,0]];
for (j = 0; j < axises.length; j++) {
axis = axises[j];
if (!axis[0]._measured) {
temp = parseInt(axis[0].font.split(' ')[0]);
padding[axis[(axis[0].axis % 2) ? 1 : 2]] += margin + (axis[0].scale?axis[0].majorTickHeight:0) + (axis[0].name?temp:0) + (axis[0].labels?temp:0);
axis[0]._measured=true;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment