Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

399
Views
Highcharts - overlapping values with the x-Axis

I am trying to create a line graph, wherein if all the values for the particular series is zero then, I want the line to be drawn on the bottom over the x-axis line. But it seems like the line of the x-axis takes the preference than the series line. Is there any way to change that?

Below is my configuration:

xAxis: {
    type: "datetime", 
    tickmarkPlacement: "on",
    lineWidth: 10,
    lineColor: 'red',
}, 
yAxis: {        
    min: 0, 
    minRange : 0.1,
    title: {
        text: ""
    }
}, 
plotOptions: {
    line: {
        softThreshold: false
    }
}, 

Example: http://jsfiddle.net/shivajyothibalavikas/twxs7mL2/3

In the above example the axis line color is red and series line color is black. but red takes the preference. I want the black line to take the preference while displaying

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

It is not possible to move a series line above an axis line by options in Highcharts API. As a solution, you can use the Highcharts.SVGRenderer class and draw a custom line at the chart bottom.

chart: {
  ...,
  events: {
    render: function() {
      const chart = this;
      const x1 = chart.plotLeft;
      const x2 = x1 + chart.plotWidth;
      const y = chart.plotTop + chart.plotHeight;

      if (!chart.customLine) {
        chart.customLine = chart.renderer
          .path().attr({
            stroke: 'red',
            'stroke-width': 10
          }).add();
      }

      chart.customLine.attr({
        d: ['M', x1, y, 'L', x2, y]
      });
    }
  }
}

Live demo: http://jsfiddle.net/BlackLabel/70d6sg2o/

API Reference: https://api.highcharts.com/class-reference/Highcharts.SVGRenderer

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!