style_ist: Style your chart

Description Usage Arguments Examples

View source: R/style.R

Description

Style your chart

Usage

1
style_ist(p, type, css = htmltools::css())

Arguments

p

a chartist object.

type

chart element type to animate (i.e.: line, or grid).

css

css to wrap in css

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
# missing style defaults to chart type
mtcars %>%
    chart_ist(qsec, "line") %>%
    add_ist(mpg) %>%
    style_ist(css = htmltools::css(stroke = "rgba(0,0,0,0.4)", stroke.dasharray="20")) %>%
    style_ist("grid", htmltools::css(stroke = "black")) %>%
    style_ist(c("point"), htmltools::css(stroke = "green"))
    
mtcars %>%
    chart_ist(qsec, "line") %>%
    add_ist(hp, "hp") %>%
    add_ist(disp, "disp") %>%
    lineopt_ist("hp", showPoint = FALSE, showArea = TRUE, showLine = FALSE) %>%
    xaxis_ist(showLabel = FALSE) %>%
    style_ist(css = htmltools::css(stroke = "rgba(231,1,2,0.4)", stroke.dasharray="20")) %>%
    style_ist("area", htmltools::css(stroke = "black", fill = "rgba(0,,0,0.9)")) %>%
    style_ist(c("point"), htmltools::css(stroke = "red"))

JohnCoene/chartist documentation built on May 7, 2019, 11:17 a.m.