The proportion in Highchart appears incorrect when utilizing a "logarithmic" y-axis type

I have encountered an issue with Highcharts in my AngularJS application. Specifically, I am using Highcharts JS v7.2.1 (2019-10-31). When I set the y-axis type to "logarithmic," it causes the bars to render incorrectly in terms of proportion. If I don't use "logarithmic," the chart renders correctly but I also need to display very small values. Can anyone provide a solution for rendering the chart with correct proportions?

chart = new Highcharts.Chart({
    chart: {
        renderTo: 'container',
        type: 'column'
    },
    title: {
        text: 'Negative'
    },
    xAxis: {
        categories: ['A','B','C','D','E','F','G','H'],
        title: {
            text: null
        }
    },
    yAxis: {
        type: 'logarithmic',
        title: {
            text: null,
        }
    },
    legend: {
        enabled: false
    },
    tooltip: {
        formatter: function() {
            return this.x + ':' + this.y + ' millions';
        }
    },
    plotOptions: {
       column: {
                        stacking: 'normal',
                        dataLabels: {
                            enabled: true,
                            style: {
                                textShadow: false,
                                'textOutline': '0px',
                                'stroke-width': 0,
                                fontSize: '14px'
                            }
                        }
                    },
                    series: {
                        pointPadding: 0,
                        groupPadding: 0.1,
                        borderWidth: 0,
                        shadow: false,
                    }
    },
    credits: {
        enabled: false
    },
    series: [{
    "name": "Current Pillar Value",
    "data": [
        15216429,
        842869,
        773956,
        16833254
    ],
    "type": "column",
    "color": "#0fb2fc",
    "showInLegend": false
},
{
    "name": "Previous Pillar Value",
    "data": [
        null,
        15216429,
        16059298,
        null
    ],
    "type": "column",
    "color": "#d3c9c9",
    "dataLabels": {
        "enabled": false
    },
    "showInLegend": false
}],

});
<script src="http://code.highcharts.com/highcharts.js"></script>

<div id="container" style="height: 300px"></div>

Answer №1

Utilize the yAxis.tickInterval attribute to adjust the interval on your vertical axis.

When working with logarithmic axes, the tickInterval is determined by powers of 10. For example, a tickInterval of 1 results in ticks at 0.1, 1, 10, 100, and so on. A tickInterval of 2 would display ticks at 0.1, 10, 1000, and so forth. If you set a tickInterval of 0.2, you'll see ticks at 0.1, 0.2, 0.4, 0.6, 0.8, 1, 2, 4, 6, 8, 10, 20, 40, and onward.

Find more information here: https://api.highcharts.com/highcharts/yAxis.tickInterval

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

Customizing the MUI X Sparkline: Incorporating the percentage symbol at the end of the tooltip data within the MUI Sparklinechart

Presented below is a SparklineChart component imported from MUI X: import * as React from 'react'; import Stack from '@mui/material/Stack'; import Box from '@mui/material/Box'; import { SparkLineChart } from '@mui/x-chart ...

"Enhancing User Experience: Harnessing the Power of jQuery Load and jQuery Tabs for Seamless

Currently, I am working with jQuery Tabs and implementing the loading of tab pages through the tabsbeforeactivate event in order to utilize Ajax and only load contents when necessary. However, I am encountering challenges as I have to manually activate Un ...

Struggling to save a signature created with an HTML5 Canvas to the database

I've been on the hunt for a reliable signature capture script that can save signatures to MySQL, and I finally found one that fits the bill. However, there are two issues that need addressing: The canvas doesn't clear the signature when the c ...

What is the best way to create a reusable component for this particular version of Autocomplete?

