我使用Chart.js版本:2.1.6来创建雷达图,如下所示: 我正在尝试禁用点标签(图片上标记为红色)。
我尝试了几种方法,并且最后将标签字体大小设置为0,但它没有效果。 请帮助,如果可以的话,这是我的代码:
var radarChartData = {
labels: ["some labels"],
datasets: [
{% for data in datas %}
{
backgroundColor: "rgba({{ radarColors[loop.index0] }},0.2)",
borderColor: "rgba({{ radarColors[loop.index0] }},1)",
pointBackgroundColor: "rgba({{ radarColors[loop.index0] }},1)",
pointBorderColor: "#fff",
pointHoverBackgroundColor: "#fff",
pointDot: false,
pointLabelFontSize : 0,
scaleShowLabels : false,
pointHoverBorderColor: "rgba({{ radarColors[loop.index0] }},1)",
data: [some data]
} {% if not loop.last %},{% endif %}
{% endfor %}
]
};
var options = {
responsiveAnimationDuration: 2000,
maintainAspectRatio: false,
pointDot: false,
pointLabelFontSize: 0,
legend: {
position: "bottom",
display: false
},
pointLabel: {
fontSize: 0
},
scale: {
ticks: {
display: false
},
}
};
var ctx = $('#radar-chart').get(0).getContext("2d");
var mychart =
new Chart(ctx, {
type: 'radar',
data: radarChartData,
options: options
});