1
我使用flot來繪製圖形。我想實現這樣的功能,使得我能夠突出顯示我的圖形中10%的增長,並以與現在使用的顏色不同的顏色顯示。 我使用的代碼是:使用flot api實施條形圖閾值
var options_blue = {
series: {
color: 'blue',
threshold: { above: 5, color: 'green' },
bars: { show: true, barWidth: 20 * 20 }
},
xaxis: { show: false, min: 1 },
yaxis: { show: false, min: 1, max: max_value }
};
var options_red = {
series: {
color: '#ff0000',
threshold: { above: 10, color:'green' },
bars: { show: true, barWidth: 20 * 20 }
},
threshold: { above: 5, color: "yellow" },
xaxis: { show: false, min: 1 },
yaxis: { show: false, min: 5, max: max_value }
};
我現在用的是jquery.flot.threshold.js,但在超過閾值的圖形的顏色沒有變化。
我糾正了代碼中的錯誤。但我仍然無法使用jquery.flot.threshold.js繪製條形圖當我使用jquery.flot.threshold.min.js時,我可以繪製兩種不同的顏色,但圖形顯示爲單行。 爲此提供了任何可能的解決方案。 – 2013-05-09 05:18:13
您需要提供更多信息; '你是什麼意思'出現一條線'?你使用的是什麼版本的Flot? JS控制檯中是否有錯誤? – DNS 2013-05-09 11:40:46