Data Visualization with Highcharter in R
Last Updated :
23 Jul, 2025
Highcharter is an R package that provides an interface to the Highcharts JavaScript library, enabling the creation of interactive and customizable charts. It supports a variety of chart types, such as line, bar and scatter charts and offers extensive customization options for appearance and behavior.
It allows users to build dynamic visualizations with features like zooming, panning, tooltips and interactive data exploration. It also offers flexibility in styling chart elements (axes, titles, legends) and configuring animations and data labels.
Key features include:
- Customizability: Users can adjust colors, fonts, labels and tooltips and add elements like legends and annotations.
- Interactivity: Highcharter charts enable real-time exploration with zooming, hovering and data point highlighting.
- Integration: Easily integrates with R packages like dplyr, tidyr and ggplot2.
- Compatibility: Supports various data formats (CSV, JSON, SQL) and languages (English, Spanish, French, German).
- Responsive design: Charts automatically adjust to different screen sizes, making them suitable for web and mobile applications.
Installing and Loading
To install and load the Highcharter library in R , we will use the install.packages() and library() function.
R
install.packages("highcharter")
library(highcharter)
Different Visualizations in Highcharter Library
We will explore afew examples of how highcharter can be used to create different types of charts in R programming language.
1. Line Chart
A line chart is a great way to visualize trends over time. With Highcharter, you can create a line chart using the hc_line() function, which takes a data frame as input and maps the x and y columns to the chart's x and y axes.
Example:
In this example, we create a data frame with two columns, date and sales and use highchart() to create a chart object. We map the date column to the x-axis using hc_xAxis() and then add a line series to the chart using hc_add_series(). The type = "line" argument specifies that we want to create a line chart.
R
library(highcharter)
data <- data.frame(
date = seq(as.Date("2022/01/01"), by = "month", length.out = 12),
sales = c(10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32)
)
highchart() %>%
hc_xAxis(categories = data$date) %>%
hc_add_series(data$sales, type = "line")
Output:
Line chart with Highcharter in R2. Bubble Chart
A bubble chart is a great way to visualize three variables at once, where the size of the bubble represents the third variable. With Highcharter, you can create a bubble chart using the hc_bubble() function.
Example:
In this example, we create a data frame with three columns, x, y and z and use hc_bubble() to create a bubble chart. We customize the chart by specifying the name of the series, the maximum size of the bubbles and enabling data labels that display the value of the third variable. We also customize the x and y axes by adding titles to them.
R
library(highcharter)
data <- data.frame(
x = rnorm(50),
y = rnorm(50),
z = runif(50, min = 5, max = 20)
)
highchart() %>%
hc_add_series(data = data, type = "bubble",
name = "Bubbles",
maxSize = 20,
dataLabels = list(enabled = TRUE, format = "{point.z}")) %>%
hc_xAxis(title = list(text = "X-axis")) %>%
hc_yAxis(title = list(text = "Y-axis"))
Output:
Bubble chart with Highcharter in R3. Bar Chart
A bar chart is used to compare values across categories. We can create a bar chart using the hc_column() function, which takes a data frame as input and maps the x and y columns to the chart's x and y axes.
Example:
In this example, we first create a data frame with two columns (category and value) representing the categories and values we want to plot. Then, we create a basic column chart using the hc_chart(type = "column") function and add a title to the chart with hc_title(). We specify the x-axis categories using hc_xAxis(categories = data$category) and add a y-axis title with hc_yAxis(title = list(text = "Value")). Finally, we add a series to the chart with hc_add_series(data = data$value, name = "Values"), specifying the data we want to plot and the series name.
R
data <- data.frame(
category = c("A", "B", "C", "D"),
value = c(10, 20, 30, 40)
)
highchart() %>%
hc_chart(type = "column") %>%
hc_title(text = "Example Bar Chart") %>%
hc_xAxis(categories = data$category) %>%
hc_yAxis(title = list(text = "Value")) %>%
hc_add_series(data = data$value, name = "Values")
Output:
Bar chart with Highcharter in R4. Heat map
A heatmap is used to visualize data in a matrix format, where values are represented by color intensity. In Highcharter, we can create a heatmap using the hc_chart(type = "heatmap")
function along with hc_add_series()
, where we provide a matrix or a data frame specifying the x and y coordinates and corresponding values.
Example:
In this example, we are using hc_add_series()
to create a heatmap by passing the matrix mat
as the data source. We define the color scale with hc_colorAxis()
and customize the tooltip display using hc_tooltip()
. The x- and y-axis titles are added with hc_xAxis()
and hc_yAxis()
, where we also set the axis categories using colnames(mat)
and rownames(mat)
, respectively. The y-axis is reversed using the reversed
argument and we add a chart title with hc_chart()
R
library(highcharter)
set.seed(123)
mat <- matrix(rnorm(100), ncol = 10)
highchart() %>%
hc_add_series(data = mat, type = "heatmap") %>%
hc_colorAxis(stops = color_stops(10, colors = c("#FFFFCC", "#800026"))) %>%
hc_tooltip(pointFormat = "Value: {point.value:.2f}") %>%
hc_xAxis(categories = colnames(mat), title = list(text = "X-Axis")) %>%
hc_yAxis(categories = rownames(mat), title = list(text = "Y-Axis"), reversed = TRUE) %>%
hc_chart(title = list(text = "Heatmap Title"))
Output

In this article, we explored the highcharter
package in R for building interactive and customizable visualizations using the Highcharts JavaScript library. We looked at its syntax, features and chart types, including heatmaps and bar charts, to understand how it supports dynamic data presentation in R.
Similar Reads
Master Data Visualization With ggplot2 In this article, we are going to see the master data visualization with ggplot2 in R Programming Language. Generally, data visualization is the pictorial representation of a dataset in a visual format like charts, plots, etc. These are the important graphs in data visualization with ggplot2, Bar Ch
8 min read
Data visualization with R and ggplot2 The ggplot2 ( Grammar of Graphics ) is a free, open-source visualization package widely used in R Programming Language. It includes several layers on which it is governed. The layers are as follows:Layers with the grammar of graphicsData: The element is the data set itself.Aesthetics: The data is to
7 min read
Data Visualization in R Data visualization is the practice of representing data through visual elements like graphs, charts, and maps. It helps in understanding large datasets more easily, making it possible to identify patterns and trends that support better decision-making. R is a language designed for statistical analys
5 min read
How to create interactive data visualizations with ggvis Creating interactive data visualizations is a powerful way to explore and present data. The ggvis package in R provides a flexible framework for building these visualizations by combining the capabilities of dplyr data manipulation and Shiny interactivity. This article will guide you through the pro
7 min read
Data Visualization using ggvis Package in R The ggvis is an interactive visualization package in R language that is based on the popular ggplot2 package. It allows you to create interactive plots and graphics that can be explored and manipulated by the user. ggvis supports a wide range of plot types including scatter plots, line charts, bar c
15+ min read
Data Visualization using GoogleVis Package GoogleVis is a package in R that is used to act as an interface between R and the Google API to produce interactive charts which can be easily embedded into web pages. This package helps the user to plot the data without uploading them into google. In this article let's parse through some charts tha
5 min read