Movatterモバイル変換


[0]ホーム

URL:


Skip to contents

Create an Area Chart

v_area.Rd

Create an Area Chart

Usage

v_area(vc,  mapping=NULL,  data=NULL,  name=NULL,  stack=FALSE,  area=list(style=list(curveType="linear", fill=NULL, fillOpacity=NULL)),  point=list(visible=FALSE),  line=list(visible=FALSE),...,  serie_id=NULL,  data_id=NULL)

Arguments

vc

A chart initialized withvchart().

mapping

Default list of aesthetic mappings to use for chart.

data

Default dataset to use for chart. If not alreadyadata.frame, it will be coerced to withas.data.frame.

name

Name for the serie, only used for single serie (nocolor/fill aesthetic supplied).

stack

Whether to stack the data or not (iffill aesthetic is provided).

area

Area's options, such as curve interpolation type,seeonline documentation.

point

Options for showing points on lines or not.

line

Options for showing lines or not.

...

Additional parameters for the serie.

data_id, serie_id

ID for the data/serie, can be used to further customize the chart withv_specs().

Value

Avchart()htmlwidget object.

Examples

library(vchartr)# Basic Area Chartvchart(eco2mix)%>%v_area(aes(date,solar))
# Two areasvchart(eco2mix,aes(date))%>%v_area(aes(y=wind))%>%v_area(aes(y=solar))
# Line chart with discrete x axisvchart(data.frame(month=month.abb, value=sample(1:50,12)))%>%v_area(aes(month,value))
# Fill colorvchart(data.frame(month=month.abb, value=sample(1:50,12)))%>%v_area(aes(month,value), area=list( style=list(fill="firebrick", fill_opacity=0.9)))
# Smooth Area Chartvchart(data.frame(month=month.abb, value=sample(1:50,12)))%>%v_area(aes(month,value), area=list( style=list(curveType="monotone")))
# Step Area Chartvchart(data.frame(month=month.abb, value=sample(1:50,12)))%>%v_area(aes(month,value), area=list( style=list(curveType="stepAfter")))
# Multiple areasvchart(eco2mix_long)%>%v_area(aes(date,production, fill=source))
vchart(eco2mix_long)%>%v_area(aes(date,production, fill=source), stack=TRUE, area=list( style=list(fillOpacity=1)))
# Range area chartvchart(temperatures,aes(date))%>%v_area(aes(ymin=low, ymax=high))%>%v_line(aes(y=average))
within(temperatures,{difference=`2024`-average})%>%vchart(aes(date))%>%v_area(aes(ymin=average, ymax=`2024`, difference=difference), area=list( style=list( fill=JS("data => { return data.difference > 0 ? '#F68180' : '#2F64FF' ; }"), fillOpacity=1)))

[8]ページ先頭

©2009-2025 Movatter.jp