Pie Chart in Google Charts
Pie Chart
A pie chart is a circular statistical graphic, which is divided into slices to illustrate numerical proportions. In a pie chart, the arc length of each slice is proportional to the quantity it represents. In other words, it uses pie slices to show relative sizes of data. A pie chart is rendered within the browser using SVG or VML. It displays tooltips when hovering over slices.
Steps for adding Google Pie Charts to your Website:-
- To use Google Pie Chart on your website, add a link to the charts loader.
- After this, add a div with a unique id. Then, we have to load Google Graph API.
- Load the Visualization API with the desired package name. In our case, it is "corechart".
- Set a callback function.
- The visualization API is:- google.charts.load('current', {'packages':['corechart']})
- The callback function will be:- google.charts.setOnLoadCallback(draw_my_chart)
Code Explanation
All Tutorials related to Charts Tutorials
Annotation Chart
Area Charts
Bar Chart
Bubble Chart
Calendar Chart
Candlestick Chart
Column Chart
Combo Chart
Donut Chart
Gauge Chart
Geo Chart
Histogram Chart
Line Chart
Org Chart
Pie Chart
Scatter Chart
Stepped Area Chart
Timelines Chart