0

I have a vertical bar chart with chartjs and each bar have in the top a label of 100% but the value of the bar is not 100%, that is a wrong value, i need to remove that label.

I tried to put label display in false and remove extra code to see if the label disappear but nothing happens.

javascript

var myBarChart = new Chart(barChartCanvas,{
    type: 'bar',
    data: {
    labels: ['satisfaccion', 'insatisfaccion'],
    datasets: [
        {                            
            data: [35, 57],
            backgroundColor: [
            '#7eb902', 
            '#f15021'
            ]
        }
    ]
    },
    options: {
        legend: {
            display: false,
        },                    
        plugins: {                        
            colorschemes: {
                scheme: 'tableau.Tableau10'
            },
        },
        scales:{
            yAxes:[
            {
                ticks:{
                    beginAtZero:true,
                    suggestedMax: 100
                }
            }
            ],
            xAxes:[
            {
                barThickness : 73
            }
            ]
        }
    }
});
Ed Bangga
  • 12,879
  • 4
  • 16
  • 30

1 Answers1

3

If you want to remove only the percentages, just add this line in your options

labels: { render: () => {} }

It will look like:

            options: { 
                plugins: {
                  labels: {
                    render: () => {}
                  }
                }
            }
Boston Kenne
  • 778
  • 10
  • 15