Having trouble with Highcharts displaying tooltip headers with 2 decimal places?

I am having trouble setting up the tooltip to display only 2 decimal places, as the headerformat doesn't seem to be working and it continues to show all the decimal places.

What could be causing this issue?

   {  
       "chart":{  
          "type":"line",
          "height":40,
          "width":40
       },
       "title":{  
          "text":null
       },
       "subtitle":{  
          "text":null
       },
       "xAxis":{  
          "categories":[  

          ]
       },
       "yAxis":{  
          "title":{  
             "enabled":true,
             "text":"Amount (Dollars)",
             "style":{  
                "fontWeight":"normal"
             }
          },
          "plotLines":[  
             {  
                "value":0,
                "width":1,
                "color":"#808080"
             }
          ]
       },
       "options":{  
          "legend":{  
             "enabled":false
          }
       },
       "plotOptions":{  

       },
       "series":[  
          {  
             "name":"Total",
             "data":[  
                {  
                   "name":"Apr'2016",
                   "y":1372406438.2385998
                },
                {  
                   "name":"May'2016",
                   "y":5301389724.7499
                },

            {  
               "name":"Jun'2016",
               "y":549467904.6918
            },
            {  
               "name":"July'2016",
               "y":549040695.1202999
            },
            {  
               "name":"Aug'2016",
               "y":1160837116.1138
            },
            {  
               "name":"Sep'2016",
               "y":22.7612
            }
         ],
         "color":"#008CE6",
         "marker":{  
            "enabled":false
         },
         "id":"series-3"
      },
      {  
         "name":"Toal Timely",
         "data":[  
            {  
               "name":"Apr'2016",
               "y":427101358.1748,
               "month":"Apr"
            },
            {  
               "name":"May'2016",
               "y":5191919648.9571,
               "month":"May"
            },
            {  
               "name":"Jun'2016",
               "y":288691855.262,
               "month":"Jun"
            },
            {  
               "name":"July'2016",
               "y":264281732.18769997,
               "month":"July"
            },
            {  
               "name":"Aug'2016",
               "y":853641906.2942,
               "month":"Aug"
            },
            {  
               "name":"Sep'2016",
               "y":0,
               "month":"Sep"
            }
         ],
         "color":"#4ca977",
         "marker":{  
            "enabled":false
         },
         "id":"series-4"
      },
      {  
         "name":"Total Untimely",
         "data":[  
            {  
               "name":"Apr'2016",
               "y":945305080.0637999,
               "month":"Apr"
            },
            {  
               "name":"May'2016",
               "y":109470075.79279998,
               "month":"May"
            },
            {  
               "name":"Jun'2016",
               "y":260776049.4298,
               "month":"Jun"
            },
            {  
               "name":"July'2016",
               "y":284758962.93259996,
               "month":"July"
            },
            {  
               "name":"Aug'2016",
               "y":307195209.8196,
               "month":"Aug"
            },
            {  
               "name":"Sep'2016",
               "y":22.7612,
               "month":"Sep"
            }
         ],
         "color":"#e54343",
         "marker":{  
            "enabled":false
         },
         "id":"series-5"
      }
   ],
   "tooltip":{  
      "pointFormat":"<b>{point.y}</b>",
      "shared":true
   }
}

Answer №1

Include decimal points in the y-coordinate.

"pointFormat": "<b>{point.y:.2f}</b><br>",

For an example, check out:

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Sharing a Twitter thread using Twit library with Node.js

I have been using Node.js along with the npm Twit module to post tweets on Twitter, and while it works for a single tweet, I am facing issues when trying to post multiple tweets as a thread. When attempting to post a series of tweets together, they do not ...

Accessing values from a JSON object in AngularJS without using a loop based on another field

Is there a way to extract the "value" associated with the "name" in JSON using Angular JS without having to iterate through the array? For instance, if I have an array like the one below with name and value fields, how can I retrieve the value "ABC" based ...

Utilizing Webpack to bundle libraries for package management

Hello there, I am currently dealing with a legacy application that relies on various libraries such as jQuery, moment.js, and underscore. These libraries were manually assembled and added to the repository in a loosely coupled manner. My goal is to transi ...

Typescript: Securing Data with the Crypto Module

