Highcharts displays data with the fourth y axis but doesn't include labels for it

I'm facing an issue with displaying all the labels on my chart. I have 4 series plotted and decided to add two y-axes on each side of the graph, but the labels for the last series named "Stuff Data" are not showing up correctly. Instead, it seems to be using the Voltage data's y-axis.

For reference, please check out: https://jsfiddle.net/Lprm4ofw/51/

I've attempted rearranging the series and yAxis order, but the last label still remains missing. I also adjusted the margins in case it was hidden, but that didn't solve the problem either. Can anyone suggest a solution? Here is the code snippet:

Highcharts.chart('container', {
    chart: {
        zoomType: 'xy',
        type: 'spline'
    },
    title: {
        text: 'Whatever'
    },
    xAxis: [{
        categories: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun',
            'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],
        crosshair: true
    }],
      yAxis: [{ // Primary yAxis
            title: {
                text: 'Voltage',
                style: {
                    color: Highcharts.getOptions().colors[2]
                }
            },
                        labels: {
                format: '{value} V',
                style: {
                    color: Highcharts.getOptions().colors[2]
                }
            },
            opposite: true

        }, { // Secondary yAxis
            title: {
                text: 'Current',
                style: {
                    color: Highcharts.getOptions().colors[0]
                }
            },
            labels: {
                format: '{value} C',
                style: {
                    color: Highcharts.getOptions().colors[0]
                }
            },
        },
        { // Third yAxis
              gridLineWidth: 0,
              title: {
                  text: 'Temperature',
                  style: {
                      color: Highcharts.getOptions().colors[3]
                  }
              },
              labels: {
                  format: '{value}°C',
                  style: {
                      color: Highcharts.getOptions().colors[3]
                  }
              },
          opposite: true

          },
          { // Fourth yAxis
                title: {
                    text: 'stuff',
                    style: {
                        color: Highcharts.getOptions().colors[4]
                    }
                },
                labels: {
                    format: 'WHEREAMI',
                    style: {
                        color: Highcharts.getOptions().colors[4]
                    }
                },

      }],
    tooltip: {
        shared: true
    },
    legend: {
        layout: 'vertical',
        align: 'left',
        x: 80,
        verticalAlign: 'top',
        y: 55,
        floating: true,
        backgroundColor: (Highcharts.theme && Highcharts.theme.legendBackgroundColor) || '#FFFFFF'
    },
    series: [
     {
        name: 'Voltage Data',
        data: [10.0, 20.79, 13.5, 18.8],
        yaxis: 0,
    },
    {
        name: 'Current Data',
        yAxis: 1,
        data: [1, 2, 3 , 4],

    }, {
        name: 'Temperature Data',
        yAxis: 2,
        data: [4, 5, 6 , 9]

    }, {
        name: 'Stuff Data',
        data: [7.0, 6.9, 9.5],
        yaxis: 3,
    }]
});

Answer №1

It's crucial to use the correct property name; xaxis is not interchangeable with xAxis:

series: [
  {
    name: 'Voltage Data',
    data: [10.0, 20.79, 13.5, 18.8],
    yAxis: 0,
  },
  {
    name: 'Current Data',
    yAxis: 1,
    data: [1, 2, 3, 4],

  }, {
    name: 'Temperature Data',
    yAxis: 2,
    data: [4, 5, 6, 9]

  }, {
    name: 'Stuff Data',
    data: [7.0, 6.9, 9.5],
    yAxis: 3,
  }
]

Check out this live demo to see it in action: https://jsfiddle.net/BlackLabel/6wrahgko/

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

Error: A semicolon is required before the statement in an HTML select tag

