Chart showing data values on a spider web diagram using HighCharts

My spider chart created with highcharts is displaying the data points on the far left side. I'm using this example as a reference. Below is my code snippet:

<div id="container2" style=" position: relative;"></div>

<script>
    $(function () {

        $('#container2').highcharts({

            chart: {
                polar: true,
                type: 'line',
                margin: 0
            },

            exporting: {
                enabled: false,
                buttons: {
                    enabled: false
                }
            },

            title: {
                text: '&nbsp',
                x: -80,
                useHTML: true
            },

            pane: {
                size: '70%'
            },

            xAxis: {
                categories: ['Math', 'Comp. Sci', 'Science', 'Social Sci.', 'English', 'Hindi'],
                tickmarkPlacement: 'on',
                lineWidth: 0,
                labels: {
                    align: 'center',
                    distance: 43
                }
            },

            yAxis: {
                gridLineInterpolation: 'polygon',
                lineWidth: 0,
                min: 0,
                endOnTick: true,
                showLastLabel: true,
                tickPositions: [0.2, 0.4, 0.6, 0.8, 1.0]
            },

            tooltip: {
                shared: true,
                headerFormat: '<span style="font-size: 12px">{point.key}:</span>&nbsp;&nbsp;<b>{point.y:,.2f}</b>',
                pointFormat: '',
                useHTML: true
            },

            legend: {
                enabled: true,
                align: 'right',
                verticalAlign: 'top',
                y: 30,
                layout: 'vertical'
            },

            series: [{
                name: 'Grade Distribution',
                data: [.8, .95, .7, .35, .6, .3],
                pointPlacement: 'on',
                color: 'black',
                fillOpacity: 0.2
            }]

        });
    });

I've checked for any CSS interference in my code, but couldn't find anything. Any thoughts on what might be causing this alignment issue?

https://i.sstatic.net/SSYUc.png

Answer №1

No problems have been detected with the code,

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

Check out the DEMO here

Answer №2

If you're experiencing issues, it may be due to using an outdated version of highchart. Updating to the latest version solved the problem for me.

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

The HTML element cannot be set within page.evaluate in Node.js Puppeteer

I've run into an issue while using node.js puppeteer, specifically with the page.evaluate method. I'm experiencing difficulties with this part of my code: console.log(response); //This line is valid as it prints a regular string awa ...

If a user cancels, the radio button in Vue 3 will revert back to

I'm encountering a problem with radio buttons in vue 3. When passing an object from the parent component to the child for data display, I want to set one version as default: <template> <table> ... <tr v-for="(v ...

What is the reason for the bypassing of Mongoose middleware by .findByIdAndUpdate?

I've been looking for an answer to this question, but I'm a beginner and the explanations are a bit too technical for me. I am currently using bcrypt for password hashing and have set up my schema to use middleware to check if a user changes thei ...

Creating a Typescript constructor and factory function with the same name: a complete guide

I have a Typescript definition file to create for a pre-existing Javascript library. Within this library, there are functions that can act as constructors or factories. How should I structure the typings to accommodate both? For reference, here are specif ...

Experience a unique full-screen video background on page load with this innovative JavaScript feature! Visit the included JS

Looking to enhance my website by displaying a random fullscreen background video selected from a folder of videos that I will manage. The goal is to steadily increase the number of videos in the folder (e.g., bg1.mp4, bg2.mp4, etc...) and have the code aut ...

Designing Checkbox features with Bootstrap Glyphicons

I have successfully created a set of bootstrap icons functioning as radio buttons. Now, I am trying to achieve a similar effect with checkboxes, allowing users to select and store multiple options. I am struggling to figure out the best approach to impleme ...

Inequality in spacing between Bootstrap columns

I am currently working on a website where the home page has columns with icons and text. The issue arises on mobile devices as the columns stack unevenly due to varying text lengths, resulting in inconsistent vertical spacing. Is there a way to ensure cons ...

The grayscale effect is not functioning on the default web browser of an Android device

I have implemented a grayscale effect for an image using the following CSS code snippet: img.grayscale { filter: url("data:image/svg+xml;utf8,<svg xmlns=\'http://www.w3.org/2000/svg\'><filter id=\'grayscale\&apo ...

What is the best way to integrate this Google Dialogflow code into a TypeScript-based React application?

The integration of your chatbot into an HTML page using Google Dialogflow includes the following code snippet: <script src="https://www.gstatic.com/dialogflow-console/fast/messenger/bootstrap.js?v=1"></script> <df-messenger inten ...

Is there a way to showcase my JavaScript within my <p> elements in a single line statement?

I am currently working on a script that is able to display the date 2 weeks in the future. While everything is functioning properly, I am looking to streamline it by having the output appear in a single sentence instead of two separate paragraphs. Unfort ...

What is the method for retrieving the data shown in a KendoGrid in JSON format?

I am working with a kendoGrid and my goal is to extract the filtered and sorted data in JSON format. How can I accomplish this? For example, something along these lines, var grid = $("#grid").data("kendoGrid"); alert(grid.dataSource.data.json); // I hav ...

Obtaining the "match" object within a Custom Filter Selector on jQuery version 1.8

Here's a helpful resource on Creating a Custom Filter Selector with jQuery for your reference. A Quick Overview: If you're unfamiliar with jQuery's Custom Filter Selectors, they allow you to extend jQuery’s selector expressions by addi ...

Cookies cannot be used in browsers other than Chrome, nor can HTML5 local storage

Currently, I am developing a javascript tool that is designed to save a user's selections locally and then reload them when the page is revisited. While this feature works perfectly in Chrome, it seems to be non-functional in IE8 and Safari. I have e ...

The functionality of jQuery is completely non-functional in this case

I've been attempting to populate my HTML using jQuery fetched from a JSON file loaded through a getJSON call. However, none of my jQuery code seems to be functioning as expected. Here's a peek at my HTML structure: <!doctype html> <htm ...

Adjusting the size of a v-image in Vuetify to perfectly fit the screen dimension

I have a photo gallery on my Vue page, and when a photo is selected, a dialog pops up by setting the selectedCard. However, the image does not fit the size of the screen and only half of it is visible. I have tried setting the CSS with max height or widt ...

Arranging Bootstrap Carousel cards in a top-down position

When using Bootstrap Cards in a horizontal carousel, each card's height is dynamically adjusted based on the length of the copy. However, there is an issue where the cards appear positioned at the bottom of the carousel instead of aligning to the top ...

Can AJAX function properly when the server-side code is hosted on a separate domain?

After opening Firefox's scratchpad and inputting the following code... function ajaxRequest() { var xmlhttp; var domainName = location.host; var url = 'http://leke.dyndns.org/cgi/dn2ipa/resolve-dns.py?domainName='; url = url + domainName + ...

How to showcase arrays using a variety of vibrant colors

In my web application, users input a paragraph and the backend system scans it to identify hard and very hard sentences. My goal is to display the entire paragraph with these difficult sentences highlighted in yellow and red backgrounds respectively, while ...

unordered list tag not successfully transmitting data to the $_POST superglobal array

Can someone help me figure out how to send the selected option from a dropdown menu in a form to a PHP $_POST variable? I've tried following a solution from this post without success. The dropdown menu is part of a signup form I found on this bootstr ...

Toggle between FlyControls and OrbitControls in ThreeJS when the mouse is clicked

I had been using something similar to this: How to switch between TrackBall and FlyControls in three.js? However, when I try to switch from FlyControls to OrbitControls, the rotation feature becomes unresponsive after clicking to rotate. It seems like th ...