ChartWithTable: Plotting a chart with a table

View source: R/chartwithtable.R

ChartWithTableR Documentation

Plotting a chart with a table

Description

Display a chart with a table below it.

Usage

ChartWithTable(
  x,
  table,
  chart.type = "Column",
  global.font.family = "Arial",
  global.font.color = rgb(44, 44, 44, maxColorValue = 255),
  chart.height = 0.6,
  table.height = 1 - chart.height - 0.1,
  table.column.widths = NULL,
  table.values.fill = "transparent",
  table.values.format = ".0f",
  table.values.border.width = 1,
  table.values.border.color = "#FFFFFF",
  table.values.align.horizontal = "center",
  table.values.font.family = global.font.family,
  table.values.font.color = global.font.color,
  table.values.font.size = 10,
  table.values.font.bold = FALSE,
  table.values.font.italics = FALSE,
  table.colhead.show = TRUE,
  table.colhead.fill = "#DDDDDD",
  table.colhead.border.width = 1,
  table.colhead.border.color = "#FFFFFF",
  table.colhead.align.horizontal = "center",
  table.colhead.font.family = global.font.family,
  table.colhead.font.color = global.font.color,
  table.colhead.font.size = 10,
  table.colhead.font.bold = FALSE,
  table.colhead.font.italics = FALSE,
  table.rowhead.show = TRUE,
  table.rowhead.fill = table.colhead.fill,
  table.rowhead.border.width = 1,
  table.rowhead.border.color = "#FFFFFF",
  table.rowhead.align.horizontal = "right",
  table.rowhead.font.family = global.font.family,
  table.rowhead.font.color = global.font.color,
  table.rowhead.font.size = 10,
  table.rowhead.font.bold = FALSE,
  table.rowhead.font.italics = FALSE,
  title = "",
  title.font.family = global.font.family,
  title.font.color = global.font.color,
  title.font.size = 16,
  subtitle = "",
  subtitle.font.family = global.font.family,
  subtitle.font.color = global.font.color,
  subtitle.font.size = 12,
  footer = "",
  footer.font.family = global.font.family,
  footer.font.color = global.font.color,
  footer.font.size = 8,
  footer.wrap = TRUE,
  footer.wrap.nchar = 100,
  margin.left = NULL,
  margin.right = NULL,
  margin.top = NULL,
  margin.bottom = NULL,
  background.fill.color = "transparent",
  background.fill.opacity = 1,
  charting.area.fill.color = background.fill.color,
  charting.area.fill.opacity = 0,
  ...
)

Arguments

x

Input data for chart as a matrix or dataframe.

table

Input data for table shown below chart.

chart.type

Can be one of "Area", "Column", "Bar", "Line".

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.

chart.height

The height of the chart (not including axis) as a proportion of the total display area.

table.height

The height of the table as a proportion of the total display area.

table.column.widths

A vector or comma-separated string specifying the relative widths of columns. If a row-header is shown, this vector should contain one value for the width of the rowheader and then one value for each column in the table.#'

table.values.fill

Background color of the cells in the table.

table.values.format

A string representing a d3 formatting code. See https://github.com/d3/d3/blob/master/API.md#number-formats-d3-format

table.values.border.width

Width of border around table cells (in pixels).

table.values.border.color

Color of border around table cells,

table.values.align.horizontal

Horizontal alignment of text in table cells.

table.values.font.family

Font family of text in table cells.

table.values.font.color

Font color of text in table cells.

table.values.font.size

Font size (in pixels) of text in table cells.

table.values.font.bold

Logical; whether text in table cells should be bold.

table.values.font.italics

Logical; whether text in table cells should be italicized

table.colhead.show

Logical; whether to show column headers in the table. This will be ignored if table does not contain column names.

table.colhead.fill

Background color of the column headers in the table.

table.colhead.border.width

Width of border around table column headers (in pixels).

table.colhead.border.color

Color of border around table column headers,

table.colhead.align.horizontal

Horizontal alignment of text in table column headers.

table.colhead.font.family

Font family of text in table column headers.

table.colhead.font.color

Font color of text in table column headers.

table.colhead.font.size

Font size (in pixels) of text in table column headers.

table.colhead.font.bold

Logical; whether text in table column headers should be bold.

table.colhead.font.italics

Logical; whether text in table column headers should be italicized

table.rowhead.show

Logical; whether to show row headers in the table. This will be ignored if table does not contain row names.

table.rowhead.fill

Background color of the row headers in the table.

table.rowhead.border.width

Width of border around table row headers (in pixels).

table.rowhead.border.color

Color of border around table row headers,

table.rowhead.align.horizontal

Horizontal alignment of text in table row headers.

table.rowhead.font.family

Font family of text in table row headers.

table.rowhead.font.color

Font color of text in table row headers.

table.rowhead.font.size

Font size (in pixels) of text in table row headers.

table.rowhead.font.bold

Logical; whether text in table row headers should be bold.

table.rowhead.font.italics

Logical; whether text in table row headers should be italicized

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.

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

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

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

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

...

Extra arguments passed to the charting function

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

NumbersInternational/flipStandardCharts documentation built on Feb. 26, 2024, 5:43 a.m.