lineopt_ist: Line options

Description Usage Arguments Examples

View source: R/options.R

Description

Pass options to line type.

Usage

1
2
3
4
lineopt_ist(p, name, fillHoles = FALSE, showPoint = TRUE,
  showArea = FALSE, showLine = TRUE, areaBase = 0,
  lineSmoothing = "simple", fullWidth = TRUE, distributeSeries = FALSE,
  width, height, low, high, chartPadding, ...)

Arguments

p

a chartist object.

name

name the serie, see details (optional).

fillHoles

whether to fill missing data, defaults to FALSE.

showPoint

whether to show points, defaults to TRUE.

showArea

turn line chart into area chart, defaults to FALSE.

showLine

set FALSE to hide line.

areaBase

base for the chart, defaults to 0.

lineSmoothing

defaults to simple, can take an integer, step, none or an htmlwidgets javascript function (class JS_EVAL).

fullWidth

When set to true, the last grid line on the x-axis is not drawn and the chart elements will expand to the full available width of the chart. For the last label to be drawn correctly you might need to add chart padding or offset the last label with a draw event handler.

distributeSeries

distributed serie along x axis only works for 1 serie, defaults to FALSE.

width

set fixed width in pixels or percent (i.e.: 300px, 70%).

height

set fixed height in pixels or percent (i.e.: 300px, 70%).

low

lower bound of value.

high

higher bound of value.

chartPadding

padding around chart div.

...

additional options.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
mtcars %>%
   chart_ist(x = mpg, type = "line") %>%
   add_ist(disp) %>%
   lineopt_ist(showArea = TRUE, showLine = FALSE, showPoint = FALSE)

mtcars %>%
   chart_ist(x = mpg, type = "line") %>%
   add_ist(disp) %>%
   lineopt_ist(lineSmoothing = "step", showLine = TRUE, showPoint = FALSE)

mtcars %>%
   chart_ist(x = mpg, type = "line") %>%
   add_ist(disp, name = "disp") %>%
   add_ist(hp, name = "hp") %>%
   lineopt_ist(name = "disp", lineSmoothing = "none") %>%
   lineopt_ist(name = "hp", showArea = TRUE, showPoint = FALSE)

mtcars %>%
   chart_ist(qsec) %>%
   add_ist(mpg) %>%
   lineopt_ist(lineSmoothing = htmlwidgets::JS("
       Chartist.Interpolation.cardinal({tension: 0.2})"))

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