A bar chart shows variations in quantity of some entity using rectangles either drawn vertically or horizontally on a chart. As you visualize the different lengths of rectangles on the chart, it is easy to figure out which category is more and which one is less. Bar charts have three main advantages:
You can see the data relationships in the x and y axes
You can easily compare the values among different categories
You can also use them to visualize trends
As an example, take a look at the following bar chart, which shows the number of cars made by different countries (as shown in
As you can see in the preceding chart, this dataset has a maximum number of cars from the UK followed by the USA, followed by Italy, and so on.
Let's explore this example further with the actual code. The
cars.json dataset that is analyzed by the preceding chart, has the following format: