gaugeChart: Gauge Chart

Description Usage Arguments Functions Viewports Header Examples

Description

Plot gauge charts using grid graphics package.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
gaugeChart(value, min, max, sectors = gaugeChartSectors(), header, label,
  gp = gpar(), vp, fmt = NULL)

.gaugeHeader(header, vp)

.gaugeDisplay(x, min = 0, max = 1, label = NULL, fmt = NULL,
  gp.beam = gpar(), vp)

.gaugeAxis(min = 0, max = 1, label = NULL, fmt = NULL, r = c(0.6, 1),
  n = 5)

.gaugeBeam(x, r = c(0.6, 1), gp = gpar())

Arguments

value

numeric, value to display

min, max

numeric, minimum and maximum value for gauge chart axis

sectors

an object of gaugeChartSectors-class specifying the the sectors for gaug chart axis

header

string, header of the gauge chart, see header section below

label

string, label for the gauge chart axis

gp

an object of class gpar

vp

an viewport object defining the plot region for the gauge chart, see viewports section below

fmt

opional format string, if supplied, the value and axis ranges min/max will be formatted using sprintf

gp.beam

an object of class gpar specifying the gauge chart's beam's color

r

numeric, inner and outer radius for gauge chart axis

n

number of steps for the shading of the axis background

Functions

Viewports

The different parts of the gauge chart will be shown in separate viewports. All viewports inherit from the parent viewport vp. If vp is not given, the current plot region will be taken as paren viewport.

The gauge chart will be displayed in a separate viewport with aspect ratio (i.e. width to height) of 2. The viewport will be fitted in 95 parent viewport's width and height.

The axis labels will be plotted below the viewport with an offset of unit(0.5, "lines").

Header

If header is given, the gaug chart's viewport will be split in two viewports. The upper one has a height of unit(4, "lines") and contains the header.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
## Not run: 
sectors <- gaugeChartSectors(200, 100, 0, rev = TRUE)

pushViewport(gp = gpar(fontsize = 9, col = '#d7d7d7', fill = 'white'))

gaugeChart(125, 0, 300, header = 'Tagesanmeldungen',
    sectors = sectors, label = 'on risk')

popViewport()

## End(Not run)

mlkornexl/gridGaugeChart documentation built on May 12, 2019, 4:26 p.m.