10
09/2014
flot toggle
flot 显示|隐藏 有两个思路:
思路一 直接在 flot 修改 series
缺点是:不重画。关掉大数据后,小数据仍然拘泥于一角,不肯放开
function togglePlot(somePlot,seriesIdx){
var someData = somePlot.getData();
someData[seriesIdx].lines.show = !someData[seriesIdx].lines.show;
someData[seriesIdx].points.show = !someData[seriesIdx].points.show;
somePlot.setData(someData);
somePlot.draw();
}
思路二 修改 data 本身,然后画 flot