Radar: Radar

View source: R/radarchart.R

RadarR Documentation

Radar

Description

Radar chart, also known as web chart, spider chart, star chart, star plot, cobweb chart, irregular polygon, polar chart, or Kiviat diagram

Usage

Radar(
  x,
  annotation.list = NULL,
  overlay.annotation.list = NULL,
  title = "",
  title.font.family = global.font.family,
  title.font.color = global.font.color,
  title.font.size = 16,
  title.align = "center",
  colors = ChartColors(max(1, ncol(x), na.rm = TRUE)),
  opacity = NULL,
  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.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,
  legend.position.y = NULL,
  legend.position.x = NULL,
  hovertext.font.family = global.font.family,
  hovertext.font.size = 11,
  hovertext.template = NULL,
  hovertext.align = "left",
  margin.autoexpand = TRUE,
  margin.top = NULL,
  margin.bottom = NULL,
  margin.left = NULL,
  margin.right = NULL,
  margin.inner.pad = NULL,
  pad.left = 0,
  pad.right = 0,
  line.thickness = 3,
  tooltip.show = TRUE,
  modebar.show = FALSE,
  zoom.enable = TRUE,
  axis.drag.enable = FALSE,
  global.font.family = "Arial",
  global.font.color = rgb(44, 44, 44, maxColorValue = 255),
  grid.show = TRUE,
  x.tick.show = TRUE,
  x.tick.font.color = global.font.color,
  x.tick.font.family = global.font.family,
  x.tick.font.size = 12,
  x.grid.width = 1 * grid.show,
  x.grid.color = rgb(225, 225, 225, maxColorValue = 255),
  y.bounds.maximum = NULL,
  y.bounds.minimum = NULL,
  y.tick.distance = NULL,
  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 = "",
  hovertext.show = TRUE,
  y.hovertext.format = "",
  y.tick.font.color = global.font.color,
  y.tick.font.family = global.font.family,
  y.tick.font.size = 10,
  x.tick.label.wrap = TRUE,
  x.tick.label.wrap.nchar = 21,
  marker.show = FALSE,
  marker.symbols = "circle",
  marker.size = 6,
  marker.colors = colors,
  marker.opacity = 1,
  data.label.show = FALSE,
  data.label.offset = 0.1,
  data.label.font.family = global.font.family,
  data.label.font.size = 10,
  data.label.font.color = global.font.color,
  data.label.font.autocolor = FALSE,
  data.label.format = "",
  data.label.prefix = "",
  data.label.suffix = "",
  data.label.values.only = FALSE,
  average.series = NULL,
  average.color = rgb(230, 230, 230, maxColorValue = 255),
  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
)

Arguments

x

Input data in the form of a vector or matrix. The categories used to create the radar (i.e. the x-axis) is taken from the names/rownames of x.

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.

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.

colors

Character; a vector containing one or more colors specified as hex codes.

opacity

Opacity of area fill colors as an alpha value (0 to 1).

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 (TRUE or FALSE); or a string ("Show" or "Hide"). If it is TRUE or NA (the default), a legend will be shown only if there is more than one data series. To force a legend to be shown even with 1 data series, use "Show" instead.

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.wrap TRUE.

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.

legend.position.y

A numeric controlling the position of the legend. Values range from 0 (bottom) to 1 (top).

legend.position.x

A numeric controlling the position of the legend. Values range from -0.5 (left) to 1.5 (right).

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 chart.matrix. If no format is specified the default is for categorical x-axis "%x: %y" or for a numerical x-axis "(%x, %y)".

hovertext.align

Horizontal alignment of hover text. Only observable when hover contain multiple 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.

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

pad.left

Spacing on the left of the chart. Mainly used by SmallMultiples.

pad.right

Spacing on the right of the chart. Mainly used by SmallMultiples.

line.thickness

Thickness of outline of radar polygons.

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 zoom.enable = TRUE. Note that in similar functionality is already available using zoom.

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.

grid.show

Logical; whether to show grid lines.

x.tick.show

Whether to display the x-axis tick labels (i.e. labels around the sides of the radar chart)

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

y.bounds.maximum

Maximum of range for plotting; NULL = no manual range set.

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.tick.distance

Distance between tick marks. Requires that y.bounds.minimum and y.bounds.maximum have been set.

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 (i.e. radial distance from center)

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

hovertext.show

Logical; whether to show hovertext.

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

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 label.wrap is TRUE.

marker.show

Can be "none", "automatic" or a vector referencing the plotly symbol dictionary using either numerics or strings.

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.

marker.size

Size in pixels of marker

marker.colors

Character; a vector containing on/mae or more colors specified as hex codes.

marker.opacity

Opacity for markers as an alpha value (0 to 1).

data.label.show

Logical; whether to show data labels.

data.label.offset

Numeric; controls the distance between the data points to the data label.

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.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.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.values.only

Logical; whether to show only the values in the datal labels instead of the default category label and values.

average.series

a vector of values which create an additional data series named "Average". This is usually used by SmallMultiples. For bar/column charts, the average is shown as a line, for Line and Area, the average series is shown in the same way as the other data series but it is shown without data labels.

average.color

Color of the average.series as a hex code or string

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 footer.wrap TRUE.

Examples

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")

Displayr/flipStandardCharts documentation built on Feb. 26, 2024, 12:42 a.m.