Connect two data series

瀏覽次數:67 次
跳到第一則未讀訊息

cmot...@stackbuilders.com

未讀,
2015年11月12日 下午5:43:322015/11/12
收件者:Flot graphs
Hello.
I was wondering if there is any way in which I can connect two data series when they are displayed like lines. I mean:
- I have two data series: d1 = { "color":"red", "data": [[1,2],[3,4],[5,6]], ...} and d2 = { "color":"blue", "data": [[2,4],[9,4],[1,6]], ...}.
- And to display the data series I just do: data = [d1, d2] and $('#placeholder').plot(..., data, ...). However, I display two lines, but I just need one.
Is this possible? If it is, please help me with that. Thank you.

Tim Schneider

未讀,
2015年11月16日 凌晨3:59:182015/11/16
收件者:flot-...@googlegroups.com
Hey,

I'm not quite sure I understand your question correctly.

The data in your example is, of course plotted as two separate lines, as you define two data sets. Each data set is plotted as one line.
You could join the data points of the two sets into one set which would result in just one line. In that case, however they will be all in the same color.
eg: data = [{"color": "red", "data" [[1,2],[3,4],[5,6],[2,4],[9,4],[1,6]]}]

What are you trying to achieve?

- Tim


--

---
You received this message because you are subscribed to the Google Groups "Flot graphs" group.
To unsubscribe from this group and stop receiving emails from it, send an email to flot-graphs...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

signature.asc
回覆所有人
回覆作者
轉寄
0 則新訊息