SinglePicto: SinglePicto

SinglePictoR Documentation

SinglePicto

Description

Creates a single pictograph. Allows customization of the number of icons and dimensions.

Usage

SinglePicto(
  x,
  total.icons = NA,
  image = "star",
  base.image = "",
  is.custom.url = FALSE,
  number.rows = NA,
  number.cols = NA,
  width.height.ratio = 1,
  layout = NA,
  scale = 1,
  maximum.value = NA,
  hide.base.image = FALSE,
  fill.direction = "fromleft",
  fill.icon.color = "black",
  base.icon.color = "",
  background.color = "transparent",
  auto.size = FALSE,
  icon.width = 50,
  pad.row = 0,
  pad.col = 0,
  margin = 0,
  margin.top = margin,
  margin.right = margin,
  margin.bottom = margin,
  margin.left = margin,
  label.data.position = c("None", "Above", "Below")[1],
  label.data.digits = 0,
  label.data.bigmark = ",",
  label.data.prefix = "",
  label.data.suffix = "",
  label.data.100prc = FALSE,
  label.data.font.weight = "normal",
  label.data.font.size = 12,
  label.data.font.family = "arial",
  label.data.font.color = "#2C2C2C",
  label.data.align.horizontal = "center",
  graphic.width.inch = NA,
  graphic.height.inch = NA,
  graphic.resolution = 96,
  print.config = FALSE,
  x.limit = 1000
)

Arguments

x

Input data which determines the number of icons (x/scale) filled in the pictograph.

total.icons

Total number of icons. Defaults to total.icons=ceiling(x/scale).

image

The name of the icon to use (e.g. "star", "stickman") or the URL of an image when is.custom.url is true.

base.image

The URL of the base image. Only used if is.custom.url = TRUE and hide.base.image = FALSE.

is.custom.url

When set to true, image is expected to be a URL to an jpeg or png image file available from online.

number.rows

If neither number.rows and number.cols is supplied, the default behaviour is to place icons according to width.height.ratio. Note that number.rows is ignored when number.cols is non-zero.

number.cols

Maximum number of icons in each column. Overrides number.rows and width.height.ratio.

width.height.ratio

Width to height ratio of pictograph if layout == "Width-to-height ratio".

layout

Optional parameter to determine how the layout is specified. Can be one of "Width-to-height ratio", "Number of rows", "Number of columns", "Fill graphic". If not supplied, a decision will be made based on which parameters are supplied

scale

Scaling factor for x. Defaults to 1.

maximum.value

Maximum value x is expected to take. When this is value is specified, the pictograph will display x as a proportion out of maximum.value. This value overrides scale.

hide.base.image

Set to TRUE to use blank background instead of base image.

fill.direction

Direction in which pictograph is filled (one of "fromleft","fromright","fromtop","frombottom").

fill.icon.color

Color of the filled icons. Only applicable for built-in icons.

base.icon.color

Color of the unfilled icons when hide.base.image == FALSE. Defaults to grey (#CCCCCC). Only applicable for built-in icons.

background.color

Color of the graphic background

auto.size

Automatically sizes the plot based on the size of the window/slot.

icon.width

Width of a single icon in pixels when auto.size is FALSE.

pad.row

Vertical space between icons. This should be a number between 0 (no space) and 1.0 (all space).

pad.col

Horizontal space between icons.

margin

Controls space on margins of the graphic. When margin is used, space on all 4 sides are adjusted simultaneously, but margins can also be adjusted separately using margin.top, margin.right, margin.bottom, margin.left.

margin.top

Spacing on top of graphic. This value overrides margin.

margin.right

Spacing on the right of the graphic.

margin.bottom

Spacing below graphic.

margin.left

Spacing on the left of the graphic.

label.data.position

One of "None", "Above" or "Below".

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.font.weight

Weight of data labels, i.e. one of "bold" or "normal".

label.data.font.size

Font size of data labels.

label.data.font.family

Font in which the data labels are displayed.

label.data.font.color

Font color of data labels.

label.data.align.horizontal

Horizontal alignment of data labels.

graphic.width.inch

(deprecated) Horizontal dimension of the chart output in inches. If these dimensions are not specified, the width-to-height ratio of the chart output may not match the desired dimensions.

graphic.height.inch

(deprecated) Verical dimension of the chart output in inches.

graphic.resolution

(deprecated) Conversion from inches to pixels.

print.config

If set to TRUE, the JSON string used to generate pictograph will be printed to standard output. This is useful for debugging.

x.limit

Upper limit of x above which scale is automatically calculated. This can be set to NA, but may cause slowness or freezing when the user inputs a large x.

See Also

PictographChart to create a chart or table of pictographs

Examples

xx <- 4
SinglePicto(xx)
SinglePicto(xx, total.icons=10, image="stickman", number.cols=5,
   fill.icon.color="red", base.icon.color="deepskyblue")
SinglePicto(xx, 9, number.rows=3, is.custom.url=TRUE,
   image="http://wiki.q-researchsoftware.com/images/9/91/Star_filled.svg",
   base.image="http://wiki.q-researchsoftware.com/images/2/21/Star_unfilled.png")

NumbersInternational/flipPictographs documentation built on Feb. 26, 2024, 5:38 a.m.