dimple-js
Version:
Dimple is an object-oriented API allowing you to create flexible axis-based charts using [d3.js](http://d3js.org "d3.js").
15 lines (14 loc) • 693 B
JavaScript
// Copyright: 2015 AlignAlytics
// License: "https://github.com/PMSI-AlignAlytics/dimple/blob/master/MIT-LICENSE.txt"
// Source: /src/objects/legend/methods/_getFontSize.js
this._getFontSize = function () {
var fontSize;
if (!this.fontSize || this.fontSize.toString().toLowerCase() === "auto") {
fontSize = (this.chart._heightPixels() / 35 > 10 ? this.chart._heightPixels() / 35 : 10) + "px";
} else if (!isNaN(this.fontSize)) {
fontSize = this.fontSize + "px";
} else {
fontSize = this.fontSize;
}
return fontSize;
};