Reputation: 23
I use Chart.js Version: 2.1.6 to create a radar chart, like this:
I'm trying disable point labels (marked red on the picture).
I have tried several method, and for last set the labels font size to 0, but it didn't had effect. Please help, if you can, here is my code:
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
});
Upvotes: 2
Views: 4697