2013-06-20 114 views
0

I「使用米插件‘flotr2’到我的應用程序顯示折線圖懸停在線flotr2 - 在折線圖

我有當我懸停上的點來顯示工具提示和另一工具提示當我懸停。行了。

我在「跟蹤」參數的「鼠標」字段中選擇使用。 我看到有anoter參數調用「trackAll」。 這是對我不好,becasue它顯示所有的時間tooltip,而不只是當我在線上。

這是我的代碼:

dataArray.push({ 
     data: createDataObject(data), 
     lines: { 
      fill: true, 
      show: true, 
      fillOpacity: 0.1 
     }, 
     points: { 
      show: true, 
      fillOpacity: '0', 
      radius: 2, 
      lineWidth: 2 
     }, 
     mouse: { 
      data: data, 
      track: true, 
      position: 'n', 
      relative: true, 
      trackFormatter: function (obj) {      
       return setTooltipData(data, obj);      
      }, // => formats the values in the value box 
      margin: 7, // => margin in pixels of the valuebox 
      lineColor: '#FFFFFFFF', // => line color of points that are drawn when mouse comes near a value of a series 
      trackDecimals: 1, // => decimals for the track values 
      sensibility: 3, // => the lower this number, the more precise you have to aim to show a value //hover area 
      trackY: true, // => whether or not to track the mouse in the y axis 
      radius: 2, // => radius of the track point 
      lineWidth: 2, 
      fillColor: null, // => color to fill our select bar with only applies to bar and similar graphs (only bars for now) 
      fillOpacity: 1 // => opacity of the fill color, set to 1 for a solid fill, 0 hides the fill 
     } 
    }); 

回答

0

嘗試將鼠標設置爲「track:!0,trackAll:!1」。