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

116
Visualizações
How to display data from top to bottom in stacked bar-chart QuickChart?

I am making a stacked bar-chart using QuickChart. The stack loads the data from bottom to top. I want it to be top to bottom, having my first entry at the top. Referring to this post, I tried adding reversed like in Highcharts, but it doesn't help.

yAxis: {
   reversed: true,
}

My chart

I have attached the chart output. I need "Count of A" on top. But "Count of E" is on top. The code for my chart seems to be irrelevant to post here, but if needed, I can add the code here. Please see what can I add to make it work.

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

0

This is because quickchart by default still uses V2 and V2 syntax is different so you will need to put it like this:

options: {
  scales: {
    yAxes: [{
      ticks: {
        reverse: true
      }
    }]
  }
},

Edit:

Chart.js draws datasets in order the are in the datasets array by default (last to first if I remember correctly). So you would need to reorder your datasets.

You can also use the order property in the dataset to specify the draw order. To make the legend the way it still is you can try to accomplish it using the sort callback. If that doesn't work you will need to provide a custom generateLabels function where you can give the items back in the order you want

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