Data is such a crucial part of not just software development, but society in general. Wherever data resides, and however it’s used, it’s important to display it in a way that helps the audience digest and understand it.
There are many libraries that facilitate data visualization in charts and other forms. billboard.js stands out for its simplicity and ease of use.
In this tutorial, we’ll explore billboard.js and show you how to use it to create beautiful charts in Node.js.
Basic knowledge of HTML, Javascript and how to use libraries
What is billboard.js?
billboard.js is a powerful, reusable, elegant interface chart library based on D3 v4+. It's a JavaScript library that allows developers to create a chart instantly to visualize data.
billboard.js gets its name from the Billboard charts, which tabulate the relative weekly popularity of music released in the U.S. and elsewhere.
Developers like using billboard.js because it’s easy to get started with and use. It also supports D3.js V4+ and offers a wide variety of chart options to choose from.
Installing billboard.js
There are various ways to use billboard.js in a project. billboard.js uses D3.js under the hood, so you’llalso need to load D3.js.
The first way to install billboard.js is to download the library(CSSand JavaScript files) from the officialbillboard.js website and load it into your project:
What is billboard.js?
Installing billboard.js
<!-- Step 1) Load D3.js -->
<script src="https://d3js.org/d3.v5.min.js"></script>
<!-- Step 2) Load billboard.js with style -->
<script src="$YOUR_DOWNLOAD_PATH/billboard.js"></script>
<!-- Load with base style -->
<link rel="stylesheet" href="$YOUR_DOWNLOAD_PATH/billboard.css">
<div id="chart"></div>
$ npm install billboard.js # latest