2017-10-16 8 views
0

계열 다중 데이터 안감 :의 ExtJS 4.2 차트 말하는 "yfield 정의"시리즈의이 종류의 <a href="http://docs.sencha.com/extjs/4.2.0/#!/api/Ext.chart.series.Line" rel="nofollow noreferrer">docs</a>에서 yfield

에 대응하는 데이터 모델 필드 (들)의 이름은 y 축 값.

이렇게하면 필자는 두 개의 데이터 모델 필드를 라인 세리의 동일한 필드에 추가하려고합니다.

하지만이 시리즈의 동일한 yfield에 두 개의 데이터 모델 필드를 넣어하려고하면 this example에서 example1는, 라인 disapears,하지만 전설에 나는 두 개의 데이터 이름을 참조하십시오

이것은 정상적인 예입니다.

코드에 문제가 있습니까? 아니면 뭔가 빠졌습니까?

EDIT 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' 
     } 
    }]