[英]Flot: Threshold Failing to Show on Vertical Bar Graph
我試圖將閾值添加到垂直條形圖中,但是由於任何原因,它們都無法顯示。
這是我的圖表設置:
var metOptions = {
series:{
bars: {
show: true,
align: "center",
barWidth: 24 * 60 * 60 * 600,
lineWidth: 1,
fill: 0.7,
},
},
xaxis: {
mode: "time",
axisLabel: "Date",
axisLabelUseCanvas: true,
axisLabelFontSizePixels: 12,
axisLabelFontFamily: 'Verdana, Arial',
axisLabelPadding: 10,
color: "black",
},
yaxes: [{
position: "left",
min: 90,
max: 100,
color: "black",
tickDecimals: 2,
axisLabelUseCanvas: true,
axisLabelFontSizePixels: 12,
axisLabelFontFamily: 'Verdana, Arial',
axisLabelPadding: 3
}
],
legend: {
noColumns: 1,
labelBoxBorderColor: "#000000",
position: "ne"
},
grid: {
hoverable: true,
borderWidth: 2,
mouseActiveRadius: 50,
backgroundColor: { colors: ["#ffffff", "#EDF5FF"] },
axisMargin: 20
},
tooltip: true,
tooltipOpts: {
content: "%x, %y%"
}
};
這是我的數據集定義:
var dataset = [
{
label: "Metalization",
data: chartData,
color: "#F00",
threshold: [
{
below: 95,
color: "rgb(0, 0, 255)"
},
{
below: 94,
color: "rgb(0, 255, 0)"
}
],
}
]
$.plot($("#metal-variance"), dataset, metOptions);
這是我目前正在測試的數據:
[[1445144400000,95.76],[1445230800000,95.83],[1445317200000,93.99],[1445403600000,94.57],[1445490000000,93.37],[1445576400000,88.53]]
X是時間戳記,Y是值。
這是生成的圖形的屏幕截圖: Flot Graph
因此,我設置了閾值,以便如果該值低於94,則該條應為綠色,但是從圖像中可以看到,第三和第五條低於94,但它們仍顯示為紅色。
任何有關此問題的幫助將不勝感激。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.