VOOZH about

URL: https://www.geeksforgeeks.org/bootstrap/how-to-create-chart-using-bootstrap/

⇱ How to create chart using bootstrap ? - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

How to create chart using bootstrap ?

Last Updated : 3 Oct, 2025

A chart in Bootstrapis a graphical representation for data visualization, in which the data is represented by symbols. The various types of charts like bar charts, line charts, pie charts, donut charts, etc are created with the help of Bootstrap. In other words, we can say that chart is a type of diagram or graph, that organizes and represents a set of numerical or qualitative data.

Approach 1: In this approach, we will create a line chart with the help of Bootstrap and javascript. in which we have used the chart.js file for creating a chart 

Example: In this example, we are creating a line chart. The data is created according to the type of chart. The following chart has the type "line" with 2 different data both for working hours vs free hours.

Output: 

👁 Image
line chart with working and free hours

Approach 2: In this approach, we will create a donut chart by using Bootstrap and javascript, Doughnut charts are the modified version of Pie Charts with the area of the center cut out.

Example: In this example, we have used the chart.js file for creating a donut chart. 

Output:

👁 Image
Doughnut chart
Comment

Explore