2013-06-18 29 views
1
$(document).ready(function(){ 
    var l0 = [6, 11, 10, 13, 11, 7]; 
    var l1 = [3, 6, 7, 7, 5, 3]; 
    var l2 = [4, 8, 9, 10, 8, 6]; 
    var l3 = [9, 13, 14, 16, 17, 19]; 
    var l4 = [15, 17, 16, 18, 13, 11]; 

    var plot1 = $.jqplot("chart1", [l0, l1, l2, l3, l4], { 
     title: "Fill between 2 lines", 
     axesDefaults: { 
      pad: 1.05 
     }, 

     fillBetween: { 
      series1: 1, 
      series2: 3, 
      color: "rgba(227, 167, 111, 0.7)", 
      baseSeries: 0, 
      fill: true 
     }, 
     seriesDefaults: { 
      rendererOptions: { 
       smooth: true 
      } 
     } 
    }); 

}); 

此示例顯示2個系列之間的填充。 我需要填寫系列1,2和3,4。 堆積填充不符合我的要求。如何在JqPlot中填充該系列?

回答

1

此功能仍然不存在。我一直在研究這個代碼的增強。 Bitbucket pull request link for the enhancement

此鏈接中的代碼更改將幫助您解決問題。

在改變代碼後,通過對系列1和系列2的值的數組,fillbetween屬性:您將能夠填補系列1,2和3,4

fillBetween: { 
     series1: [1,3], 
     series2: [2,4], 
     color: "rgba(227, 167, 111, 0.7)", 
     baseSeries: 0, 
     fill: true 
    } 

這種方式。

+0

非常感謝您的提升!我已將它移植到Github。 https://github.com/jqPlot/jqPlot/pull/34 – user1158559