2012-01-02 31 views
1

我有一個折線圖,其中有多個系列在4.02中。在不同的點上,系列線交叉,我需要一個特定的線作爲頂部線,即最大的z-索引(以便該線突出並顯示其懸停時的提示而不是其他線)。如何更改ExtJS折線圖系列的順序

我不想重新編序列,因爲我需要圖例序列保持不變(它們都是標題爲日期,我希望以日期順序保存它們)。

我找了一些Ext.chart.series.Line配置選項來設置z-index,但沒有成功。

我已經擴展了基本主題來爲不同的行定義自定義的筆畫寬度,所以我開始尋找某種主題選項來設置一系列z-index,但是還沒有成功。

任何想法?

編輯:

我已經添加了zIndex的配置我的擴展圖表的主題,這不會產生錯誤,但在圖表中,在與Z-索引4中列出的所有(第一輯並不能改變什麼是在底部,z軸5是倒數第二,z軸3是從底部3等),似乎它的地方過裁定:

// CUSTOM CHART THEME 
Ext.chart.theme.Events = Ext.extend(Ext.chart.theme.Base, { 
    constructor: function(config) { 
     Ext.chart.theme.Base.prototype.constructor.call(this, Ext.apply({ 
      colors: ['rgb(0, 0, 0)', 
        'rgb(0,0,255)', 
        'rgb(255,0,0)', 
        'rgb(0,128,0)', 
        'rgb(128,0,128)' 
      ], 
      seriesThemes: [{ 
       'stroke-width': 3, 
       zindex: 4 
      }, { 
       'stroke-width': 1, 
       smooth: false, 
       zindex: 5 
      }, { 
       'stroke-width': 1, 
       smooth: false, 
       zindex: 3 
      }, { 
       'stroke-width': 1, 
       smooth: false, 
       zindex: 2 
      }, { 
       'stroke-width': 1, 
       smooth: false, 
       zindex: 1 
      }]     
     }, config)); 
    } 
}); 

回答

1

好吧,我整理出來,zIndex的不是zindex中的自定義主題:

// CUSTOM CHART THEME 
Ext.chart.theme.Events = Ext.extend(Ext.chart.theme.Base, { 
    constructor: function(config) { 
     Ext.chart.theme.Base.prototype.constructor.call(this, Ext.apply({ 
      colors: ['rgb(0, 0, 0)', 
        'rgb(0,0,255)', 
        'rgb(255,0,0)', 
        'rgb(0,128,0)', 
        'rgb(128,0,128)' 
      ], 
      seriesThemes: [{ 
       'stroke-width': 3, 
       zIndex: 4 
      }, { 
       'stroke-width': 1, 
       smooth: false, 
       zIndex: 5 
      }, { 
       'stroke-width': 1, 
       smooth: false, 
       zIndex: 3 
      }, { 
       'stroke-width': 1, 
       smooth: false, 
       zIndex: 2 
      }, { 
       'stroke-width': 1, 
       smooth: false, 
       zIndex: 1 
      }]     
     }, config)); 
    } 
}); 
+0

您還可以在定義主題時定義一個系列或markerThemes對象時,使用markerConfig對象中的zIndex選項配置標記的z-index。 – 2013-10-08 17:54:43