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

222
Visualizações
Disable data overlap in donut chart in Highcharts

I am working on a donut chart in Highcharts where I am displaying some data. The thing is that when the donut chart is displayed there is a little bit of overlap between the types of data. If you would like to see the chart in jsfiddle, here is the html for it

<script src="https://code.highcharts.com/highcharts.js"></script>

<div id="container" style="height: 400px"></div>

and the js code

Highcharts.chart('container', {
    chart: {
        type: 'pie',
        margin: [0, 0, 0, 0]
    },

    xAxis: {
        categories: ['Jan', 'Feb', 'Mar']
    },
    plotOptions: {
        pie: {
                startAngle: 90,
            innerSize: '99%',
            borderWidth: 16,
            slicedOffset: 40,
            borderColor: undefined,
            dataLabels: {
                enabled: false
            },
            states: {
                hover: {
                    brightness: 1,
                    halo: {
                        size: 0
                    }
                }
            }
        }
    },
    series: [{
        data: [29.9, 71.5,50]
    }]
});

If you hoover over one of the series in the donut chart, the line reaches into the other one. My question is that is there an option so the lines won't overlap each other, so the end is not rounded but have sharp edges that do not overlap? Thank you for any help.

about 4 years ago · Juan Pablo Isaza
2 Respostas
Responde à pergunta

0

There are two approaches.

  • you can use this custom code - but it works with the previous version of highcharts (8) - demo: http://jsfiddle.net/BlackLabel/72015ojz/
  • you can add some dummy points between the current one, set their visibility as false and set the series.ignroeHiddenPoint as false - https://jsfiddle.net/BlackLabel/h2m0e35a/ - here you will need to implement some logic to calculate the amount and the values of those dummy points.
about 4 years ago · Juan Pablo Isaza Relatório

0

Eventually I managed to figure it out. All I had to do is to set the borderWidth to 0 and change the innerSize e.g 80% (this one depends on how wide you want the donut to be).

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