Can anyone help me figure out how to make this Autocomplete component reusable? I am using it multiple times but struggling with defining the necessary useStates. <Autocomplete required value={firstName} onChange={(event, newV ...

Tips on aligning a span element at the center of an image without losing its mouseover

<div class="pic"> <img src="image.jpg" height="250"/> <span class="text" style="display:none">text here</span> </div> <scriptsrc="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"> </scrip ...

Organizing and Composing Objects the Angular Way

Transitioning from Backbone to Angular has me exploring different approaches for adding methods to objects in the Angular framework. While Backbone allowed flexibility, it did provide a standard way of extending objects like this: Grid = Backbone.View.Ext ...

Determine whether a particular value is absent from a JSON object

I am looking to verify the absence of a specific value in the given object by filtering an array of strings. My goal is to determine if the values within the keys array are present in the JSON object I am iterating through. If any of the values are missin ...

Could someone please guide me on how to use JQuery to set a radio button as checked?

<input type="radio" name="sort" value="2" id="myradio"> Is there a way to set this as the selected option using JQUERY? ...

"Troubleshooting: My Three.js scene is displaying blank, what could

I recently created a simple example using Three.js, but my code was not organized into classes which caused some issues with displaying anything in the view. Here is an example of the code I used: HTML file <!DOCTYPE html> <html> <head> ...

Steps to begin again an Ionic application on IOS operating system

Currently, I am in the process of developing an Ionic application for both Android and IOS platforms. One challenge I am facing is that if any errors occur either on the server side or client side, the app automatically restarts. For Android, I have succe ...

What type of Javascript is required for a photo carousel that displays random images from a designated folder?

I have a minor issue that has been keeping me up at night. I can't seem to shake it off and find the right solution! Currently, I am working with Bootstrap 4 as my Framework. My task is to create a full-page Carousel that cycles through images random ...

Guide to configuring an x-axis scroll bar for a handsontable

Utilizing the JarvisWidget library to create widgets, I encountered an issue with a table exceeding the width of the widget when using the handsontable library. I attempted to add a scrollbar by setting the CSS width to 100% and adding overflow-x:scroll, b ...

What is the best way to incorporate this HTML and script into a React component?

After receiving the embedded HTML and script from a platform, I discovered that a button triggers the script. It was originally designed to be embedded on a website, but I am attempting to integrate it into a React application. Here is the code provided fo ...

How can I make this NextJS component show its width as soon as the page loads?

When I try to run this code to retrieve the browser's screen width, I encounter the following error: ReferenceError: window is not defined The commented-out code works fine with a default value of 0 and updates correctly when the browser width chan ...

Issue with BCRYPTJS library: generating identical hashes for distinct passwords

After conducting a thorough search on Google, I couldn't find anyone else experiencing the same issue. The problem lies in the fact that no matter what password the user enters, the system returns the hashed value as if it is the correct password. Eve ...

Saving information from JSON data obtained through the Google People API

My server is connected to the Google People API to receive contact information, and the data object I receive has a specific structure: { connections: [ { resourceName: 'people/c3904925882068251400', etag: '%EgYBAgkLNy4aDQECAwQFBgcICQoLD ...

How can I execute a StoredProcedure using JavaScript?

I have a form with an email field and label <asp:TableRow runat="server"> <asp:TableCell runat="server"> <asp:TextBox runat="server" ID="txtUserEmail" onfocusout="emailVerification()" CssClass="forTe ...

Neither req.body nor req.file contain any data

Hey everyone, I'm new to coding and currently working on creating a basic markdown blog. However, I'm facing an issue where req.body doesn't contain my markdown field and req.file is undefined when trying to upload an article. I'm unsur ...

What is the best way to create query strings for AJAX URL using jQuery or JavaScript?

At the moment, I am implementing ajax and jquery to dynamically update search results based on different filtering categories within a form. My challenge lies in the fact that I aim to pass varying variables to the URL used for ajax, derived from checkbox ...

Is it possible to execute the Bouncy castle algorithm within Mirth Connect?

Can anyone provide guidance on how to convert this Java program that calls the Bouncy Castle algorithm into JavaScript for Mirth? I have experience with Java but am new to Mirth and JavaScript. Source: public static byte[] encrypt( byte[] dataToEncry ...