angularjs - 倒置显示chartjs的三角形pointStyle
问题描述
是否可以将pointStyle: 'triangle'
Chart.js 倒置?
我已经在网上搜索了几个小时,试图找到如何反转三角形的解决方案,但就我的研究而言,似乎还没有解决方案(或者我可能只是看错了方向)。
我目前正在处理麻醉记录。这张图片是我的图表现在的样子。我想让红色三角形(收缩)倒置:
解决方案
您可以使用点配置rotation
的属性来控制点的绘制方式。
new Chart(document.getElementById("chart"), {
type: "scatter",
data: {
datasets: [{
pointStyle: 'triangle',
rotation: 60,
radius: 20, // just here to make the points very visible
data: [{
x: 1,
y: 1
}, {
x: 2,
y: 2
}, {
x: 3,
y: 3
}]
}]
}
});
<script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.8.0/Chart.bundle.min.js"></script>
<canvas id="chart"></canvas>
推荐阅读
- javascript - 如何通过编辑 blogspot html 代码制作一个完全空白的网站,以便我可以从头开始自定义整个网站?
- swift - 按请求呼叫请求 Alamofire swift
- spring - Spring 表达式语言问题
- unity3d - 为什么单击游戏视图中的播放按钮后,与游戏视图关联的相机会旋转(0,0,0)?(默认情况下)
- java - 即使在写入退出后,命令提示符也不会在完成后关闭
- kubernetes-helm - Helm 图表不允许我使用带有特殊字符 ex '/' 或 '=' 的值
- python - 根据一天中的时间段概率生成日期时间
- python - Pytorch:所有但一个总和?
- python - 是否可以使用神经网络/人工智能来“优化”比赛时间?
- android - 如何登录纯kotlin代码(不能使用Log.v)