[英]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
(悬停时仍然很小)
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: {
...
}
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.