Skip to content

Commit

Permalink
fix call
Browse files Browse the repository at this point in the history
  • Loading branch information
kirovilya committed Feb 7, 2021
1 parent 4bbb365 commit 9119eb1
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
const utils = require("@iobroker/adapter-core");

// Load your modules here, e.g.:
const { CanvasRenderService } = require('chartjs-node-canvas');
const { ChartJSNodeCanvas } = require('chartjs-node-canvas');
const fs = require('fs');
const safeJsonStringify = require('./lib/json');

Expand Down Expand Up @@ -106,10 +106,10 @@ class Chartjs extends utils.Adapter {
}

generateToFile(width, height, config, filename) {
const canvasRenderService = new CanvasRenderService(width, height, (ChartJS) => {
const canvasRenderService = new ChartJSNodeCanvas({width, height, chartCallback: (ChartJS) => {
ChartJS.defaults.global.responsive = true;
ChartJS.defaults.global.maintainAspectRatio = false;
});
}});
return this.parseDatasets(config)
.then((config) => {
this.log.debug(safeJsonStringify(config));
Expand Down Expand Up @@ -183,4 +183,4 @@ if (module.parent) {
} else {
// otherwise start the instance directly
new Chartjs();
}
}

0 comments on commit 9119eb1

Please sign in to comment.