控制哪些线有分? [英] Control which lines have points?
本文介绍了控制哪些线有分?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
使用Chart.js,可以在图形选项中设置是否显示点:
With Chart.js, you can set in the options of the graph to show points or not:
pointDot: true,
我有一个包含三个静态线和一个显示一些波动的线的图形。我希望直线上没有点,但波动线表示这些点。线上是否有可以将磅值设置为零的设置?
I have a graph with three static lines and one line that shows some fluctuations. I'd like the straight lines not to have points but the fluctuation line show the points. Is there a setting somewhere on the line that I can set the point size to nothing?
**编辑**
每一行都是其自己的数据集,配置如下:
Each line is its own set of data configured like this:
datasets: [
{
label: "Cycle Time Per Last Piece",
strokeColor: "red",
fillColor: "red",
pointHighlightFill: "red",
data: [@foreach (var item in Model.DataPoints) {
@(Model.ExpectedCycleTimePerPart * 1.20M)@:,
}]
},
{
label: "Expected Cycle Time Per Part",
strokeColor: "black",
pointHighlightFill: "black",
data: [@foreach (var item in Model.DataPoints) {
@Model.ExpectedCycleTimePerPart@:,
}]
}
推荐答案
pointDot
选项驱动显示
属性,因此您可以执行以下操作
The pointDot
option drives the display
property, so you can do something like
myChart.datasets[0].points[2].display = false;
其中myChart是您的图表对象。
where myChart is your chart object.
这篇关于控制哪些线有分?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文