chart_ax_y {mschart}R Documentation

y axis settings

Description

Define settings for a y axis.

Usage

chart_ax_y(
  x,
  orientation,
  crosses,
  cross_between,
  major_tick_mark,
  minor_tick_mark,
  tick_label_pos,
  display,
  num_fmt,
  rotation,
  limit_min,
  limit_max,
  position,
  second_axis = FALSE
)

Arguments

x

an ms_chart object.

orientation

axis orientation, one of 'maxMin', 'minMax'.

crosses

specifies how the axis crosses the perpendicular axis, one of 'autoZero', 'max', 'min'.

cross_between

specifies how the value axis crosses the category axis between categories, one of 'between', 'midCat'.

major_tick_mark, minor_tick_mark

tick marks position, one of 'cross', 'in', 'none', 'out'.

tick_label_pos

ticks labels position, one of 'high', 'low', 'nextTo', 'none'.

display

should the axis be displayed (a logical of length 1).

num_fmt

number formatting. See section for more details.

rotation

rotation angle. Value should be between -360 and 360.

limit_min

minimum value on the axis.

limit_max

maximum value on the axis.

position

position value that cross the other axis.

second_axis

unused

Illustrations

fig_chart_ax_y_1.png

num_fmt

All ⁠%⁠ need to be doubled, ⁠0%%⁠ mean "a number and percent symbol".

From my actual knowledge, depending on some chart type and options, the following values are not systematically used by office chart engine; i.e. when chart pre-compute percentages, it seems using ⁠0%%⁠ will have no effect.

See Also

chart_ax_x(), ms_areachart(), ms_barchart(), ms_scatterchart(), ms_linechart()

Examples

library(officer)
library(mschart)

chart_01 <- ms_linechart(
  data = us_indus_prod,
  x = "date", y = "value",
  group = "type"
)
chart_01 <- chart_settings(chart_01, style = "marker")
chart_01 <- chart_ax_x(
  x = chart_01, num_fmt = "[$-fr-FR]mmm yyyy",
  limit_min = min(us_indus_prod$date),
  limit_max = as.Date("1992-01-01")
)
chart_01

[Package mschart version 0.4.0 Index]