Highcharts tooltip staying fixed instead of moving to the next point

After implementing this code, I noticed that the tooltip is only showing the starting and end value. However, what I want is for the tooltip to display all values.

Is there a way to show the tooltip for all values of the high-chart? -"Starting from the first point next to the other points when hovering"

This is my complete code:

$(function() {
  $('#container').highcharts({
    chart: {
      zoomType: 'y'
    },
    title: {
      text: 'FlexiMc'
    },
    xAxis: {
      type: 'datetime',
    },
    yAxis: {
      min: 0,
      //max: 90000,
      title: {
        text: 'Exchange rate'
      }
    },
    legend: {
      enabled: true
    },
    tooltip: {
      valueDecimals: 2,
      valueSuffix: '',
    },
    series: [{
      type: 'line',
      name: 'Current Out',
      data: [
        [Date.UTC(2014, 10, 12, 18, 33), 0],
        [Date.UTC(2014, 10, 12, 17, 42), 0],
        [Date.UTC(2014, 10, 12, 16, 40), 10.83],
        [Date.UTC(2014, 10, 12, 16, 21), 14.83],
        [Date.UTC(2014, 10, 12, 14, 43), 86.34],
        [Date.UTC(2014, 10, 12, 13, 46), 72.35],
        [Date.UTC(2014, 10, 12, 12, 40), 31.69],
        [Date.UTC(2014, 10, 12, 11, 42), 133.37]
      ],
      marker: {
        enabled: true,
        radius: 3
      },
      shadow: true,
      tooltip: {
        valueDecimals: 2,
        shared: true
      }
    }, {
      type: 'line',
      name: 'Voltage',
      data: [
        [Date.UTC(2014, 10, 12, 18, 33), 5.13],
        [Date.UTC(2014, 10, 12, 17, 42), 219],
        [Date.UTC(2014, 10, 12, 16, 40), 644],
        [Date.UTC(2014, 10, 12, 16, 21), 652],
        [Date.UTC(2014, 10, 12, 14, 43), 664],
        [Date.UTC(2014, 10, 12, 13, 46), 628],
        [Date.UTC(2014, 10, 12, 12, 40), 668],
        [Date.UTC(2014, 10, 12, 11, 42), 652],
        [Date.UTC(2014, 10, 12, 10, 46), 648]
      ],
      marker: {
        enabled: true,
        radius: 3
      },
      shadow: true,
      tooltip: {
        valueDecimals: 2,
        shared: true
      }
    }]
  });
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
<script src="http://code.highcharts.com/highcharts.js"></script>
<script src="http://code.highcharts.com/modules/exporting.js"></script>

<div id="container" style="min-width: 400px; height: 400px; margin: 0 auto"></div>

Answer №1

It seems like you might be struggling with JSON formatting, which is quite common. It looks like you've begun by using one of their demo charts related to weather data. Are you finding that example closely matches what you are trying to achieve? If not, I recommend starting ~~HERE~~, as it provides a comprehensive list of options and allows for easy copying and pasting once you have selected the desired features.

Make sure your JSON is well-formatted. To address any spacing issues, consider assigning the object literal to a variable and then use

console.log(JSON.stringify(chartVar, null, 4))
to neatly print out the structure. You can then copy from there.

In summary, I suggest beginning with a simple example that includes most of the required functionality, insert your own data, and ensure it works smoothly in its basic form before delving into customizations like labels and colors.

I hope this helps alleviate some of your frustration!

Answer №2

It is essential to arrange your information in ascending order based on x.

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

Tips for incorporating home and settings buttons into PhoneGap's webview

I am in the process of creating an app using PhoneGap. This app will feature icons for the home and settings buttons at the top of each webview, similar to an actionbar menu in Android. I am utilizing a generated template from ThemeRoller (CSS) for JQuery ...

I'm looking to extract various data from a SQLite table using the URL with ExpressJS. What's the best way to achieve

I need to access data from a SQLite database table that contains information on accounts, movies, and reviews. Specifically, the structure of the reviews-table is as follows: CREATE TABLE IF NOT EXISTS reviews ( id INTEGER PRIMARY KEY, authorId INT ...

How can I prevent webpack from showing the default output after a module build error occurs?

Having difficulty figuring out how to prevent webpack from displaying an error message like the following when encountering a SyntaxError. throw new Error("Module build failed: SyntaxError: ...) Ideally, I'd prefer it not to show any output at all i ...

Is it possible to retrieve a static resource within server-side code in NextJs?

Exploring the static render feature of NextJS to generate a static version of my website has led me to ensure that all necessary data is provided for the initial page render. I have stored several blog posts as .md files in /static and aim to access them ...

Exploring ways to display featured posts within specific category sections

I have 2 featured posts in 1 div id, one with a big class and the other with a small class. I want the big featured div to display posts based on categories. The code for the big featured post is shown below: <div class="main_feat"> ...

Is it possible for me to create an immersive HTML5 game that utilizes the entire screen

I'm currently designing an extraordinary HTML5 game. Is there a convenient way to offer the user a handy button for effortlessly switching to full-screen mode? This should work seamlessly across all popular browsers, without any compatibility limitat ...

datetime-local format changing after selection

In an ionic application running on an android system, there is a issue with the formatting of <input type='datetime-local'> inputs. After a user selects a date, the Start input is formatted differently than the Ende input. Attempts to use t ...

Guide to organizing a calculated attribute in vue.js

I'm struggling with organizing the already computed array of results. Within Vue, I have successfully filtered images based on their ratio. Now, my goal is to sort these filtered results by date, name, or any other possible category. Although I atte ...

Struggling with smoothly transitioning an image into view using CSS and JavaScript

I'm currently experimenting with creating a cool effect on my website where an image fades in and moves up as the user scrolls it into view. I've included the code I have so far below, but unfortunately, I keep getting a 404 error when trying to ...

Is it possible to extract the CSS path of a web element using Selenium and Python?

I am working with a collection of elements using find_elements_by_css_selector, and my next task is to extract their css locators. I attempted the following approach: foo.get_property('css_selector') However, it seems to be returning None. ...

What is the best way to extract a string from a MongoDB database?

I am retrieving data from a mongodb server and one of the fields consists of a string with values listed as: Fire, Water, Ice, Steel Unfortunately, this is not in array format and parsing it may be challenging. How would you suggest I handle this situat ...

How to show an image in Codeigniter

Within my project, there are 3 views: welcome.php, login.php, and header-guest.php. I have included header-guest.php in both welcome.php and login.php using a php include 'header-guest.php'. welcome.php serves as the opening or index page of the ...

Creating a clickable image in the header of an R Shiny app

I've been attempting to create a hyperlink from the image output, but I'm encountering difficulties despite reviewing similar questions on Stack Overflow. svg with clickable links in shiny - not clickable The tags are not working. server.r li ...

Retrieve information from a local API using Next.js

While working with Next.js api today, I encountered an issue. I needed to fetch data from my internal API in getStaticProps. However, the documentation advises against fetching local API directly in getStaticProps and instead suggests importing the functio ...

Align the bottom of an image with the top of text to achieve perfect vertical alignment

My goal is to arrange numerous images in a row, with text displayed below each image. Each block of text may consist of multiple lines and should be centered. While the heights of the images may vary, their widths will remain consistent. It is important th ...

Having trouble with my routes in Express Router - the page just won't load!

My backend is not functioning properly. The server is starting without any issues, but when I try to access http://localhost:5000/api/items, it just loads indefinitely. I am unsure of what I am doing wrong. Below is my server.js file: const express = requ ...

Adjusting the selection in the Dropdown Box

I've been attempting to assign a value to the select box as shown below: <dx-select-box [items]="reportingProject" id="ReportingProj" [text]="reportingProject" [readOnly]="true" > ...

Unexpected outcome when converting a while loop to a .forEach statement

Exploring a practical demonstration of sorting an array of objects based on multiple properties, the code implementation involves a while loop (refer to students1 in the snippet below). I attempted to streamline this process by using .forEach, but encounte ...

IE and Firefox display different responses when encountering an empty XML document

When working with jQuery to read an XML file, I occasionally encounter the situation where the XML is empty. In this case, I anticipate that the error function (no_info) will be triggered because the file is not formatted as expected for the dataType. Int ...

Error message on Android Web Console: ReferenceError - Worker object is not defined

As someone who is new to javascript, I have been struggling to understand why popular browsers seem to handle the definition "new Worker("BarcodeWorker.js")" differently than Android WebView. The original code for this Barcode Reader is from Eddie Larsso ...