Nepal Population Trend Chart 2022 in JavaScript

We have attempted to experiment on the recent trends in Nepali schooling system with whatever we have at our disposal.

To give you the context – we have preliminary data from the concluded census 2021; and the data from previous population census reports of Nepal. Since we have JavaScript codes (provided further down), we are hereby suggesting involve the students in working on both. This will be relevant in learning social studies, mathematics, computer science, and environmental sciences.

Nepal Population Trend Chart 2021

First, please see the final chart below.

How to Make Interactive Chart Using JavaScript

  • First, work with .js file link (Backend)
    • Copy the script linking the .js file (For code, see below.)
    • Create the new post or page in Blogger or in any web editor that allows HTML editing.
    • Edit the file in HTML mode, or add HTML segment in the post/page.
    • Paste the script copied earlier.
    • You can save the page.
  • Second, work with the JavaScript (Frontend)
    • Copy the JavaScript code (For code, see below.)
    • Come again to the same page/post where you pasted the link to .js file.
    • Make sure you are going to paste in HTML mode, or in the segment that is for HTML codes.
    • Paste the JavaScript.
    • Save the page.

Code to link .js file (Backend)

JavaScript (Frontend)

While creating the charts with values, please do not forget to create a chart with 0 value. We realized that the automatized JS codes tend to shorten the Y-axis close to the least value. If you find any difficulty in implementing this in your teaching, do comment below. I would like to thank my friend The Taluat for permitting to use the code from his blog.


Now, we have learned that we can make our students present the population data in interactive manner using the JavaScript.

Leave a Comment