Data Visualization with Highcharter in R
Last Updated :
25 Apr, 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
Multivariate Data Visualization with R
A method for visualizing data with numerous variables is called multivariate data visualization with R. In this method, graphs and charts are made to show how the various factors relate to one another. The programming language R, which is frequently used for data visualization, provides a number of
5 min read
Getting started with Data Visualization in R
Data visualization is the technique used to deliver insights in data using visual cues such as graphs, charts, maps, and many others. This is useful as it helps in intuitive and easy understanding of the large quantities of data and thereby make better decisions regarding it.Data Visualization in R
6 min read
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 Excel
Data visualization in Excel is a powerful way to transform complex datasets into clear, interactive visuals that are easy to understand and analyze. Whether you are presenting sales performance, tracking project progress, or comparing trends, using charts and graphs in Excel can make your data more
5 min read
Bar Chart Visualization with Excel Power View
Bar charts are commonly used to compare data points from many data series. The categories are sorted vertically, and values are organized horizontally in a bar chart. To learn more about bar charts please refer here. A bar chart, often known as a bar graph, is a type of chart that uses rectangular b
3 min read
Data Visualization With Altair
Nowadays, Data is an important entity. It should be processed in such a way so that the companies can understand the psychology of the consumers. Data visualization is an important step in processing of data. Altair is a declarative statistical visualization library for Python, built on Vega and Veg
8 min read
Power BI - Data Visualization With Multiple Charts
Sometimes while dealing with hierarchical data we need to combine two or more various chart types into a single chart for better visualization and analysis. These are known as âCombination chartsâ. In this article, we are going to see how to combine a stacked column chart and a line chart in Power B
9 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