Building graphical charts with frontend libraries
Most developers prefer rendering graphs and charts using frontend libraries rather than matplotlib
, which requires complex Python coding to refine presentation and lacks UI-related features such as responsiveness, adaptability, and user interaction. This section will highlight the Chart.js, Bokeh
, and Plotly
libraries, which are all popular libraries with varying strengths and weaknesses as external tools for visualization.
Let’s begin with Chart.js.
Plotting with Chart.js
The most common and popular charting library used in many visualization applications is Chart.js. It is 100% JS, is lightweight, is easy to use, and has a straightforward syntax for designing graphs and charts. The following is the Chart.js implementation that displays the mean HPI values of certain countries:
<!DOCTYPE html> <html lang="en"> <head> … … … … … … ...