how to set a min and a max value in the radar chart


Topic: how to set a min and a max value in the radar chart

dreadiin asked 6 years ago

I want to set a value of min 0 and max 25 by default in my radar chart


Anna Morawska staff answered 6 years ago

Hi there, 

you can set a min and max value displayed on axies like this, using scale proprtty

var ctxR = document.getElementById("radarChart").getContext('2d');
    var myRadarChart = new Chart(ctxR, {
type: 'radar',
data: {
labels: ["Eating", "Drinking", "Sleeping", "Designing", "Coding", "Cycling", "Running"],
datasets: [{
label: "My First dataset",
data: [11, 23, 3, 18, 20, 14, 8],
backgroundColor: [
'rgba(105, 0, 132, .2)',
],
borderColor: [
'rgba(200, 99, 132, .7)',
],
borderWidth: 2
},
{
label: "My Second dataset",
data: [1, 6, 7, 23, 2, 5, 18],
backgroundColor: [
'rgba(0, 250, 220, .2)',
],
borderColor: [
'rgba(0, 213, 132, .7)',
],
borderWidth: 2
}
]
},
options: {
responsive: true,
scale: {
ticks: {
beginAtZero: true,
max: 25,
min: 0
}
}
}
});

Please insert min. 20 characters.

FREE CONSULTATION

Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.

Status

Resolved

Specification of the issue
  • User: Free
  • Premium support: No
  • Technology: MDB jQuery
  • MDB Version: 4.5.15
  • Device: windows
  • Browser: goolge
  • OS: windows
  • Provided sample code: No
  • Provided link: No
Tags