Description Usage Arguments Details Value Author(s) References See Also Examples
View source: R/protovis.marks.R
Add a line to the visualization.
1 |
bottom.name |
The name of the field in the supplied data frame or vector. |
left.name |
The name of the field in the supplied data frame or vector. |
bottom.scale |
The name of the field in the supplied data frame or vector. |
left.scale |
The name of the field in the supplied data frame or vector. |
... |
The parameters from pv.chart |
pv.line
Adds a line plot to the visualization
A wv object.
Shane Conway shane.conway@gmail.com
http://vis.stanford.edu/protovis/
pv.chart
that creates the webvis object.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 | #pv.line()
#pv.line(anchor="top")
#pv.line(data=c(1, 1.2, 1.7, 1.5, .7, .5, .2), bottom.name="y", left.name="x", bottom.scale="linear.y.y", left.scale="linear.x.x", line.width=5, render=TRUE)
# line example 1
pv.line(data=c(1, 1.2, 1.7, 1.5, .7, .5, .2), render=FALSE)
pv.line(data=data.frame(z=c(1, 1.2, 1.7, 1.5, .7, .5, .2)), bottom.name="z", render=TRUE)
pv.line(data=c(1, 1.2, 1.7, 1.5, .7, .5, .2), bottom.name="y", left.name="x", bottom.scale=NULL, left.scale="linear.x.x", render=TRUE)
# line example 1 (using layers)
wv <- pv.panel(width=150, height=150)
render.webvis(wv + pv.line(wv=wv, data=c(1, 1.2, 1.7, 1.5, .7, .5, .2), bottom.name="y", left.name="x", bottom.scale="linear.y.y", left.scale="linear.x.x"))
# line example 2 (need to make sure that it doesn't go over the edge
wv <- pv.panel(width=150, height=150)
wv <- wv + (pv.line(wv=wv, data=c(1, 1.2, 1.7, 1.5, .7, .5, .2), bottom.name="y", left.name="x", bottom.scale="linear.y.y", left.scale="linear.x.x")
+ pv.dot())
render.webvis(wv)
# line example 4
wv <- pv.panel(width=150, height=150)
render.webvis(wv + pv.line(wv=wv, data=c(1, 1.2, 1.7, 1.5, .7, .5, .2), top.name="y", left.name="x", top.scale="linear.y.y", left.scale="linear.x.x"))
# line example 5
wv <- pv.panel(width=150, height=150)
render.webvis(wv + pv.line(wv=wv, data=c(1, 1.2, 1.7, 1.5, .7, .5, .2), top.name="y", right.name="x", top.scale="linear.y.y", right.scale="linear.x.x"))
# line example 7
wv <- pv.panel(width=150, height=150)
render.webvis(wv + pv.line(wv=wv, data=c(1, 1.2, 1.7, 1.5, .7, .5, .2), bottom.name="y", left.name="x", bottom.scale="linear.y.y", left.scale="linear.x.x", interpolate="step-after"))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.