I have a data frame with three columns. I need to draw a graph with multiple lines. In that graphic, each line represents one id and the x-axis represents the month column and the y-axis represent the qtd column.
+-----+-----+----+
|month| id |qtd |
+-----+-----+----+
| 1 | 1 | 1 |
| 1 | 2 | 3 |
| 1 | 3 | 6 |
| 2 | 4 | 2 |
| 2 | 5 | 3 |
| 3 | 6 | 4 |
| 3 | 7 | 5 |
| 3 | 8 | 4 |
+-----+-----+----+
DataFrame code:
l=[(1,1,1),(1,2,3),(1,3,6),(2,4,2),(2,5,3),(3,6,4),(3,7,5),(3,8,4)]
names=["month","id","qtd"]
db=sqlContext.createDataFrame(l,names)
db.show()
Desire result:
plot with x=qtd, y=month and one line for each id line
In that example I have 3 different id lines, so the graphic will be plotted with three lines, but in the real data frame, the number of ids would be unknown.
