2017-10-16 78 views
0

串聯的多個數據。在這種系列中的「yfield定義」的docs說:EXTJS 4.2圖表內襯yfield

對應於數據模型字段(一個或多個)的名稱(S) y軸值(s)。

接下來,我試圖將兩個數據模型字段添加到行系列的相同yfield。

這是一個正常的例子:example1

this example,如果我試圖把兩個數據模型場在意甲的相同yfield,行在前看不見,但在傳說我看到兩個數據名稱。

代碼中有什麼問題,或者我錯過了什麼?

編輯1

也許我已經解釋過自己錯了,該解決方案Gilsha提出相同的example1代碼。

我想是這樣的:

enter image description here

正弦和餘弦數據在同一個系列,每個值不是一個單獨的系列。

回答

0

您將不得不在軸和多行系列中添加多個字段標籤以繪製每行,如下所示。

series: [{ 
     type: 'line', //Plots sin 
     axis: 'left', 
     xField: 'theta', 
     yField: 'sin', 
     smooth: true, 
     style: { 
      'stroke-width': 4 
     }, 
     markerConfig: { 
      radius: 4 
     }, 
     highlight: { 
      shadow: false, 
      fill: '#000', 
      radius: 5, 
      'stroke-width': 2, 
      stroke: '#fff' 
     } 
    }, { 
     type: 'line', //Plots cos 
     axis: 'left', 
     xField: 'theta', 
     yField: 'cos', 
     smooth: true, 
     style: { 
      'stroke-width': 4 
     }, 
     markerConfig: { 
      radius: 4 
     }, 
     highlight: { 
      shadow: false, 
      fill: '#000', 
      radius: 5, 
      'stroke-width': 2, 
      stroke: '#fff' 
     } 
    },{ 
     type: 'line', //Plots sin 
     axis: 'left', 
     xField: 'theta', 
     yField: 'tan', 
     smooth: true, 
     style: { 
      'stroke-width': 4 
     }, 
     markerConfig: { 
      radius: 4 
     }, 
     highlight: { 
      shadow: false, 
      fill: '#000', 
      radius: 5, 
      'stroke-width': 2, 
      stroke: '#fff' 
     } 
    }]