in src/TornadoChart.ts [363:401]
private static getTextData(
text: string,
textOptions: TornadoChartTextOptions,
measureWidth: boolean = false,
measureHeight: boolean = false,
overrideFontSize?: number): TextData {
let width: number = 0,
height: number = 0,
fontSize: string,
textProperties: TextProperties;
text = text || "";
fontSize = overrideFontSize
? PixelConverter.fromPoint(overrideFontSize)
: PixelConverter.fromPoint(textOptions.fontSize);
textProperties = {
text: text,
fontFamily: textOptions.fontFamily,
fontSize: fontSize
};
if (measureWidth) {
width = textMeasurementService.measureSvgTextWidth(textProperties);
}
if (measureHeight) {
height = textMeasurementService.estimateSvgTextHeight(textProperties);
}
return {
text: text,
width: width,
height: height,
textProperties: textProperties
};
}