Hello Coders, In this blog post, You will learn to add a Bar chart in HTML. A bar chart is a chart that represents data with a rectangular bar. We will make two types of bar charts one is a vertical bar chart and the other is a horizontal bar chart. Let us learn about them in detail:-
![Bar chart in html](https://codeblockx.com/wp-content/uploads/2023/06/codeblockx-75-768x432.png)
To make this line graph in Html we will use a charting library named plotly.js in JavaScript. This Library comes with 40 chart types, 3D charts, Statistical graphs, and SVG Maps. This Graphs Code Consists Const data which is used to define data, Const layout is used to define the layout of the graph, and plotly.newplot is used to show the graph. The code and Output for these charts are:-
1. Vertical Bar Chart
Index.html
OUTPUT
![Vertical bar chart](https://codeblockx.com/wp-content/uploads/2023/06/Screenshot-2023-06-26-191714-768x578.png)
2. Horizontal Bar Chart
Index.html
OUTPUT
![Horizontal Bar Chart](https://codeblockx.com/wp-content/uploads/2023/06/Screenshot-2023-06-26-191916-768x608.png)
We hope you got the answer to your question. As you are now learned about Bar charts you should now learn about Creating a line graph in html. As both the topics are related Check it out we have a detailed blog post on it and it will be helpful to you.
Thank you for visiting our blog. If you have any doubts about any coding questions then let us know in the comments section we will answer them as soon as possible. Till then check out more posts and find answers to more amazing questions.
Exploring Digital Marketing Opportunities
seo http://www.cb-top.com.
Digital Marketing Best Practices
online marketing https://www.cb-top.com.
world news https://www.ve-online.com/.