mark_area {vegalite} | R Documentation |
Area mark
Description
An area represent multiple data element as a single area shape.
Usage
mark_area(vl, orient = NULL, stack = NULL, interpolate = NULL,
tension = NULL, opacity = NULL, filled = NULL, color = NULL,
fill = NULL, stroke = NULL)
Arguments
vl |
Vega-Lite object |
orient |
the orientation of a non-stacked bar, area, and line charts. The value is either "horizontal", or "vertical" (default). For bar and tick, this determines whether the size of the bar and tick should be applied to x or y dimension. For area, this property determines the orient property of the Vega output. For line, this property determines the path order of the points in the line if path channel is not specified. For stacked charts, this is always determined by the orientation of the stack; therefore explicitly specified value will be ignored. |
stack |
stacking modes for bar and area marks. |
interpolate |
The line interpolation method to use. One of |
tension |
Depending on the interpolation type, sets the tension parameter. (See D3’s line interpolation.) |
opacity |
|
filled |
whether the shape's color should be used as fill color instead of stroke color. |
color |
color of the mark – either fill or stroke color based on the filled mark config. |
fill |
fill color. This config will be overridden by color channel’s specified or mapped values if filled is true. |
stroke |
stroke color. This config will be overridden by color channel’s specified or mapped values if filled is false. |
References
Examples
vegalite() %>%
cell_size(300, 200) %>%
add_data("https://vega.github.io/vega-editor/app/data/unemployment-across-industries.json") %>%
encode_x("date", "temporal") %>%
encode_y("count", "quantitative", aggregate="sum") %>%
encode_color("series", "nominal") %>%
scale_color_nominal(range="category20b") %>%
timeunit_x("yearmonth") %>%
scale_x_time(nice="month") %>%
axis_x(axisWidth=0, format="%Y", labelAngle=0) %>%
mark_area()