GetNumColors: Determines the number of colors required in a chart

View source: R/getnumcolors.R

GetNumColorsR Documentation

Determines the number of colors required in a chart

Description

Returns the number of colors needed in a chart. This is returned as a list because more than one color-series may be required (e.g. Pie chart)

Usage

GetNumColors(
  data,
  chart.type,
  scatter.colors.column = 4,
  multi.color.series = FALSE
)

Arguments

data

Input data, a named vector or matrix.

chart.type

Type of chart to plot

scatter.colors.column

For scatterplot data, the column of data which is used to determine the colors of each point.

multi.color.series

For bar and column charts, a logical indicating how colors are used. By default, this value is set to FALSE, in which case the number of colors returned is equal to the number of data series (or columns) in data. When multi.color.series == TRUE, multiple colors are assigned to the categories within a single data series, so the number of colors returned is equal to NROW(data).

Value

An integer specifying the number of colors used by the chart.


Displayr/flipChartBasics documentation built on Feb. 26, 2024, 12:35 a.m.