codershikhar
Posts: 1
Joined: Sat Sep 16, 2023 1:55 pm

Highchart Angular Abs Function Not Working

Sat Sep 16, 2023 1:59 pm

I am trying to replicate the following Javascript graph in Angular.
https://www.highcharts.com/demo/highcha ... tive-stack

To make this work I need abs function to work in format for labels.

How to make it work?

jakub.j
Posts: 857
Joined: Tue Jan 24, 2023 11:14 am

Re: Highchart Angular Abs Function Not Working

Mon Sep 18, 2023 7:41 am

Welcome to our forum and thanks for contacting us with your question!

Instead of tooltip.format, you can use tooltip.formatter and use js Math.abs method inside along with toFixed(). It gives the same result.

Demo: https://stackblitz.com/edit/highcharts- ... mponent.ts

Let me know if you have any further questions!
Best regards
Jakub
Jakub
Highcharts Developer

Return to “Highcharts Usage”