代码之家  ›  专栏  ›  技术社区  ›  Pedro Costa

chart.js-显示在条形图中间的条形图值

  •  2
  • Pedro Costa  · 技术社区  · 8 年前

    我有一个默认的条形图,它在条形图中显示条形图值。我不想让人看到

    enter image description here

    这是图表的代码:

    myChart = new Chart(ctx, {
      type: 'bar',
      data: {
          labels: labels,
          datasets: datasets
      },
      options: {
          scales: {
              yAxes: [{
                  ticks: {
                      beginAtZero:true
                  }
              }]
          },
          maintainAspectRatio: false
      }
    });
    

    是否有任何选项可以禁用此行为?

    最好的问候

    1 回复  |  直到 8 年前
        1
  •  1
  •   Pedro Costa    8 年前

    解决问题:

    脚本中包含了datalabels插件,并正在条上写入值。

    推荐文章