baropt_ist: Bar options

Description Usage Arguments Examples

View source: R/options.R

Description

Pass options to bar type.

Usage

1
2
3
baropt_ist(p, fullWidth = TRUE, centerBars = FALSE, stackBars = FALSE,
  distributeSeries = FALSE, seriesBarDistance, width, height, low, high,
  chartPadding, ...)

Arguments

p

a chartist object.

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.

centerBars

set to TRUE to draw bars on the grid lines, FALSE to draw on grid lines.

stackBars

whether to stack bars, default to FALSE.

distributeSeries

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

seriesBarDistance

distance in pixels between bar groups.

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
mtcars$models <- rownames(mtcars)

mtcars[1:10,] %>%
    chart_ist(x = models, type = "bar") %>%
    add_ist(cyl) %>%
    add_ist(carb) %>%
    add_ist(gear) %>%
    baropt_ist(stackBars = TRUE)

mtcars[1:10,] %>%
    chart_ist(x = models, type = "bar") %>%
    add_ist(cyl) %>%
    add_ist(carb) %>%
    add_ist(gear) %>%
    baropt_ist(seriesBarDistance = 10, centerBars = TRUE)

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