Incorporating a stylish border around the labels on a Highchart Mapchart

My Highcharts heatmap currently appears like this: https://i.sstatic.net/MCQ5T.png

Is there a method to include a border below the y-axis labels for it to resemble this design?

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

Initially, I considered using the formatter() function and applying styling to the labels with a bottom border. However, when using formatter, the labels do not align properly with the heatmap and appear slightly displaced. Using margin or offset adjustments will not suffice as we have varying numbers of y-axis labels for different purposes. https://i.sstatic.net/LpW4Z.png

This is the code snippet I am experimenting with:

yAxis: {
    min: 0,
    max: caregap_nm.length - 1,
    categories: ['APPLES', 'ORANGES', 'PEARS', 'GUAVA', 'GRAPES', 'MELONS'],
    reversed: true,
    title: {
      align: 'high',
      offset: 0,
      text: '',
      rotation: 0,
      y: -20,
      x: -25,
      style: {
        fontSize: '16px',
        fontWeight: 600,
      },
    },
    labels: {
      useHTML: true,
      align: 'left',
      x: -100,
      style: {
        fontSize: '14px',
        fontWeight: 400,
      },
      formatter() {
        return `<div class="cg-y-labels"><span>${this.value}</span></div>`;
      },
    },
  },

Answer №1

To achieve the desired effect of displaying only yAxis ticks under the labels, you can utilize the chart.events.renderer() callback function to remove the first tick as shown below:

chart: {
  events: {
    render: function() {
      this.yAxis[0].ticks[-1].destroy();
    }
  }
},
yAxis: {
  tickWidth: 1,
  tickLength: 100
},

Check out the demo here: https://jsfiddle.net/BlackLabel/5fdan8rL/
For more information, refer to the Highcharts API documentation: https://api.highcharts.com/highcharts/chart.events.render
Additional resources on adjusting yAxis tick width and length:
- https://api.highcharts.com/highcharts/yAxis.tickWidth
- https://api.highcharts.com/highcharts/yAxis.tickLength

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

Adjust the vertical size of the background hue on the span element within the text

Can the height of the background color in my span be adjusted? HTML <span class="highlight">Some highlighted text</span> CSS .highlight{ font-family: 'Roboto', sans-serif; font-weight: 300; font-size: 1.5em; backgr ...

Steps to access a unique custom drop-down menu in an upward direction

Presently, I am developing a customized AngularJS drop-down feature, which is outlined in the following HTML structure: <div> <label></label> <div> <a ng-class="{active: popover}"> <div></div> <!- ...

JS glitch leading to oversized window dimensions - Issue with dropdown menu

I recently integrated a dropdown into my website using Foundation CSS. To see the dropdown in action, you can login with the credentials provided (username: stackoverflow password: testtest) on . However, I noticed that when logged in, the page on the rig ...

Establish a dynamic video backdrop for Bootstrap's Jumbotron element

Is there a way to set a video as the background of this jumbotron and ensure that it fills the entire space while still being responsive? Link to Bootstrap documentation on jumbotron <div class="jumbotron"> <div class="container"> <h ...

Using CSS in Rails based on a certain condition

My project involves creating an app with a specific view. Within this view, I must check a condition and if it is met, I need to color a table row accordingly. While the simplest solution would be to modify the header within the view, I prefer to keep al ...

Establish a connection between an Angular Docker container and an Asp.Net container

A program was developed with three main components: a database (MS SQL Server), backend (Asp.Net Core), and frontend (Angular 8). The program is run using docker-compose: services: sqlserver: image: mcr.microsoft.com/mssql/server:2019-latest ...

Manipulating the visibility of components by toggling on click events according to the existing state in ReactJS

Disclosure: I am still getting familiar with ReactJS I'm currently working on incorporating a dialog window for selecting a country/language on the initial page of my application. Here's the concept: There's a small flag button in the to ...

How to set a default option in a dropdown menu using Angular 4

Many questions have been raised about this particular issue, with varying answers that do not fully address the question at hand. So here we go again: In my case, setting the default value of a dropdown select by its value is not working. Why is that so? ...

What are some tips for keeping design proportions consistent on mobile apps?

Hey there, I have a question that may seem basic to some, but as a newbie in coding, I appreciate your patience. I've been working on an Ionic app and I'm struggling with maintaining CSS proportions of HTML elements. For instance, here's th ...

Having trouble getting SCSS to function properly? (Updated Code)

Transitioning from CSS to SCSS is my current project. I decided to make the switch because of SCSS's nesting capabilities, which I find more convenient for coding. However, I'm facing some challenges getting it to work properly. In my regular CSS ...

Tips for utilizing a formatter with a Doughnut chart in Angular using Chart.js

When using Chart.js with AngularJS, I tried to display numbers or percentages in a doughnut chart using a formatter. However, it did not work as expected. Here is how I implemented it in my HTML: <canvas baseChart class="chart" [data]="do ...

Error in Angular 8: Module loading from "url" has been intercepted due to an unsupported MIME type ("text/html") being blocked

I have developed an application using Angular 8 and Node 12. When I try to open a new tab or reload the page after building Angular 8, I encounter an issue for which I have extensively searched online but found no solution. In the Firefox console, the er ...

You cannot assign type void to type any

I'm currently working on a component that involves some code: export class AddNewCardComponent { public concept = []; constructor( private _router: Router, private _empDiscService: empDiscService) { } ngOnIni ...

The Mat-paginator is refusing to align to the right edge when scrolling the table horizontally in an Angular application

https://i.sstatic.net/l0cZ4.png Overview: My Angular component features a table with Angular Material's mat-table and paginator. Despite fetching data from a source, the paginator fails to float right when I scroll horizontally. Sample Code: <!- ...

Using Jquery's prependTo method will add a display:block property to

Can't find a solution to this issue. This is the code snippet in question: var new_img = '<img id="' + drag_id + '" rel="' + drop_id + '" class="' + gallery_link + ' drop_out" src="' + drag_src + '" /& ...

Eliminate the delicate border in header images using bootstrap

I am struggling with some code that includes bootstrap and an SVG sprite in a header/menu, but there is a thin gray background line appearing in the icons. Here is the link to the code on CodePen Can anyone please help me solve this issue? I've trie ...

Angular 8: ISSUE TypeError: Unable to access the 'invalid' property of an undefined variable

Can someone please explain the meaning of this error message? I'm new to Angular and currently using Angular 8. This error is appearing on my console. ERROR TypeError: Cannot read property 'invalid' of undefined at Object.eval [as updat ...

"Enhancing visual effects with personalized animations in Highcharts using setSeries or setCategories

I successfully created a customized highchart graph with 3 added buttons. An example can be viewed here: http://jsfiddle.net/eszwd420/ $(function () { var averageLabel =[1278302400000, 1286251200000, 1294203600000, 1301976000000, 13098384000 ...

Superimpose two actionlinks and prioritize the one appearing above

I have implemented a menu similar to http://tympanus.net/Tutorials/SlideDownBoxMenu/. Below this menu, I have placed a webgrid. The issue I am facing is that when I hover over the menu, the slidedownbox with two action links pops up directly over the heade ...

How to Generate Slanted Header Text Using Only CSS

What is the method for creating a diagonal heading line using only CSS, as shown in the image below: ...