Show line chart and scatter chart in one VizFrame

五迷三道 提交于 2019-12-12 04:08:10

问题


I have VizFrame scatter chart and I need to add there some data represented by line. I was trying to do this by adding reference line (plotArea.referenceLine.line), but it looks like the input can be just one value for this property, so the reference line is always perpendicluar one the axis (please see example).

The data I would like to add as a line are saved under the "Line" name:

var oData =  [
                {                     
                    "Z": "A",
                    "X": 171.9,
                    "Y": 183,
                    "Line": 176.7
                },
                {                    
                    "Z": "B",
                    "X" : 144.3,
                    "Y": 158.6,
                    "Line": 163.3
                },
             //....and so on, more in the example
}]; 

Is there any way how to show line chart and scatter chart in one VizFrame?


回答1:


The VizFrame supports "combined" charts. Unfortunately, I don't think that you can combine scatter and line charts. Check our my answer from here: https://stackoverflow.com/a/43014985/7612556.

  • You cannot add "oblique" reference lines (= the trend line) to the chart. You can only add vertical / horizontal ones via the Reference Line feature. Check out the (non-intuitive) documentation on this: Viz Charts Documentation (look at the plotArea.referenceLine.line; it is just a number = will be a horizontal / vertical line depending on your chart type or orientation).
  • You cannot combine a scatter plot with a line chart. If you look in the same Viz Charts Documentation, you will see that in the Combination "chapter" on the left hand side, there is no "Line - Scatter" combination.


来源:https://stackoverflow.com/questions/43013842/show-line-chart-and-scatter-chart-in-one-vizframe

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!