From 8c01befb1c2d38975bf9fdd8a8f30a06a14c509f Mon Sep 17 00:00:00 2001 From: Christoph Massmann Date: Tue, 10 Dec 2024 12:57:20 +0100 Subject: [PATCH] fixed issues with highcharts v12 --- src/main.ts | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/main.ts b/src/main.ts index 6b5b82e..4c39293 100644 --- a/src/main.ts +++ b/src/main.ts @@ -173,9 +173,11 @@ function createChart(chartDataTree: Tree): Highcharts.Chart { align: 'right', padding: 30, nodeFormatter: function() { - const point = this as any; - const percentage = 'linksTo' in point && point.linksTo[0] ? (point.sum / point.linksTo[0].fromNode.sum) * 100 : null; - return this.point.name + ": " + numberFormat(('getSum' in this.point ? (this.point as any).getSum() : 0)) + " " + (percentage ? "" + Math.round(percentage) + "% " : ""); + const point = this as Highcharts.Point; + const sum = 'getSum' in this ? (this as any).getSum() : 0; + const percentage = 'linksTo' in point && point.linksTo[0] ? (sum / point.linksTo[0].fromNode.sum) * 100 : null; + + return point.name + ": " + numberFormat(sum) + " " + (percentage ? "" + Math.round(percentage) + "% " : ""); } }, tooltip: { @@ -186,7 +188,7 @@ function createChart(chartDataTree: Tree): Highcharts.Chart { }, // tooltip for node nodeFormatter: function() { - const point = this as any; + const point = this as Highcharts.Point; let totalWeight = 0; let weightsDetailTooltip = '';