2013-09-26 33 views
0

我想繪製2個數據系列。隱藏數據系列點,同時顯示其他人與flot

第一個是具有時間和高度(水位)的動態系列事件。

第二個是從t = 0到indef的最大高度。

我想要第一個數據系列的點和第二個沒有點(因爲它只是一個警告線)。

到目前爲止,我嘗試了以下內容:

pl_data[0].data = plot_data; 
pl_data[1].data = plot_maxHeightCoords; 
var pl_options = { series: { 
        lines: { show: true }, 
        points: { show:[true,false] } 
        } 
}; 
$.plot("#placeholder_flot", pl_data, pl_options); 

這:

pl_options.points:[true,false]; 

然而,這不會工作。它適用於顏色,所以我想它應該爲點。

我閱讀了文檔,但找不到解決此問題的提示。

謝謝你的幫助!

回答

5

不確定我關注你的問題,但我認爲你想單獨配置每個系列,而不是在你的地塊options內。

如果對象已經創建:

pl_data[0].data = plot_data; 
pl_data[1].data = plot_maxHeightCoords; 
pl_data[0].points = {}; 
pl_data[0].points.show = true; 
pl_data[1].points = {}; 
pl_data[1].points.show = false; 

或重新創建所述數據對象:

var pl_data = [ {data: plot_data, points: {show: true}, lines: {show: true}}, 
       {data: plot_maxHeightCoords, points: {show: false}, lines: {show: true}} ]; 

$.plot("#placeholder_flot", pl_data, {}); 

這是下的文件的data format section討論。

相關問題