Usage
fusionLegend(
fusionPlot,
showLegend = TRUE,
interactiveLegend = TRUE,
legendPosition = c("bottom", "left", "right"),
legendAllowDrag = FALSE,
legendIconScale = "1",
reverseLegend = FALSE,
legendCaption = "",
legendCaptionBold = TRUE,
legendCaptionFont = "Arial",
legendCaptionFontSize = "14",
legendCaptionFontColor = "#333333"
)
Arguments
- fusionPlot
fusionPlot object got by
fusionPlot()
- showLegend
Show the legend
- interactiveLegend
Enable interactive legend
- legendPosition
Specify the position of the legend
- legendAllowDrag
Make the legend draggable
- legendIconScale
Specify the legend icon size (values from "1" to "5")
- reverseLegend
Reverse the order of datasets
Specify the legend caption value
Set the legend caption font style to bold
Specify the legend caption font
Specify the legend caption font size
Specify the hex color code for the caption font legend
Examples
library(fusionchartsR)
df <- data.frame(label = c("Venezuela", "Saudi", "Canada", "Russia"), value = c(290, 260, 180, 115))
df %>%
fusionPlot(x = "label", y = "value", type = "doughnut2d") %>%
fusionLegend(legendCaption = "LegendCaption", legendCaptionFontSize = "24") %>%
fusionTheme(theme = "fusion")