Description Usage Arguments See Also Examples
The Chartist bar chart can be used to draw unipolar or bipolar bar and grouped bar charts.
1 2 3 4 5 6 7 | Bar(x_offset = NULL, x_labelOffset = NULL, x_showLabel = NULL,
x_showGrid = NULL, x_labelInterpolationFnc = NULL, y_offset = NULL,
y_labelOffset = NULL, y_showLabel = NULL, y_showGrid = NULL,
y_labelInterpolationFnc = NULL, y_scaleMinSpace = NULL, width = NULL,
height = NULL, low = NULL, high = NULL, chartPadding = NULL,
seriesBarDistance = NULL, fullWidth = NULL, centerBars = NULL,
stackBars = NULL, classNames = NULL, responsiveQuery = NULL)
|
x_offset |
offset of the X-axis |
x_labelOffset |
offset of the each X-axis label (e.g. 1, c(1,2), list(x=1, y=2)) |
x_showLabel |
if X-axis labels should be shown or not |
x_showGrid |
if X-axis grid should be drawn or not |
x_labelInterpolationFnc |
JS function to intercept the value from the X-axis label |
y_offset |
offset of the Y-axis labels to the chart area |
y_labelOffset |
offset of the X-axis labels (e.g. 1, c(1,2), list(x=1, y=2)) |
y_showLabel |
if Y-axis labels should be shown or not |
y_showGrid |
if Y-axis grid should be drawn or not |
y_labelInterpolationFnc |
JS function to intercept the value from the Y-axis label |
y_scaleMinSpace |
minimum height in pixel of the scale steps |
width |
fixed width for the chart as a string (i.e. '100px' or '50%') |
height |
fixed height for the chart as a string (i.e. '100px' or '50%') |
low |
lower limit of value |
high |
higher limit of value |
chartPadding |
padding of the chart drawing area to the container element and labels |
seriesBarDistance |
distance in pixel of bars in a group |
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 |
if bars are drawn on the grid line rather than between two grid lines |
stackBars |
if series bars are stacked or not (in stacked mode the seriesBarDistance property will have no effect). |
classNames |
Override the class names that get used to generate the SVG structure of the chart |
responsiveQuery |
if specified, the options are used only when the query matches. |
http://gionkunz.github.io/chartist-js/api-documentation.html#chartistbar-function-bar
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | ## Not run:
set.seed(324)
data <- data.frame(
day = 1:10,
A = runif(10, 0, 10),
B = runif(10, 0, 10),
C = runif(10, 0, 10),
D = runif(10, 0, 10)
)
chartist(data[1:6, ], day) + Bar()
chartist(data, day) + Bar(stackBars = TRUE)
# responsive chart
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)")
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.