Skip to content

Commit 8c01bef

Browse files
committed
fixed issues with highcharts v12
1 parent 2a15184 commit 8c01bef

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/main.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -173,9 +173,11 @@ function createChart(chartDataTree: Tree): Highcharts.Chart {
173173
align: 'right',
174174
padding: 30,
175175
nodeFormatter: function() {
176-
const point = this as any;
177-
const percentage = 'linksTo' in point && point.linksTo[0] ? (point.sum / point.linksTo[0].fromNode.sum) * 100 : null;
178-
return this.point.name + ": " + numberFormat(('getSum' in this.point ? (this.point as any).getSum() : 0)) + " " + (percentage ? "<span class='badge text-bg-secondary'>" + Math.round(percentage) + "% </span>" : "");
176+
const point = this as Highcharts.Point;
177+
const sum = 'getSum' in this ? (this as any).getSum() : 0;
178+
const percentage = 'linksTo' in point && point.linksTo[0] ? (sum / point.linksTo[0].fromNode.sum) * 100 : null;
179+
180+
return point.name + ": " + numberFormat(sum) + " " + (percentage ? "<span class='badge text-bg-secondary'>" + Math.round(percentage) + "% </span>" : "");
179181
}
180182
},
181183
tooltip: {
@@ -186,7 +188,7 @@ function createChart(chartDataTree: Tree): Highcharts.Chart {
186188
},
187189
// tooltip for node
188190
nodeFormatter: function() {
189-
const point = this as any;
191+
const point = this as Highcharts.Point;
190192

191193
let totalWeight = 0;
192194
let weightsDetailTooltip = '';

0 commit comments

Comments
 (0)