canvas-pie-chart
Advanced tools
Comparing version
@@ -5,2 +5,3 @@ "use strict"; | ||
const canvas_1 = require("canvas"); | ||
canvas_1.registerFont("./src/Raleway.ttf", { family: "Raleway" }); | ||
class PieChart { | ||
@@ -48,3 +49,3 @@ constructor(options) { | ||
const oldLength = label.length; | ||
const font = `bold ${Math.floor(this._WIDTH / 30)}px sans-serif`; | ||
const font = `bold ${Math.floor(this._WIDTH / 30)}px Raleway`; | ||
this._CTX.font = font; | ||
@@ -51,0 +52,0 @@ let fontWidth = this._CTX.measureText(label).width; |
{ | ||
"name": "canvas-pie-chart", | ||
"version": "1.0.2", | ||
"version": "1.0.3", | ||
"description": "Canvas based pie chart generator.", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
@@ -1,2 +0,3 @@ | ||
import { createCanvas, Canvas, CanvasRenderingContext2D } from "canvas"; | ||
import { createCanvas, Canvas, CanvasRenderingContext2D, registerFont } from "canvas"; | ||
registerFont("./src/Raleway.ttf", { family: "Raleway"}); | ||
@@ -66,3 +67,3 @@ export class PieChart { | ||
const oldLength = label.length; | ||
const font = `bold ${Math.floor(this._WIDTH / 30)}px sans-serif`; | ||
const font = `bold ${Math.floor(this._WIDTH / 30)}px Raleway`; | ||
this._CTX.font = font; | ||
@@ -69,0 +70,0 @@ let fontWidth = this._CTX.measureText(label).width; |
321933
2565.23%11
10%193
1.05%