Description Usage Arguments Details Value Author(s) References See Also Examples
View source: R/protovis.marks.R
Add a bar to the visualization.
1 2 |
height.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. |
height.scale |
The scale of the field in the supplied data frame or vector. |
left.scale |
The scale of the field in the supplied data frame or vector. |
bottom |
The distance from the bottom of the panel. |
scale.min |
The minimum value for the y-axis scale. |
... |
The parameters from pv.chart |
pv.area
Adds a bar 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 | # line example 1 (using layers)
wv <- pv.panel(width=150, height=150)
render.webvis(wv + pv.area(wv=wv, data=c(1, 1.2, 1.7, 1.5, .7, .5, .2), bottom=0, height.name="y", left.name="x", height.scale="linear.y.y", left.scale="linear.x.x"))
wv <- pv.panel(width=150, height=150)
render.webvis(wv + pv.area(wv=wv, data=c(1, 1.2, 1.7, 1.5, .7, .5, .2)))
# 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.area(wv=wv, data=c(1, 1.2, 1.7, 1.5, .7, .5, .2), height.name="y", left.name="x", height.scale="linear.y.y", left.scale="linear.x.x"))
render.webvis(wv)
# line example 4
wv <- pv.panel(width=150, height=150)
render.webvis(wv + pv.area(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.area(wv=wv, data=c(1, 1.2, 1.7, 1.5, .7, .5, .2), bottom=0, 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.area(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"))
#pv.area(data=c(1, 1.2, 1.7, 1.5, .7, .5, .2), height.name="y", left.name="x", height.scale="linear.y.y", left.scale="linear.x.x", ymin=10, ymax=100, bottom=0, render=TRUE)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.