我已将正面和负面数据合并到一个名为 yAxis 的数据集(正面和负面的多列)。这是代码:
//...
var yAxis = [wololoTotalValues];
var xAxis = wololoTotalKeys;
window.onload = function () {
Flotr.draw(document.getElementById("chart"), yAxis, {
title: "wololo",
bars: {
show: true,
barWidth: 0.8
},
yaxis: {
min: 0,
max: wololoMaxValue + 10,
tickDecimals: 0
},
xaxis: {
ticks: xAxis
}
});
};
//...
<div id='chart' style="width:1200px;height:500px;"></div>
我希望'bad'和'ble'是红色的。我找到了一些手册如何用 flot 处理这个问题,但不是 flotr(flotr2)。
有没有办法让它像下面这样?或者也许我必须像这里一样拆分数据?
colors: (yAxis[0-lastGood] : "#0000FF"), (yAxis[lastGood+1-lastBad] : "#FF0000")