chartjs - 编辑或删除标签

时间:2016-06-09 00:56:59

标签: chart.js

请原谅我的英语,但这很糟糕。我有一个问题,我无法解决。

如何编辑标签的背景(或删除此信息)

http://s33.postimg.org/5ayxjlkcv/eac8a54f51_1.jpg

我在文档中找不到它。

这是我的代码:

http://codepen.io/anon/pen/XKXJEr

var ctx = document.getElementById("myChart");
Chart.defaults.global.defaultFontColor = '#ccceee';
Chart.defaults.global.elements.line.backgroundColor = '#fff';
var toto = new Chart(ctx, {
  type: 'radar',
  data: {
    labels: ["eat","sleep","drink","run","empty"],
    datasets: [
      {
        label: "Day",
        backgroundColor: "rgba(0,204,255,0.5)",
        borderColor: "rgba(255,255,255,1)",
        borderWidth: "1px",
        pointBackgroundColor: "rgba(255,99,132,1)",
        pointBorderColor: "#fff",
        pointHoverBackgroundColor: "#fff",
        pointHoverBorderColor: "rgba(255,99,132,1)",
        data: ["135","145","5","125","12"]                    },
      {
        label: 'Average',
        backgroundColor: "rgba(255,162,0,0.8)",
        borderColor: "rgba(255,255,255,1)",
        borderWidth: "1px",
        pointBackgroundColor: "rgba(255,99,132,1)",
        pointBorderColor: "#fff",
        pointHoverBackgroundColor: "#fff",
        pointHoverBorderColor: "rgba(255,99,132,1)",
        data: ["70","75","45","87.5","20.5"]                    }
    ]
  },
  options: {
    legend: {
      position: 'bottom',
    },
    title: {
      display: true,
      text: 'Your Progress'
    }
  }
});

1 个答案:

答案 0 :(得分:1)

进行更改

options: {
    scale: {
       ticks :{
         fontColor: '#ff0000',
         backdropColor: '#00FF00'
       } 
    }
  }

隐藏:

scale: {
       ticks :{
         display: false
       } 
    }

scale: {
       ticks :{
         showLabelBackdrop: false
       } 
    }