This repository contains demonstrations of the highcharter
package for R.
highcharter
is a wrapper for the Highcharts JavaScript library.
The demos are Quarto documents showcasing charts created with various methods:
highchartzero()
. This function creates a Highchart chart using htmlwidgets. The accessibility module can be added as a dependency with this chart.hcmap()
. This creates a map from Highmaps - Map Collection.highchart(type = "stock")
. This function creates a Highchart stock chart using htmlwidgets.
Each demo shows a data visualization using one of the methods above. The general pattern is to:
-
Load the necessary R packages.
-
Build, import, or read data.
-
Set accessibility options using options() for the chart.
-
Set the Highcharts version 11 color palette.
-
Visualize the chart.
The demos are organized in Quarto Documents.
The repository is organized into folders for each of the Highcharts libraries:
highcharts-core
contains demos of the Highcharts Core libraryhighcharts-maps
contains demos of the Highcharts Maps libraryhighcharts-stock
contains demos of the Highcharts Stock libraryhighcharts-gantt
contains demos of the Highcharts Gantt library
In each folder, there are sub-folders grouping demos by category. For example:
highcharts-core/line-charts
folder contains Quarto Documents that demonstrate line chart functionality.highcharts-core/line-charts/data-raw
folder contains R scripts for downloading data files.highcharts-core/line-charts/data
folder contains downloaded data files.
The Boost module is an advanced chart feature for rendering large amounts of data points and series:
boost-module
folder contains demos of the Boost module with R scripts.
To use the demos locally, you can follow these steps:
- Clone this GitHub repo:
$ git clone https://github.com/darylalim/highcharter-demos.git
- Open in RStudio:
- File > Open Project.
- Navigate to the directory downloaded above.
- Double-click
highcharter-demos.Rproj
to open the project.
In the "Files" tab, you should see a set of Quarto Documents included in the repository, along with data files and R scripts.
To see how highcharter
generates a basic line chart, you can open the Quarto Document at highcharts-core/line-charts/basic-line.qmd
.
Run the Quarto Document to see the chart.