how to change size of point in ChartJS
You would have to set the pointRadius
property to 1
as well (so the point becomes small initially), along with the pointHoverRadius
(remains small on hover)
pointRadius: 1,
pointHoverRadius: 1
It indeed needs to go in the dataset, like so:
{
type: 'scatter',
data: {
labels: ['2015', '2016', '2017', '2018', '2019', '2020'],
datasets: [
{
label: 'Cars',
data: [{x:-10,y:0}, {x:0,y:10}, {x:10,y:5}, {x:4,y:8}],
pointRadius: 10,
....
},
{
label: 'Bikes',
data: [{x:10,y:3}, {x:-2,y:6}, {x:9,y:3}, {x:11,y:6}],
pointRadius: 10,
...
}
]
},
options: {
...
}
}