Issue with Highcharts: Border of stacking bar chart not visible on the right side

When creating a stacking bar chart, I noticed that the rightmost 'box' does not have a border drawn on the right side.

Is there a setting or option in Highcharts that can be used to ensure the white border line is drawn around the 75% box in the image below?

You can view the jsfiddle I used for testing by clicking on this link: http://jsfiddle.net/zKgsF/

Note: Increasing the borderWidth property above 1 results in display, but the rightmost border appears thinner than the others. Please see the image below for reference.

Below is the javascript code used for the chart:

$(function () {
    var chart = new Highcharts.Chart({
        chart: {
            renderTo: 'container',
            type: 'bar',
            backgroundColor: 'rgba(0,0,0,.3)',
            margin: [15,6,15,15],
        },
        xAxis: {
            categories: ['']
        },
        credits: {
          enabled: false
        },
        yAxis: {
          gridLineColor: "#FF0000",
          labels: 
          {
            align: 'right',
            formatter: function()
            {
              return this.value + "%";
            }
                },
        },
        tooltip: {
                formatter: function() 
          {
                        return "<b>" + this.series.name + '</b>: ' + this.y + ' (' +            Math.round(this.percentage,1) + "%)";
                }
            },
        plotOptions: {
                bar: {
                    animation: false,
                    stacking: 'percent',
                    borderWidth: '1',
                    dataLabels: {
                        enabled: true,
                        color: 'white',
                        formatter: function() {

                            if (this.percentage < 10) 
                            {
                                return ""
                            }
                            else
                            {
                                return Math.round(this.percentage,1) + "%";
                            }
                        },
                        style: {
                            fontSize: '18px'
                        }

                    }
                }
        },
        series: [{
            data: [30]        
        },{
            data: [10]        
        }]
    });
});

EDIT:

It seems that the issue is not related to the bar chart being "stackable". It may be linked to the fact that the chart reaches the maximum 'y' value axis... as depicted in another example here: http://jsfiddle.net/zKgsF/1/

Answer №1

If you follow the suggestion of Cubbuk, you can enhance it by incorporating the max value for the yAxis.

Furthermore, you have the option to include a property called endOnTick.

 max: 100.1,
 endOnTick: false

For more information on the API, visit this link. Additionally, here is an example for reference.

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

A guide on how to efficiently retrieve a string within a function in a native module in a React Native

I'm currently tackling a function related to the native elements of iOS that is coded in Objective-C, My goal is to create a method that will output a string in Objective-C, However, I've hit a roadblock while trying to implement this method: T ...

Fixing a CSS animation glitch when using JavaScript

I'm facing an unusual issue with my CSS/HTML Check out my code below: a:hover { color: deeppink; transition: all 0.2s ease-out } .logo { height: 300px; margin-top: -100px; transition: all 0.2s ease-in; transform: scale(1) } .logo:hover { transit ...

Integrating Braintree with Angular for accepting Android Pay transactions

Currently facing a challenge with Braintree that I need help resolving. I have successfully set up Braintree to generate my client_token using my API, and created the drop-in feature as a test. Here is how I implemented it: (function () { 'use st ...

What could be causing the "AJAX data not defined" error

Attempting to make an Ajax post request to the root directory on my Express server. By simply using the HTML form and submitting an artist name, I successfully receive a response back and can send the information to the client without any issues... As se ...

Failed to perform the action using the Angular Post method

Currently, I am exploring the use of Angular with Struts, and I have limited experience with Angular. In my controller (Controller.js), I am utilizing a post method to invoke the action class (CartAction). Despite not encountering any errors while trigge ...

Once logged out in Vue Router, the main app template will briefly display along with the login component

After clicking the logout button, I am experiencing an issue where my main UI remains visible for a few seconds before transitioning to a blank page and displaying the login form component. This behavior is occurring within the setup of my App.vue file: & ...

Tips for showing error messages in response to exceptions

My function is supposed to display the response text that comes back from ex.responseText. However, every time I attempt it, it returns as "undefined" even though the text is there. onError: function (ex) { $('<div>' + ex._message + &a ...

Optimal method for identifying all inputs resembling text

I'm in the process of implementing keyboard shortcuts on a webpage, but I seem to be encountering a persistent bug. It is essential that keyboard shortcuts do not get activated while the user is typing in a text-like input field. The approach for hand ...

Issue with handling promise rejection of type error in node.js

Whenever I try running node server.js in Node.js, an error message pops up saying 'Cannot read property 'length' of undefined'. Despite installing all the necessary libraries (such as request) and browsing through various related posts ...

Traverse a deeply nested JSON structure

I need assistance with looping through a complex JSON object using only JavaScript. My goal is to log each item along with its properties into the console. const nested_json = { "item1":{ "name": "banana", ...

Modify the background color of the entire page when the main div is clicked

I am attempting to alter the background color of my entire page when the div with id main is clicked. You can view the code here: $(document).ready(function() { var color = 1; $('#main').click(function(){ if (colo ...

Steps to design a code editor with autocomplete dropdown using Material UI technology

I am currently working on a unique use case for my app that involves implementing an editor-like textarea with Material UI Chip components (similar to tags in an autocomplete textbox) that generate expressions. The goal is to have an autocomplete dropdown ...

Unable to refresh JSON data in Datatables

Ensuring this operation is simple, I am following the documentation. An ajax call returns a dataset in JSON format. The table is cleared successfully, but even though data is returned according to the console statement, the table remains empty after the su ...

Use JavaScript to swap out various HTML content in order to translate the page

I am currently facing a challenge with my multilingual WordPress website that utilizes ACF-Field. Unfortunately, WPML is not able to translate the field at the moment (2nd-level-support is looking into it). As a solution, I have been considering using Java ...

Preventing Copy and Paste and Right-Click Actions With JavaScript

Similar Question: How can I prevent right-click on my webpage? Looking to prevent right-clicking and key combinations like Ctrl+V & Ctrl+C on a webpage using JavaScript. I have a form where customers need to input their details, and I want to avoid ...

Instructions on keeping a numerical counter at its current value for all site visitors

Recently, I integrated a number counter into my website. However, I am facing an issue where the count resets to zero whenever a new visitor accesses the site. I'd like the count to remain persistent and update based on the previous count. For instanc ...

In React, I am unable to invoke a function that has been assigned to an element

import React from "react"; import shortid from "shortid"; export default class App extends React.Component { state = { items: [], text: "" }; handleTextChange = event => { this.setState({ text: event.target.value }); }; ...

The specialized element encountered an issue with mapping

For a while now, I've been trying to create my own custom component but it's not working as expected. The interaction seems fine, but for some reason, it only renders the last item in the arrays. export default class MyComponent extends Comp ...

Having trouble with updating a Firebase database object using snap.val()

I'm trying to figure out how to update a property within the snap.val() in order to make changes to my Firebase database. function updateListItem(listItem) { var dbRef = firebase.database() .ref() .child('userdb') .child($sco ...

What steps can be taken in Javascript to handle a response status code of 500?

I am currently utilizing a login form to generate and send a URL (referred to as the "full url" stored in the script below) that is expected to return a JSON object. If the login details are accurate, the backend will respond with a JSON object containing ...