By default, X-axis label is “day X”. But, if you shrink this window width to smaller than 600px, the labels will changed to “week X”.
library(chartist)
set.seed(324)
data <- data.frame(
day = 1:10,
A = runif(10, 0, 10),
B = runif(10, 0, 10),
C = runif(10, 0, 10)
)
chartist(data, day) +
# By default, the axis labels are day-bases
Line(x_labelInterpolationFnc = JS_interp(interval = 1, prefix = "day")) +
# For small screens, they are week-bases
Line(x_labelInterpolationFnc = JS_interp(interval = 7, prefix = "week"),
showPoint = FALSE,
responsiveQuery = "screen and (max-width: 600px)")
chartist(data, day) +
# By default, draw a normal bar chart
Bar(stackBars = FALSE) +
# For smaller screens, draw a stacked bar chart
Bar(stackBars = TRUE, responsiveQuery = "screen and (max-width: 600px)")
chartist(data[1:4, ], day) +
# by default, draw a donut chart
Pie(donut = TRUE, donutWidth = 100) +
# for smaller screens, draw a normal pie chart
Pie(donut = FALSE, showLabel = FALSE, responsiveQuery = "screen and (max-width: 600px)")