I am currently working on encrypting a password using the built-in crypto module. Previously, I used createCipher which is now deprecated. I am wondering if there is still an effective way to achieve this. Here is the old code snippet: hashPassword(pass: ...

The instanceof operator does not recognize the value as an instance and is returning false, even though it

Is there a method to verify the current instance being used? This is what I am logging to the console: import { OrthographicCamera } from 'three'; // Later in the file: console.log(camera instanceof OrthographicCamera, camera); and the result ...

What is the process for triggering events when the previous and next buttons are clicked?

Within the jQuery fullcalendar, there are previous and next buttons. Is there a way to trigger specific events when these buttons are clicked? ...

How to write a unit test for a factory in AngularJS using Karma?

Currently, I am developing a basic AngularJS 1.x web application. Here is a breakdown of my project structure: main.js: var app = angular.module('app', []); factory.js app.factory('DataFactory', function(){ var DataService = {}; ...

Vue3 fails to recognize the bearer token just before it is stored into the system

My code makes an API call for user login and receives a token in response. Using this token, I can access the current user data from my API using the Bearer token. try { const response = await axios.post('user/login', { email: this.email, p ...

"Encountering ECONNRESET error while making an HTTPS GET request in

I have a question that is similar to the one discussed in this Node Js thread about making 1000 http get requests to an API server from a Node Js server, but the suggested solution of throttle did not work for me. Currently, I am making calls to our API/w ...

Incorporate a div block using JavaScript

When calling the function below, I attempt to include a div block but struggle with setting the left position. The alert function displays a message of '600px', however, the block appears in a different position on my screen. function show(){ ...

Securing data in AngularJS $http.post requests: Best practices

While working on $http.post requests for my app's backend, I noticed a security issue. When inspecting the data using tools like firebug in Firefox, I can see all the information being sent. Is it possible for third parties to intercept this data? Th ...

What is the process for setting `name` and `inheritAttrs` within the `<script setup>` tag?

Options API: <script> import { defineComponent } from 'vue' export default defineComponent({ name: 'CustomName', // ...

Error: The Node.js server was unable to locate the requested resource, returning a status code of 404 indicating that the resource was not found

My web server is running on Node.js. var app = express(); app.use(express.static(PUBLIC_PATH)); server = require('http').createServer(app), io = require('socket.io').listen(server); I have set the public path to my application's ...

React-big-calendar: Customize day view to end at 1 am for multiple days

I'm currently in the process of developing a booking system and utilizing react-big-calendar for this project. Situation: A business operates from 9am to 2am the next day, allowing clients to book appointments between 11pm and 1am. Objective: To sho ...

The functionality for transferring ERC20 claim tokens seems to be malfunctioning

I am facing an issue with my contract while trying to execute the claimFreeToken function. Even though the contract does not have enough tokens, the function does not return an error and the token also does not get received. Can anyone point out where I ...

The method's title does not correspond to a function

I am having difficulty calling the method within my module. An error occurred: TypeError: usr.User.getAddress is not a function I am unsure of how to resolve this issue, as I suspect there may be a problem in my module code. My goal is to retrieve the ad ...

When using Rails to render a JSON page remotely, the JavaScript AJAX handler fails to capture the response

My goal is to have a form that can post remotely and then receive JSON data back for my JavaScript to process. Below is the code I am using: <%= form_tag '/admin/order_lookup', remote: true, authenticity_token: true, id: "order-lookup-submit" ...

Creating a jQuery thousands separator without losing the decimal accuracy with .toFixed(2)

I'm currently working on a Wordpress project where I need to create a pricing table using jQuery. One of the specific requirements is to format the numbers in thousands with spaces, like converting 1000 to 1 000. Although I have attempted various jQu ...

Issues with displaying the correct date in AngularJS, possibly related to moments.js

I'm currently working on a project that involves Bootstrap 4. I've been attempting to integrate Angularjs with moments.js, but unfortunately, I haven't had much success. This is the HTML code I've used: <input type="date" name="som ...

Changing the color of a div's text based on its content with CSS

I am facing a challenge in styling the text inside a “div” element using a Javascript function. Initially, when the page loads, these “divs” contain no value. The values of the "divs" will change between "Open" and "Closed" twice a day when the Jav ...