Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

400
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda