hpackedbubble: Create Split Packed Bubble Charts

Description Usage Arguments Examples

View source: R/hpackedbubble.R

Description

By binding R functions and the 'Highcharts' http://www.highcharts.com/ charting library, 'hpackedbubble' package provides a simple way to draw split packed bubble charts.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
hpackedbubble(cat, name, value, theme = "sandsignika", width = NULL,
  height = NULL, title = "", titleAlign = "center",
  titleSize = "20px", titleColor = "#333333", subtitle = "",
  subtitleAlign = "center", subtitleSize = "",
  subtitleColor = "#666666",
  pointFormat = "<b>{point.name}:</b> {point.y}", split = 1,
  packedbubbleMinSize = "50%", packedbubbleMaxSize = "250%",
  packedbubbleZMin = 0, packedbubbleZmax = 1000,
  gravitational = 0.0625, seriesInteraction = 1,
  dragBetweenSeries = 1, parentNodeLimit = 1, dataLabels = 1,
  dataLabelsformat = "{point.name}", dataLabelsFilter = 250,
  dataLabelsColor = "black")

Arguments

cat

category verctor;

name

name vector;

value

value vector;

theme

chart theme, you can use these themes: darkgreen/darkblue/avocado/darkunica/gray/ gridlight/grid/sandsignika/sunset;

width

chart width, for example, "100%";

height

chart height, for example, "400px";

title

title;

titleAlign

title alignment, left/center/right;

titleSize

title size, like "20px";

titleColor

title color, like "#333333";

subtitle

subtitle;

subtitleAlign

subtitle alignment, left/center/right;

subtitleSize

subtitle size, like "16px";

subtitleColor

subtitle color, like "#666666"

pointFormat

The HTML of the point's line in the tooltip.

split

Whether to split series into individual groups or to mix all series together. 1 means to split, 0 means to not, defaults to split;

packedbubbleMinSize

Minimum bubble size. Defaults to '50%';

packedbubbleMaxSize

Maximum bubble size. Defaults to '250%';

packedbubbleZMin

The minimum for the Z value range. Defaults to 0, you can use the lowest Z value in the data;

packedbubbleZmax

The maximum for the Z value range. Defaults to 1000, you can use the highest Z value in the data;

gravitational

Gravitational const used in the barycenter force of the algorithm. Defaults to 0.0625.

seriesInteraction

Whether series should interact with each other or not. 1 means to true, 0 means to false, defaults to 1;

dragBetweenSeries

In case of split series, this option allows user to drag and drop points between series, for changing point related series. 1 means to true, 0 means to false, defaults to 1;

parentNodeLimit

Whether bubbles should interact with their parentNode to keep them inside. 1 means to true, 0 means to false, defaults to 1;

dataLabels

Options for the series data labels, appearing next to each data point. 1 means to true, 0 means to false, defaults to 1;

dataLabelsformat

Data labels' format

dataLabelsFilter

Show data labels while 'value' larger than dataLabelsFilter. defaults to 250.

dataLabelsColor

Data labels' color, defaults to black.

Examples

1
2
3
4
library(hpackedbubble)
if (interactive()) {
  hpackedbubble(CO2$continent, CO2$country, CO2$CO2)
}

Example output

Attaching package:hpackedbubbleThe following object is masked frompackage:datasets:

    CO2

hpackedbubble documentation built on Aug. 19, 2019, 5:04 p.m.