2017-10-16 51 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' 
     } 
    }]