Interactive Bubble Chart in R
A bubble chart is used to find and show relationships between numeric variables. with this technique, the dataset is visualized in two to four dimensions. It is used to find various insights into business and industry sectors. This chart is implemented in R Programming Language using Highcharter Library. Highcharter is an Open-Source library, which provides user-friendly interactive charts for the program as well as for web applications.
Example: Creating Interactive Bubble Chart Fruits Left After Selling among the countries.
Creating Interactive Bubble Chart using highcharter
Load the dataset and import the Highcharter library. Create a chart object using hchart function. Pass type, respected data vectors, and Size of bubble, to the hchart(type, axes, max size), that needed to be plotted.
Creating Interactive Bubble Chart using ggplot2 and plotly
ggplot2 Package in R programming Language also termed as the grammar of graphics is free open source and easy to use. ggplot2 will make only graphs. to make them interactive we use Plotly library.
Load the gapminder dataset and filter the data needed to be displayed on the graph. Prepare a tooltip that needed to be displayed on the graph and pass the x-axis, y-axis, size, attribute, and tooltip to the ggplot(aes(x, y, size, color, text)). For displaying the relationship select the geom_point() function. Make the plot interactive using ggplotly(data, tooltip).
Please Login to comment...