I am struggling with the code below in my java script: var i = 2; $(".addmore").on('click', function () { count = $('table tr').length; var data = "<tr><td><input type='c ...

Running NodeJS scripts with ElectronJS is not possible

Goal I'm facing a challenge with executing my separate scripts located in the project/api folder. Let's take test.js as an example, where I am exporting it using module.exports. When I run my electron window and create a JavaScript file with a f ...

Encountering a frustrating internal server error 500 when attempting to insert values from JavaScript into SQL Server within Visual Studio

Here is a JavaScript code that calls a C# webmethod: var _data = { '_mStart': document.getElementById("St_Period").value, '_mEnd': document.getElementById("En_Period").value }; $.ajax({ type: "POST", url: "maps.aspx/my ...

Struggle with connecting to Firebase database

I've been grappling with errors while trying to build a list of users using Firebase's collection feature. https://i.sstatic.net/BTPMM.png I've provided the information I'm inputting below: https://i.sstatic.net/yVD0i.png This is my ...

I am struggling to understand the significance of the $ symbol in this particular context

I came across the following snippet in a book I've been reading: `images/${Date.now()}.jpg` The curly brackets used here signify 'out of string', but I'm unsure about the meaning of $... P.S. Honestly, I didn't want to ask a que ...

The structure of JSON data in Highcharts

Utilizing the highcharts wind rose example, my goal is to read data from a JSON format instead of an inline table. Here is the initial example I am working with: https://jsfiddle.net/bqwprojc/1/ The code snippet in question that needs modification: data: { ...

Revert animation back to its initial position with the help of JavaScript

After implementing the script below, I successfully managed to shift my image to the right upon clicking: <script> var myTimer = null; function move(){ document.getElementById("fish").style.left = parseInt(document.getElementById("fish ...

Utilizing AngularJS: Dynamically employ custom directives for enhanced reusability

I am currently developing my debut single page Angular.js application and finding myself in a bit of a rut when it comes to programmatically compiling/evaluating a custom directive to insert it into the DOM from within a controller. The custom directive I ...

Manage Blob data using Ajax request in spring MVC

My current project involves working with Blob data in spring MVC using jquery Ajax calls. Specifically, I am developing a banking application where I need to send an ajax request to retrieve all client details. However, the issue lies in dealing with the ...

What exactly is a doclet as defined in JSDoc documentation?

//Sample 1 /** * Here we have a simple function that returns a message * @param {String} msg The message to be returned * @returns {String} The message */ function showMessage(msg) { return msg } //Sample 2 /** * This is a function that also retur ...

React Component: Issue with toggle functionality in child component not meeting expectations

I'm currently working on a checkbox user interface, where I need to pass a toggle function down to a list component. The issue I'm facing is that while I can check the checkbox successfully, I'm unable to uncheck it for some reason. Below i ...

What is the process for altering a route in React 18?

Previously, I relied on the withRouter Higher Order Component (HOC) along with props.history.push() function to manage routes. However, with the introduction of React 18, these options are no longer available. My current task involves editing a post and ...

Oops! Looks like there was a NotFoundError when trying to execute the 'removeChild' function on React with Flickity

I am currently developing a React application, and I have integrated the 'CategoriesList' component on the HomePage. Everything works fine when I am on the HomePage, but I encountered an error when I navigated to the ProductDetails page using re ...

The powerful combination of Nuxt, Vuex, and Computed Properties allows for

Currently exploring Nuxt.js with Vuex, I have created a basic form containing an email field, a password field, and a button. All my state, mutations, and actions are functioning correctly. However, I encountered an issue when trying to create a computed ...

"Php makes it easy to organize seating arrangements with drag-and-drop functionality

We are currently in the process of developing a website dedicated to bus services and booking tickets. Our main goal is to allow the administrator to easily create and modify seating arrangements through drag-and-drop functionality, including the ability t ...

Separating Angular controllers into their own files can help prevent errors like "undefined is not a

I am currently revamping some Angular code and my goal is to organize things by type, such as keeping controllers in a separate folder. Currently, I have two controllers and an app.js file. However, I am encountering an issue with the error message "undef ...

Creating a default menu within a specific route in Ember.js is a crucial step in

I have created a JSBin code for my Ember.js application which can be found here: When I click on Item A, I want the ABCD menu on the left to remain visible and not disappear. Thank you. ...

Ensure the calling object is retained during the resolution of an Angular promise

Identifying the Issue One issue arises when resolving promises in Javascript: the context switches to Window #. This means that referring back to the object resolving the promise becomes tricky because I can't access or modify its variables. The com ...

An issue occurred while serializing or deserializing, specifically with the JavaScriptSerializer and

I am facing an issue while trying to retrieve images from my database. The process works smoothly with small images, but when attempting to do the same with the default Windows 7 images (Desert, Koala, Penguins, Tulips, etc.), I encounter an error: "Err ...

Including an additional row in a pre-existing table

My goal is to dynamically add a new row when a button is clicked, right after the row containing the button. To achieve this, I'm using jQuery (version 1.10.2) to handle the creation of new rows. The issue I'm facing is related to the behavior o ...