Tips on displaying tooltips on multiple graphs in Highcharts using Vue 3

I am currently utilizing vue3-highcharts in conjunction with Highcharts. My goal is to replicate a similar functionality as shown in this example: https://codepen.io/lzl124631x/pen/KLEdby?editors=1010. However, I am unsure about the correct syntax for implementing those functions within Vue 3.

Thus far, I have successfully synchronized x-Axis zooming, hovering, and displaying crosshairs across multiple charts. Despite this, I am encountering difficulties in getting the tooltip to appear on all the charts. To achieve the xAxis zoom, I utilized the following code:

xAxis: {
  events: {
    afterSetExtremes: function (e) {
      if (e) {
         Highcharts.charts.forEach((chart) => {
           if (chart && chart.index !== e.chartId) {
              chart.xAxis[0].setExtremes(e.min, e.max);
           }
         })
      }
    }
  }
},

To synchronize hovers and crosshairs, I implemented the following code:

plotOptions: {
  series: {
    point: {
      events: {
        mouseOver: function (e) {
          let series = e.target.series;
          let index = series.xData.indexOf(e.target.index);
          
          Highcharts.charts.forEach((chart) => {
            if (chart && chart.index !== e.chartId) {
              let event = chart.pointer.normalize(e)
              
              let data = chart.series[0].data[index];
              if (data) {
                data.setState('hover');
                chart.xAxis[0].drawCrosshair(event, data);
                
                chart.tooltip.refresh(data); 
              }
            }
          })
        },
        
      }
    }
  }
},

To display the tooltip, I attempted:

chart.tooltip.refresh(data);

Unfortunately, this resulted in an error.

Edit: For future reference, the solution is:

chart.tooltip.refresh([data]);

Answer №1

Regrettably, the current version of the Highcharts Vue wrapper does not offer compatibility with vue3.

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 on resolving the toUpperCase problem during Jest testing?

I'm currently working with Vue.js and Jest. Inside my component, I have the following code snippet: ...mapGetters('type', [ 'selectedAddressType', 'checkDeliveryType', ]), const keyToDisplayMessage = ` ...

Assign an identifier to the HTML helper Html.EditorFor

When using a textbox created with the HTML helper "@Html.EditorFor", there may be a need to perform some action with JavaScript on its change event. In order to do this, an ID needs to be set for the textbox. For example, if you need to set a string value ...

Leverage JSON files for pagination in NextJS

I am currently developing a science website where the post URLs are stored in a static JSON file. ScienceTopics.json- [ { "Subject": "Mathematics", "chapters": "mathematics", "contentList": [ ...

Retrieving multiple checkbox values using JavaScript

When submitting a form using ajax and jquery, I encountered an issue with multiple checkboxes that are not posting values to the database. Here is the relevant HTML/PHP code snippet: while($row = mysql_fetch_assoc( $result )) { echo '<input ...

Obtain the ClientID for a particular user control that is within a repeater's bindings

I have a collection of user controls that I am connecting to a repeater. The user control: (Example) "AppProduct" <div> <asp:Button ID="btn_details" runat="server" Text="Trigger" /> <asp:HiddenField ID="pid" ...

Blend field and JavaScript functions while retrieving data from MongoDB

Take a look at this information: { "creation_date" : ISODate("2015-02-10T03:00:00.000Z"), "days_of_validity": 10 } I need to find all documents where "creation_date" is less than today - "days_of_validity" This is what I have come up with so far: doc ...

Using AngularJS to make repeated API calls with modified parameters

Issue - My task involves consolidating the response array into one. I am making consecutive calls to the same API, with a dynamic 'skip' parameter based on the last response. Call #1 - api(id, skip=0) Call #2 - api(id, skip+1) ... Below is the ...

Programme for Server Login

After creating my own server, I attempted to implement a login feature to restrict access to its files. Unfortunately, using Javascript for this task proved to be insecure as usernames and passwords could easily be viewed in the source code: <form name ...

Place a checkbox at the start of each table cell

Is there a way to add a checkbox before the text in the first cell of each row in an HTML table using jQuery? I attempted this method: $("table td:first-child").each(function() { $(this).prepend('<input type="checkbox" class="basic-kpi-row"/&g ...

Show the news feed in a format of 3 columns on desktop and 3 rows on mobile using Vue

I've been working on getting my news to display in three rows on mobile view. I successfully used VueSlickCarousel to show the news in three columns on desktop, but I've been encountering issues with setting breakpoints for different screen sizes ...

Managing arrayBuffer in hapi.js: A Comprehensive Guide

I am struggling to upload an arrayBuffer to my server and save it to a file. On the client side, I am using axios, and on the server side, I have implemented Hapi js. However, I am facing difficulties in extracting data from the request in the Hapi handler ...

What happens if I attempt to access an undefined value from a JSON array?

I've been attempting to nest a JSON array within another JSON array. I believe I have structured it correctly, but when I try to access the second array, it returns undefined. JSON example : var data = [ {"Items" : [ {"item1" : "item1 ...

Error occurs when attempting to write to a Node stream after it has already

I'm experimenting with streaming to upload and download files. Here is a simple file download route that unzips my compressed file and sends it via stream: app.get('/file', (req, res) => { fs.createReadStream('./upload/compres ...

Receiving the error "Potential null object. TS2531" while working with a form input field

I am currently working on developing a straightforward form to collect email and password details from new users signing up on Firebase. I am utilizing React with Typescript, and encountering an error labeled "Object is possibly 'null'. TS2531" s ...

Establishing the focal point and emphasis within a textarea input field

I am presenting a textarea input through PHP with the following command : print " '<textarea rows='16' cols='30'>$flist'</textarea><BR>"; I want the textarea to receive focus and automatically select the co ...

Console displays null as the attribute value

When I check the console, I notice that the data-postid attribute is displaying 'null'. What could be causing this issue? I would like to view the data-id in the console when clicking on the button with the id modal-save. I have reviewed my cod ...

Issue with child component not reflecting changes when the state is updated

In an attempt to pass a value to a child component, I am encountering an issue where the value does not update when the parent component's value changes. Below is my code: Child Component: class Test extends Component { constructor(props) { su ...

Move and place multimedia items using IE's drag and drop feature

Is there a way to enable the drag and drop feature across different browsers or windows using HTML5's native DnD API? I have noticed that when I set the data type to 'text' in Internet Explorer, it functions properly. However, if I attempt t ...

How to sort WordPress RSS feed in alphabetical order using JavaScript

Currently using WP, but feeling limited due to restricted access to PHP and plugins. Searching for a JAVASCRIPT code solution to fetch RSS feed from a URL and organize the feed titles in ALPHABETICAL order. The JS code can be inserted into the footer and ...

What is the hexadecimal color code for a specific element's background?

How can I retrieve the background color code of a specified element? var backgroundColor = $(".element").css("background-color"); <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script> <div class="elemen ...