Column | R Documentation |
Column chart
Column(
x,
x2 = NULL,
colors = ChartColors(max(1, NCOL(x), na.rm = TRUE)),
multi.colors.within.series = FALSE,
opacity = NULL,
type = "Column",
annotation.list = NULL,
overlay.annotation.list = NULL,
fit.type = "None",
fit.window.size = 2,
fit.line.colors = colors,
fit.ignore.last = FALSE,
fit.line.type = "dot",
fit.line.width = 1,
fit.line.name = "Fitted",
fit.line.opacity = 1,
fit.CI.show = FALSE,
fit.CI.colors = fit.line.colors,
fit.CI.opacity = 0.4,
global.font.family = "Arial",
global.font.color = rgb(44, 44, 44, maxColorValue = 255),
title = "",
title.font.family = global.font.family,
title.font.color = global.font.color,
title.font.size = 16,
title.align = "center",
subtitle = "",
subtitle.font.family = global.font.family,
subtitle.font.color = global.font.color,
subtitle.font.size = 12,
subtitle.align = "center",
footer = "",
footer.font.family = global.font.family,
footer.font.color = global.font.color,
footer.font.size = 8,
footer.align = "center",
footer.wrap = TRUE,
footer.wrap.nchar = 100,
background.fill.color = "transparent",
background.fill.opacity = 1,
charting.area.fill.color = background.fill.color,
charting.area.fill.opacity = 0,
legend.show = NA,
legend.orientation = "Vertical",
legend.wrap = TRUE,
legend.wrap.nchar = 30,
legend.position.x = NULL,
legend.position.y = NULL,
legend.fill.color = background.fill.color,
legend.fill.opacity = 0,
legend.border.color = rgb(44, 44, 44, maxColorValue = 255),
legend.border.line.width = 0,
legend.font.color = global.font.color,
legend.font.family = global.font.family,
legend.font.size = 10,
legend.ascending = NA,
hovertext.font.family = global.font.family,
hovertext.font.size = 11,
hovertext.template = NULL,
hovertext.align = "left",
margin.top = NULL,
margin.bottom = NULL,
margin.left = NULL,
margin.right = NULL,
margin.inner.pad = NULL,
margin.autoexpand = TRUE,
grid.show = TRUE,
x2.colors = ChartColors(max(1, NCOL(x2), na.rm = TRUE)),
x2.data.label.show = FALSE,
x2.data.label.show.at.ends = FALSE,
x2.line.type = "Solid",
x2.line.thickness = 2,
x2.shape = c("linear", "spline")[1],
x2.smoothing = 1,
x2.opacity = 1,
x2.marker.show = FALSE,
x2.marker.show.at.ends = FALSE,
x2.marker.size = 6,
x2.marker.symbols = "circle",
x2.marker.colors = x2.colors,
x2.marker.border.colors = x2.colors,
x2.marker.opacity = x2.opacity,
x2.marker.border.opacity = x2.opacity,
x2.marker.border.width = 1,
x2.data.label.position = "Top",
x2.data.label.font.autocolor = FALSE,
x2.data.label.font.family = global.font.family,
x2.data.label.font.size = 10,
x2.data.label.font.color = global.font.color,
x2.data.label.format = "",
x2.data.label.prefix = "",
x2.data.label.suffix = "",
y.title = "",
y.title.font.color = global.font.color,
y.title.font.family = global.font.family,
y.title.font.size = 12,
y.line.width = 0,
y.line.color = rgb(0, 0, 0, maxColorValue = 255),
y.tick.mark.length = 0,
y.tick.mark.color = "transparent",
y.bounds.minimum = NULL,
y.bounds.maximum = NULL,
y.tick.distance = NULL,
y.tick.maxnum = NULL,
y.zero = TRUE,
y.zero.line.width = 0,
y.zero.line.color = rgb(225, 225, 225, maxColorValue = 255),
y.data.reversed = FALSE,
y.grid.width = 1 * grid.show,
y.grid.color = rgb(225, 225, 225, maxColorValue = 255),
y.tick.show = TRUE,
y.tick.suffix = "",
y.tick.prefix = "",
y.tick.format = "",
y.hovertext.format = y.tick.format,
y.tick.angle = NULL,
y.tick.font.color = global.font.color,
y.tick.font.family = global.font.family,
y.tick.font.size = 10,
y2.title = "",
y2.title.font.color = global.font.color,
y2.title.font.family = global.font.family,
y2.title.font.size = 12,
y2.line.width = 0,
y2.line.color = rgb(0, 0, 0, maxColorValue = 255),
y2.tick.mark.length = 0,
y2.tick.mark.color = "tranparent",
y2.bounds.minimum = NULL,
y2.bounds.maximum = NULL,
y2.tick.distance = NULL,
y2.tick.maxnum = NULL,
y2.zero = TRUE,
y2.zero.line.width = 0,
y2.zero.line.color = rgb(225, 225, 225, maxColorValue = 255),
y2.data.reversed = FALSE,
y2.grid.width = 0 * grid.show,
y2.grid.color = rgb(225, 225, 225, maxColorValue = 255),
y2.tick.show = TRUE,
y2.tick.suffix = "",
y2.tick.prefix = "",
y2.tick.format = "",
y2.hovertext.format = y2.tick.format,
y2.tick.angle = NULL,
y2.tick.font.color = global.font.color,
y2.tick.font.family = global.font.family,
y2.tick.font.size = 10,
x.title = "",
x.title.font.color = global.font.color,
x.title.font.family = global.font.family,
x.title.font.size = 12,
x.line.width = 0,
x.line.color = rgb(0, 0, 0, maxColorValue = 255),
x.tick.marks = "",
x.tick.mark.length = 3,
x.tick.mark.color = "transparent",
x.bounds.minimum = NULL,
x.bounds.maximum = NULL,
x.tick.distance = NULL,
x.tick.maxnum = 11,
x.zero = FALSE,
x.zero.line.width = 0,
x.zero.line.color = rgb(225, 225, 225, maxColorValue = 255),
x.data.reversed = FALSE,
x.grid.width = 0 * grid.show,
x.grid.color = rgb(225, 225, 225, maxColorValue = 255),
x.tick.show = TRUE,
x.tick.suffix = "",
x.tick.prefix = "",
x.tick.format = "",
x.hovertext.format = x.tick.format,
x.tick.angle = NULL,
x.tick.font.color = global.font.color,
x.tick.font.family = global.font.family,
x.tick.font.size = 10,
x.tick.label.wrap = TRUE,
x.tick.label.wrap.nchar = 21,
marker.border.width = 1,
marker.border.colors = NULL,
marker.border.opacity = NULL,
tooltip.show = TRUE,
modebar.show = FALSE,
zoom.enable = TRUE,
axis.drag.enable = FALSE,
bar.gap = 0.15,
bar.group.gap = 0,
bar.corner.radius = 0,
data.label.show = FALSE,
data.label.centered = FALSE,
data.label.font.autocolor = FALSE,
data.label.font.family = global.font.family,
data.label.font.size = 10,
data.label.font.color = global.font.color,
data.label.format = "",
data.label.prefix = "",
data.label.suffix = "",
data.label.threshold = NULL,
average.series = NULL,
average.color = rgb(230, 230, 230, maxColorValue = 255)
)
x |
Input data may be a matrix or a vector, containing the height of the columns to be plotted, with the name/rownames used as the column names of the chart. Numeric and date labels will be parsed automatically. |
x2 |
Optional input data which is shown as lines on top of the column chart. a separate axis for these lines will be shown on the right. |
colors |
Character; a vector containing one or more colors specified as hex codes. |
multi.colors.within.series |
A logical indicating that the colors vector should be assigned to each bar within the same series. |
opacity |
Opacity of bars as an alpha value (0 to 1). |
type |
One of "Column", "Stacked Column" or "100% Stacked Column" |
annotation.list |
Optional list of annotations to modify the data labels. |
overlay.annotation.list |
Optional list of annotations that is overlayed on top of the chart. |
fit.type |
Character; type of line of best fit. Can be one of "None", "Linear", "LOESS", "Friedman's super smoother", "Cubic spline", "Moving average", "Centered moving average". |
fit.window.size |
Integer; Use to determine how the average is computed when |
fit.line.colors |
Character; a vector containing one or more colors specified as hex codes. |
fit.ignore.last |
Logical; whether to ignore the last data point in the fit. |
fit.line.type |
Character; One of "solid", "dot", "dash, "dotdash", or length of dash "2px", "5px". |
fit.line.width |
Numeric; Line width of line of best fit. |
fit.line.name |
Character; Name of the line of best fit, which will appear in the hovertext. |
fit.line.opacity |
Opacity of trend line as an alpha value (0 to 1). |
fit.CI.show |
Show 95% confidence interval. |
fit.CI.colors |
Character; a vector containing one or more colors specified as hex codes. |
fit.CI.opacity |
Opacity of confidence interval ribbon as an alpha value (0 to 1). |
global.font.family |
Character; font family for all occurrences of any font attribute for the chart unless specified individually. |
global.font.color |
Global font color as a named color in character format (e.g. "black") or an a hex code. |
title |
Character; chart title. |
title.font.family |
Character; title font family. Can be "Arial Black", "Arial", "Comic Sans MS", "Courier New", "Georgia", "Impact", "Lucida Console", "Lucida Sans Unicode", "Marlett", "Symbol", "Tahoma", "Times New Roman", "Trebuchet MS", "Verdana", "Webdings" |
title.font.color |
Title font color as a named color in character format (e.g. "black") or a hex code. |
title.font.size |
Integer; Title font size; default = 10. |
title.align |
Horizontal alignment of title. |
subtitle |
Character |
subtitle.font.family |
Character; subtitle font family |
subtitle.font.color |
subtitle font color as a named color in character format (e.g. "black") or an a hex code. |
subtitle.font.size |
Integer; subtitle font size |
subtitle.align |
Horizontal alignment of subtitle. |
footer |
Character |
footer.font.family |
Character; footer font family |
footer.font.color |
footer font color as a named color in character format (e.g. "black") or an a hex code. |
footer.font.size |
Integer; footer font size |
footer.align |
Horizontal alignment of footer. |
footer.wrap |
Logical; whether the footer text should be wrapped. |
footer.wrap.nchar |
Number of characters (approximately) in each
line of the footer when |
background.fill.color |
Background color in character format (e.g. "black") or a hex code. |
background.fill.opacity |
Background opacity as an alpha value (0 to 1). |
charting.area.fill.color |
Charting area background color as a named color in character format (e.g. "black") or a hex code. |
charting.area.fill.opacity |
Charting area background opacity as an alpha value (0 to 1). |
legend.show |
Controls whether legend is shown. This can be a logical ( |
legend.orientation |
Character; One of 'Vertical' or 'Horizontal' |
legend.wrap |
Logical; whether the legend text should be wrapped. |
legend.wrap.nchar |
Number of characters (approximately) in each
line of the legend when |
legend.position.x |
A numeric controlling the position of the legend. Values range from -0.5 (left) to 1.5 (right). |
legend.position.y |
A numeric controlling the position of the legend. Values range from 0 (bottom) to 1 (top). |
legend.fill.color |
Legend fill color as a named color in character format (e.g. "black") or a hex code. |
legend.fill.opacity |
Legend fill opacity as an alpha value (0 to 1). |
legend.border.color |
Legend border color as a named color in character format (e.g. "black") or a hex code. |
legend.border.line.width |
Width in pixels of the border around the legend. 0 = no border. |
legend.font.color |
Legend font color as a named color in character format (e.g. "black") or a hex code. |
legend.font.family |
Character; legend font family. |
legend.font.size |
Integer; Legend font size. |
legend.ascending |
Logical; TRUE for ascending, FALSE for descending. By default, we set it to to FALSE if the chart is stacked and TRUE otherwise. |
hovertext.font.family |
Font family of hover text. |
hovertext.font.size |
Font size of hover text. |
hovertext.template |
Specify format of the hovertext. This can be a string or matrix
which is the same dimensions as |
hovertext.align |
Horizontal alignment of hover text. Only observable when hover contain multiple lines. |
margin.top |
Margin between plot area and the top of the graphic in pixels |
margin.bottom |
Margin between plot area and the bottom of the graphic in pixels |
margin.left |
Margin between plot area and the left of the graphic in pixels |
margin.right |
Margin between plot area and the right of the graphic in pixels |
margin.inner.pad |
Padding in pixels between plot proper and axis lines |
margin.autoexpand |
Logical; Whether extra space can be added to the margins to allow space for axis/legend/data labels or other chart elements. |
grid.show |
Logical; whether to show grid lines. |
x2.colors |
Character; a vector containing one or more colors for |
x2.data.label.show |
Logical; whether to show data labels for the secondary axis. |
x2.data.label.show.at.ends |
Logical; show data labels at the beginning and end of each
line data series. This value will override |
x2.line.type |
Character; one of 'solid', 'dot', 'dashed'. |
x2.line.thickness |
Thickness, in pixels, of the series line for secondary data. |
x2.shape |
Either "linear" for straight lines between data points or "spline" for curved lines. |
x2.smoothing |
Numeric; smoothing if |
x2.opacity |
Opacity of the series line for secondary data. |
x2.marker.show |
Logical; whether to show markers at the data points on the lines for the secondary data. |
x2.marker.show.at.ends |
Logical; show markers at the begining and end of each
data series. The value will override |
x2.marker.size |
Size in pixels of marker |
x2.marker.symbols |
Character; marker symbols, which are only shown if marker.show = TRUE. if a vector is passed, then each element will be applied to a data series in the secondary data set. |
x2.marker.colors |
Character; a vector containing on/mae or more colors specified as hex codes. |
x2.marker.border.colors |
Character; a vector containing one or more colors specified as hex codes. |
x2.marker.opacity |
Opacity for markers as an alpha value (0 to 1). |
x2.marker.border.opacity |
Opacity of border/line around markers as an alpha value (0 to 1). |
x2.marker.border.width |
Width in pixels of border/line around markers; 0 is no line |
x2.data.label.position |
Character; one of 'top' or 'bottom'. |
x2.data.label.font.autocolor |
Logical; Whether font color should automatically set to the series color. |
x2.data.label.font.family |
Character; font family for data label for the secondary axis. |
x2.data.label.font.size |
Integer; Font size for data label.px for the secondary axis. |
x2.data.label.font.color |
Font color as a named color for the secondary axis in character format (e.g. "black") or an a hex code. This can be a single color, a vector of colors (1 for each series/column), or a comma separated list of colors |
x2.data.label.format |
A string representing a d3 formatting code. See https://github.com/mbostock/d3/wiki/Formatting#numbers |
x2.data.label.prefix |
Character; prefix for data values. |
x2.data.label.suffix |
Character; suffix for data values. |
y.title |
Character, y-axis title; defaults to chart input values; to turn off set to "FALSE". |
y.title.font.color |
y-axis title font color as a named color in character format (e.g. "black") or a hex code. |
y.title.font.family |
Character; y-axis title font family |
y.title.font.size |
Integer; y-axis title font size |
y.line.width |
y-axis line width in pixels (0 = no line). |
y.line.color |
y-axis line color as a named color in character format (e.g. "black") or a hex code. |
y.tick.mark.length |
Length of tick marks in pixels. Ticks are only shown when |
y.tick.mark.color |
Color of tick marks (default transparent). |
y.bounds.minimum |
Minimum of range for plotting; For a date axis this should be supplied as a date string. For a categorical axis, the index of the category (0-based) should be used. |
y.bounds.maximum |
Maximum of range for plotting; NULL = no manual range set. |
y.tick.distance |
Distance between tick marks. Requires that |
y.tick.maxnum |
Maximum number of ticks shown on the axis.
This setting is ignored if |
y.zero |
Whether the y-axis should include zero. |
y.zero.line.width |
Width in pixels of zero line; |
y.zero.line.color |
Color of horizontal zero line as a named color in character format (e.g. "black") or an rgb value (e.g. rgb(0, 0, 0, maxColorValue = 255)). |
y.data.reversed |
Logical; whether to reverse y-axis or not |
y.grid.width |
Width of y-grid lines in pixels; 0 = no line |
y.grid.color |
Color of y-grid lines as a named color in character format (e.g. "black") or a hex code. |
y.tick.show |
Whether to display the y-axis tick labels |
y.tick.suffix |
y-axis tick label suffix |
y.tick.prefix |
y-axis tick label prefix |
y.tick.format |
A string representing a d3 formatting code. See https://github.com/d3/d3/blob/master/API.md#number-formats-d3-format |
y.hovertext.format |
A string representing a d3 formatting code See https://github.com/d3/d3/blob/master/API.md#number-formats-d3-format |
y.tick.angle |
y-axis tick label angle in degrees. 90 = vertical; 0 = horizontal |
y.tick.font.color |
y-axis tick label font color as a named color in character format (e.g. "black") or an a hex code. |
y.tick.font.family |
Character; y-axis tick label font family |
y.tick.font.size |
Integer; y-axis tick label font size |
y2.title |
Character, y-axis title; defaults to chart input values; to turn off set to "FALSE". |
y2.title.font.color |
y-axis title font color as a named color in character format (e.g. "black") or a hex code. |
y2.title.font.family |
Character; y-axis title font family |
y2.title.font.size |
Integer; y-axis title font size |
y2.line.width |
y-axis line width in pixels (0 = no line). |
y2.line.color |
y-axis line color as a named color in character format (e.g. "black") or a hex code. |
y2.tick.mark.length |
Length of tick marks in pixels. Ticks are only shown when |
y2.tick.mark.color |
color of tick marks. |
y2.bounds.minimum |
Minimum of range for plotting; For a date axis this should be supplied as a date string. For a categorical axis, the index of the category (0-based) should be used. |
y2.bounds.maximum |
Maximum of range for plotting; NULL = no manual range set. |
y2.tick.distance |
Distance between tick marks. Requires that |
y2.tick.maxnum |
Maximum number of ticks shown on the axis.
This setting is ignored if |
y2.zero |
Whether the y-axis should include zero. |
y2.zero.line.width |
Width in pixels of zero line; |
y2.zero.line.color |
Color of horizontal zero line as a named color in character format (e.g. "black") or an rgb value (e.g. rgb(0, 0, 0, maxColorValue = 255)). |
y2.data.reversed |
Logical; whether to reverse y-axis or not |
y2.grid.width |
Width of y-grid lines in pixels; 0 = no line |
y2.grid.color |
Color of y-grid lines as a named color in character format (e.g. "black") or a hex code. |
y2.tick.show |
Whether to display the y-axis tick labels |
y2.tick.suffix |
y-axis tick label suffix |
y2.tick.prefix |
y-axis tick label prefix |
y2.tick.format |
A string representing a d3 formatting code. See https://github.com/d3/d3/blob/master/API.md#number-formats-d3-format |
y2.hovertext.format |
A string representing a d3 formatting code See https://github.com/d3/d3/blob/master/API.md#number-formats-d3-format |
y2.tick.angle |
y-axis tick label angle in degrees. 90 = vertical; 0 = horizontal |
y2.tick.font.color |
y-axis tick label font color as a named color in character format (e.g. "black") or an a hex code. |
y2.tick.font.family |
Character; y-axis tick label font family |
y2.tick.font.size |
Integer; y-axis tick label font size |
x.title |
Character, x-axis title; defaults to chart input values; to turn off set to "FALSE". |
x.title.font.color |
x-axis title font color as a named color in character format (e.g. "black") or an a hex code. |
x.title.font.family |
Character; x-axis title font family |
x.title.font.size |
Integer; x-axis title font size |
x.line.width |
x-axis line in pixels, 0 = no line |
x.line.color |
x-axis line color as a named color in character format (e.g. "black") or a hex code. |
x.tick.marks |
Character; whether and where to show tick marks on the x-axis. Can be "outside", "inside", "none" |
x.tick.mark.length |
Length of tick marks in pixels. |
x.tick.mark.color |
Color of tick marks. |
x.bounds.minimum |
Minimum of range for plotting; For a date axis this should be supplied as a date string. For a categorical axis, the index of the category (0-based) should be used. |
x.bounds.maximum |
Maximum of range for plotting; NULL = no manual range set. Must be greater than x.bounds.minimum |
x.tick.distance |
Tick mark distance in x-axis units between minimum and maximum for plotting; NULL = no manual range set. |
x.tick.maxnum |
Maximum number of ticks shown on the axis.
It defaults to 11 which gives the same output from plotly as NULL.
This setting is ignored if |
x.zero |
Whether the x-axis should include zero. |
x.zero.line.width |
Width in pixels of zero line. |
x.zero.line.color |
Color of horizontal zero (origin) line as a named color in character format (e.g. "black") or an rgb value (e.g. rgb(0, 0, 0, maxColorValue = 255)). |
x.data.reversed |
Logical; whether to reverse x-axis or not |
x.grid.width |
Width of y-grid lines in pixels; 0 = no line |
x.grid.color |
Color of y-grid lines as a named color in character format (e.g. "black") or a hex code. |
x.tick.show |
Whether to display the x-axis tick labels |
x.tick.suffix |
x-axis tick label suffix |
x.tick.prefix |
x-axis tick label prefix |
x.tick.format |
A string representing a d3 formatting code. See https://github.com/mbostock/d3/wiki/Formatting#numbers |
x.hovertext.format |
A string representing a d3 formatting code. See https://github.com/mbostock/d3/wiki/Formatting#numbers |
x.tick.angle |
x-axis tick label angle in degrees. 90 = vertical; 0 = horizontal |
x.tick.font.color |
X-axis tick label font color as a named color in character format (e.g. "black") or an a hex code. |
x.tick.font.family |
Character; x-axis tick label font family |
x.tick.font.size |
Integer; x-axis tick label font size |
x.tick.label.wrap |
Logical; whether to wrap long labels on the x-axis. |
x.tick.label.wrap.nchar |
Integer; number of characters in each line when |
marker.border.width |
Width in pixels of border/line around series bars; 0 is no line |
marker.border.colors |
Character; a vector containing one or more colors specified as hex codes. |
marker.border.opacity |
Opacity of border around bars as an alpha value (0 to 1). |
tooltip.show |
Logical; whether to show a tooltip on hover. |
modebar.show |
Logical; whether to show the zoom menu buttons or not. |
zoom.enable |
Logical; whether to enable zoom on the chart. For Bar and Column charts with data labels it may be useful to turn off zoom because data labels and annotations can be misplace on zoom. |
axis.drag.enable |
Logical; whether to enable the user to drag along axes.
This interaction is available when the cursor shows up as a double-headed arrow
when hovering over an axis. It is turned off by default because it can sometimes
cause problems with data labels and annotations. Also, is only used when
|
bar.gap |
Gap between adjacent bars with different coordinates in bar or column charts (in plot fraction). |
bar.group.gap |
Gap between bars at the same location (in plot fraction). This is only applicable for grouped bar/column charts. |
bar.corner.radius |
Rounding of bar corners as a percentage of bar width. |
data.label.show |
Logical; whether to show data labels. |
data.label.centered |
Logical; whether data labels in Stacked Column charts should have the data labels vertically centered. |
data.label.font.autocolor |
Logical; Whether font color should be automatically determined. For Line and Radar charts, the data labels will colored in the series color. For stacked bar and column charts the data labels will be black or white depending on the color of the bar (which background the data label). For non-stacked bar and column charts, this option is ignored. |
data.label.font.family |
Character; font family for data label. |
data.label.font.size |
Integer; Font size for data label.px. |
data.label.font.color |
Font color as a named color in character format (e.g. "black") or an a hex code. This can be a single color, a vector of colors (1 for each series/column), or a comma separated list of colors |
data.label.format |
A string representing a d3 formatting code. See https://github.com/mbostock/d3/wiki/Formatting#numbers |
data.label.prefix |
Character; prefix for data values. |
data.label.suffix |
Character; suffix for data values. |
data.label.threshold |
The proportion of the total range below which data labels should not be displayed. Only applicable for pie, bar and column charts. |
average.series |
a vector of values which create an additional data series named "Average".
This is usually used by |
average.color |
Color of the |
z <- structure(c(1L, 2L, 3L, 4L, 5L, 2L, 3L, 4L, 5L, 6L), .Dim = c(5L, 2L),
.Dimnames = list(c("T", "U", "V", "W", "X"), c("A", "B")))
Column(z, type="Stacked Column")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.