如何在PointStyle Chartjs中造型图像
如何将图像放在点状并在其周围添加圆形的彩色边框(或带有彩色边框的IMG周围的任何形状)?我设法将图像添加到PointStyle中,但无法设置图像。非常感谢任何帮助! 我的代码:
const img = new Image(30, 30);
img.src = 'https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcStkCgp2U1hHVVtWcf_SD4tVyLqA49lhgygEed0PPPKOZxcevudk3NZ1trGyhpAAMIJysc&usqp=CAU';
const data = {
datasets: [{
label: 'First Dataset',
data: [{
x: 20,
y: 30,
}],
pointStyle: img,
backgroundColor: 'rgb(255, 99, 132)'
}]
};
const config = {
type: 'bubble',
data: data,
options: {}
};
How is to put image to pointstyle and add rounded coloured border around it (or any shape around img with coloured border)? I manage to add image to pointstyle, but can't style it. Really appreciate any help!
My code:
const img = new Image(30, 30);
img.src = 'https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcStkCgp2U1hHVVtWcf_SD4tVyLqA49lhgygEed0PPPKOZxcevudk3NZ1trGyhpAAMIJysc&usqp=CAU';
const data = {
datasets: [{
label: 'First Dataset',
data: [{
x: 20,
y: 30,
}],
pointStyle: img,
backgroundColor: 'rgb(255, 99, 132)'
}]
};
const config = {
type: 'bubble',
data: data,
options: {}
};
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论