Skip to content

Commit

Permalink
fixed issues with highcharts v12
Browse files Browse the repository at this point in the history
  • Loading branch information
ma4nn committed Dec 10, 2024
1 parent 2a15184 commit 8c01bef
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 ? "<span class='badge text-bg-secondary'>" + Math.round(percentage) + "% </span>" : "");
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 ? "<span class='badge text-bg-secondary'>" + Math.round(percentage) + "% </span>" : "");
}
},
tooltip: {
Expand All @@ -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 = '';
Expand Down

0 comments on commit 8c01bef

Please sign in to comment.