Learn R Programming

rcdimple (version 0.1)

add_legend: Add a legend to a dimple chart

Description

Parameters provided should match those for dimple.legend constructor. If incomplete parameters are provided then some sane defaults will be applied.

Usage

add_legend(viz, ...)

Arguments

x
y
width
height
horizontalAlign

See Also

Other dimple: add_title; default_colors; dimple; facet.dimple; set_bounds; xAxis.dimple, yAxis.dimple, zAxis.dimple

Examples

Run this code
dimple( weight ~ Time, groups = "Diet" , type = "line", data = ChickWeight, width = 600, height = 400 ) %>%
  add_legend( )

dimple( weight ~ Time, groups = "Diet" , type = "line", data = ChickWeight, width = 600, height = 400 ) %>%
  add_legend( x = 50, y = 390, width = 500, horizontalAlign = "right" )

Run the code above in your browser using DataLab