View source: R/pictographchart.R
PictographChart | R Documentation |
PictographChart
Create a chart to visually represent the data in a table or vector using the number of icons displayed
PictoStdChart
Deprecated function for backwards-compatibility
PictographChart(
x,
image = "stickman",
base.image = "",
is.custom.url = FALSE,
hide.base.image = FALSE,
total.icons = NA,
scale = NA,
mode = "table",
icon.palette = "Strong colors",
icon.colors = "black",
icon.custom.color = NA,
icon.custom.gradient.start = NA,
icon.custom.gradient.end = NA,
icon.custom.palette = NA,
fill.direction = "fromleft",
show.lines = FALSE,
layout = NA,
icon.nrow = 1,
icon.ncol = NA,
fix.icon.nrow = TRUE,
table.by.row = FALSE,
row.names.to.remove = "",
column.names.to.remove = "",
show.legend = FALSE,
legend.text = "",
legend.icon.color = NA,
pad.legend = 40,
hide.label.right = TRUE,
hide.label.left = !hide.label.right,
hide.label.bottom = (mode != "column"),
hide.label.top = (mode == "column"),
label.color.asIcon = FALSE,
label.left = NA,
label.top = NA,
label.bottom = NA,
label.right = NA,
label.pad = 0,
label.left.pad = label.pad,
label.right.pad = label.pad,
label.bottom.align.horizontal = "center",
label.left.align.horizontal = "default",
label.right.align.horizontal = "default",
label.top.align.horizontal = "center",
label.left.align.vertical = ifelse(is.na(icon.ncol[1]), "center", "top"),
label.top.align.vertical = "center",
label.right.align.vertical = ifelse(is.na(icon.ncol[1]), "center", "top"),
label.bottom.align.vertical = "center",
width.height.ratio = NA,
label.top.height = NA,
label.font.family = "arial",
label.font.size = 12,
label.font.color = "#2C2C2C",
label.left.font.color = label.font.color,
label.right.font.color = label.font.color,
label.top.font.color = label.font.color,
label.bottom.font.color = label.font.color,
label.left.font.size = label.font.size,
label.top.font.size = label.font.size,
label.right.font.size = label.font.size,
label.bottom.font.size = label.font.size,
label.left.font.weight = "normal",
label.top.font.weight = "normal",
label.bottom.font.weight = "normal",
label.right.font.weight = "normal",
show.label.data = FALSE,
customize.label.data = TRUE,
label.data.digits = 0,
label.data.bigmark = ",",
label.data.prefix = "",
label.data.suffix = "",
label.data.100prc = FALSE,
label.data.position = ifelse(mode == "bar", "Next to bar", "footer"),
label.data.font.weight = "normal",
label.data.font.size = 0.8 * label.font.size,
label.data.font.color = label.font.color,
label.data.align.horizontal = "default",
label.data.type = "None",
data.above.label = FALSE,
...
)
PictoStdChart(...)
x |
Data to plot. Can be vector, matrix or data.frame. |
image |
Name of icon (e.g. |
base.image |
URL of image to use as base image. Only used if |
is.custom.url |
Whether the image parameter is a url supplied by the user. |
hide.base.image |
Turns off background image (on by default). In general, the base image should only be shown if the input data is a proportion. |
total.icons |
Maximum number of icons in each table cell. By default, it will be determine based on |
scale |
Value of one icon. If |
mode |
Can be set to one of |
icon.palette |
Name of palette used to color icons. Only applicable for in-built icons |
icon.colors |
Vector of colors for icons. Only applicable when |
icon.custom.color |
A single color which is used if |
icon.custom.gradient.start |
Character; starting color of gradient if |
icon.custom.gradient.end |
Character; last color of gradient if |
icon.custom.palette |
Character; comma separated list of colors to be used if |
fill.direction |
Direction in which icons are filled. One of |
show.lines |
Add horizontal lines between each row |
layout |
May be one of |
icon.nrow |
Configuration of icons in each table cell. Can be a single value or a vector with length equal to the number of rows. |
icon.ncol |
Configuration of icons in each table cell. Can be a single value or a vector with length equal to the number of columns. |
fix.icon.nrow |
When |
table.by.row |
By default, when a 2-dimensional table is supplied, values in each column will be shown in the same color. Set to |
row.names.to.remove |
List of rownames to exclude from the chart. This can be in the form of a vector or a comma-separated string. This variable is ignored if the input data has no rownames. |
column.names.to.remove |
List of colnames to exclude from the chart. |
show.legend |
Show legend (true or false). |
legend.text |
Text shown with legend. If this string is empty, it will be automatically filled in using |
legend.icon.color |
Color of icon shown in legend. |
pad.legend |
Horizontal spacing between the chart and the legend. |
hide.label.right |
Suppress labels on right of graphics. |
hide.label.left |
Suppress labels on left of graphics. By default, if |
hide.label.bottom |
Suppress labels below graphics (shown by default when |
hide.label.top |
Suppress labels above graphics. |
label.color.asIcon |
When set to |
label.left |
Length must be equal to length (if |
label.top |
By default, labels are read from column names of |
label.bottom |
Optional labels below graphic cells. The length of the labels must be the same as the number of columns in |
label.right |
Optional labels to the right of graphic cells. The length of the labels must be the same as the number of rows in |
label.pad |
Numeric specifying padding around the labels. Alternatively, the user can individually specify |
label.left.pad , label.right.pad |
Horizontal spacing between row labels and icons. |
label.left.align.horizontal , label.right.align.horizontal , label.top.align.horizontal , label.bottom.align.horizontal |
Horizontal alignment of row and column labels. One of |
label.left.align.vertical , label.right.align.vertical , label.top.align.vertical , label.bottom.align.vertical |
Vertical alignment of row and column labels. One of |
width.height.ratio |
Width-to-height ratio used to adjust row heights and column widths so they match the aspect ratio of the icon. Mis-specfication does not distort icon, but graphic will have extra spacing. When set to zero, row.height and column.width are unchanged, otherwise initial values are decreased to match |
label.top.height |
Height of top label row in pixels. |
label.font.family |
Controls font-family of all labels. To modify only the font of one label use |
label.font.size |
Size of label text. |
label.font.color |
Colour of labels. This can be a string or a 6-digit hex code. |
label.left.font.color , label.right.font.color , label.top.font.color , label.bottom.font.color |
Font color of row/column labels which overrides the global |
label.left.font.size , label.right.font.size , label.top.font.size , label.bottom.font.size |
Font size of row/column labels which overrides the global |
label.left.font.weight , label.right.font.weight , label.top.font.weight , label.bottom.font.weight |
Font weight of row/column labels which overrides the global |
show.label.data |
Boolean indicating whether or not to show data labels. |
customize.label.data |
Boolean indicating whether of not users want to customize data labels. By default this is on, but when set to |
label.data.digits |
Number of digits to show after decimal place. |
label.data.bigmark |
Option to prettify large numbers. By default a comma is placed after a thousand. |
label.data.prefix |
String to prepend data label. |
label.data.suffix |
String to append to data label. |
label.data.100prc |
Option to show data labels multiplied by 100. This is useful when reporting percentages. |
label.data.position |
When |
label.data.font.weight |
Weight of data labels, i.e. one of |
label.data.font.size |
Font size of data labels. |
label.data.font.color |
Font color of data labels. |
label.data.align.horizontal |
Horizontal alignment of data labels. |
label.data.type |
Does nothing. Retained for backwards compatibility. |
data.above.label |
Set to |
... |
Arguments to pass to pictoChart |
xx <- c(First = 3, Second = 6, Third=2)
PictographChart(xx, image="circle", mode="bar")
PictographChart(xx, image="elephant", hide.base.image=TRUE, show.label.data=TRUE, mode="bar")
PictographChart(xx, total.icons=10, mode="bar", fill.direction="fromright", is.custom.url=TRUE,
image="http://wiki.q-researchsoftware.com/images/a/a9/Stick_woman_dark_red.png",
base.image="http://wiki.q-researchsoftware.com/images/7/78/Stick_man_light_grey.png")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.