{"id":2342,"date":"2017-04-24T16:31:59","date_gmt":"2017-04-24T16:31:59","guid":{"rendered":"https:\/\/www.codexworld.com\/?p=2342"},"modified":"2017-04-24T16:31:59","modified_gmt":"2017-04-24T16:31:59","slug":"create-dynamic-pie-chart-php-mysql-google-charts-api","status":"publish","type":"post","link":"https:\/\/www.codexworld.com\/create-dynamic-pie-chart-php-mysql-google-charts-api\/","title":{"rendered":"Create Dynamic Pie Chart in PHP with Google Charts"},"content":{"rendered":"<p>A <b>pie chart<\/b> is a circular graph which is divided into slices to represent numerical proportion. The pie chart mainly used to show comparison and the graphical representation helps understand the comparison easily. The pie chart is the perfect choice to illustrate data in a percentage format.<\/p>\n<p>If you have a requirement to show the statistics of data with a pie chart, there is an easy way to create the pie chart in the web application. In this tutorial, we will show you how to <b>create a dynamic pie chart with PHP and MySQL<\/b>.<\/p>\n<p>Google Visualization API provides an easy way to create charts on the website. Using Google charts API, you can generate pie chart to populate data from the database within minutes. Here we&#8217;ll create different types of pie charts to show dynamic data from the MySQL database using <b>PHP and Google charts API<\/b>. Also, this tutorial will help you to make <b>Google pie chart dynamic<\/b> with PHP and MySQL.<\/p>\n<h2>Making a Dynamic Pie Chart with PHP and MySQL<\/h2>\n<p>In our example pie chart script, we&#8217;ll show some programming languages on the pie chart. Also, the data will be retrieved from the MySQL database and their popularity will be shown on the pie chart.<\/p>\n<p><b>Database Table Creation<\/b><br \/>\nTo store the programming languages data a table needs to be created in the database. The following SQL creates a table named <code>programming_languages<\/code> in the MySQL database.<\/p>\n<pre><span style=\"color:#794938\">CREATE<\/span> <span style=\"color:#794938\">TABLE<\/span> `<span style=\"color:#bf4f24\">programming_languages<\/span>` (\r\n <span style=\"color:#0b6125\">`id`<\/span> <span style=\"color:#a71d5d;font-style:italic\">int<\/span>(<span style=\"color:#811f24;font-weight:700\">11<\/span>) <span style=\"color:#794938\">NOT NULL<\/span> AUTO_INCREMENT,\r\n <span style=\"color:#0b6125\">`name`<\/span> <span style=\"color:#a71d5d;font-style:italic\">varchar<\/span>(<span style=\"color:#811f24;font-weight:700\">255<\/span>) COLLATE utf8_unicode_ci <span style=\"color:#794938\">NOT NULL<\/span>,\r\n <span style=\"color:#0b6125\">`rating`<\/span> <span style=\"color:#a71d5d;font-style:italic\">int<\/span>(<span style=\"color:#811f24;font-weight:700\">5<\/span>) <span style=\"color:#794938\">NOT NULL<\/span>,\r\n <span style=\"color:#0b6125\">`status`<\/span> enum(<span style=\"color:#0b6125\">'1'<\/span>,<span style=\"color:#0b6125\">'0'<\/span>) COLLATE utf8_unicode_ci <span style=\"color:#794938\">NOT NULL<\/span> DEFAULT <span style=\"color:#0b6125\">'1'<\/span>,\r\n <span style=\"color:#a71d5d;font-style:italic\">PRIMARY KEY<\/span> (<span style=\"color:#0b6125\">`id`<\/span>)\r\n) ENGINE<span style=\"color:#794938\">=<\/span>InnoDB DEFAULT CHARSET<span style=\"color:#794938\">=<\/span>utf8 COLLATE<span style=\"color:#794938\">=<\/span>utf8_unicode_ci;\r\n<\/pre>\n<p><b>Dynamic Data on Google Pie Chart<\/b><br \/>\nAt first dynamic data will be retrieved from the <code>programming_languages<\/code> table using PHP and MySQL. After that, the programming language names and ratings will be specified in the <code>data<\/code> variable.<br \/>\nIn <code>options<\/code> variable, you can specify the desired title, width, and height of the pie chart.<\/p>\n<pre><span style=\"color: #0000BB\">&lt;?php<br \/><\/span><span style=\"color: #FF8000\">\/\/&nbsp;Database&nbsp;credentials<br \/><\/span><span style=\"color: #0000BB\">$dbHost&nbsp;<\/span><span style=\"color: #007700\">=&nbsp;<\/span><span style=\"color: #DD0000\">'localhost'<\/span><span style=\"color: #007700\">;<br \/><\/span><span style=\"color: #0000BB\">$dbUsername&nbsp;<\/span><span style=\"color: #007700\">=&nbsp;<\/span><span style=\"color: #DD0000\">'root'<\/span><span style=\"color: #007700\">;<br \/><\/span><span style=\"color: #0000BB\">$dbPassword&nbsp;<\/span><span style=\"color: #007700\">=&nbsp;<\/span><span style=\"color: #DD0000\">'root'<\/span><span style=\"color: #007700\">;<br \/><\/span><span style=\"color: #0000BB\">$dbName&nbsp;<\/span><span style=\"color: #007700\">=&nbsp;<\/span><span style=\"color: #DD0000\">'codexworld'<\/span><span style=\"color: #007700\">;<br \/><br \/><\/span><span style=\"color: #FF8000\">\/\/&nbsp;Create&nbsp;connection&nbsp;and&nbsp;select&nbsp;db<br \/><\/span><span style=\"color: #0000BB\">$db&nbsp;<\/span><span style=\"color: #007700\">=&nbsp;new&nbsp;<\/span><span style=\"color: #0000BB\">mysqli<\/span><span style=\"color: #007700\">(<\/span><span style=\"color: #0000BB\">$dbHost<\/span><span style=\"color: #007700\">,&nbsp;<\/span><span style=\"color: #0000BB\">$dbUsername<\/span><span style=\"color: #007700\">,&nbsp;<\/span><span style=\"color: #0000BB\">$dbPassword<\/span><span style=\"color: #007700\">,&nbsp;<\/span><span style=\"color: #0000BB\">$dbName<\/span><span style=\"color: #007700\">);<br \/><br \/><\/span><span style=\"color: #FF8000\">\/\/&nbsp;Get&nbsp;data&nbsp;from&nbsp;database<br \/><\/span><span style=\"color: #0000BB\">$result&nbsp;<\/span><span style=\"color: #007700\">=&nbsp;<\/span><span style=\"color: #0000BB\">$db<\/span><span style=\"color: #007700\">-&gt;<\/span><span style=\"color: #0000BB\">query<\/span><span style=\"color: #007700\">(<\/span><span style=\"color: #DD0000\">\"SELECT&nbsp;name,rating&nbsp;FROM&nbsp;programming_languages&nbsp;WHERE&nbsp;status&nbsp;=&nbsp;'1'&nbsp;ORDER&nbsp;BY&nbsp;rating&nbsp;DESC\"<\/span><span style=\"color: #007700\">);<br \/><\/span><span style=\"color: #0000BB\">?&gt;<\/span><\/pre>\n<pre>&lt;!<span style=\"color:#bf4f24\">DOCTYPE<\/span> html>\r\n&lt;<span style=\"color:#bf4f24\">html<\/span> <span style=\"color:#bf4f24\">lang<\/span>=<span style=\"color:#0b6125\">\"en\"<\/span>>\r\n&lt;<span style=\"color:#bf4f24\">head<\/span>>\r\n&lt;<span style=\"color:#bf4f24\">script<\/span> <span style=\"color:#bf4f24\">type<\/span>=<span style=\"color:#0b6125\">\"text\/javascript\"<\/span> <span style=\"color:#bf4f24\">src<\/span>=<span style=\"color:#0b6125\">\"https:\/\/www.gstatic.com\/charts\/loader.js\"<\/span>>&lt;\/<span style=\"color:#bf4f24\">script<\/span>>\r\n&lt;<span style=\"color:#bf4f24\">script<\/span> <span style=\"color:#bf4f24\">type<\/span>=<span style=\"color:#0b6125\">\"text\/javascript\"<\/span>>\r\ngoogle.charts<span style=\"color:#693a17\">.load<\/span>(<span style=\"color:#0b6125\">'current'<\/span>, {<span style=\"color:#0b6125\">'packages'<\/span>:[<span style=\"color:#0b6125\">'corechart'<\/span>]});\r\ngoogle.charts.setOnLoadCallback(drawChart);\r\n\r\n<span style=\"color:#a71d5d;font-style:italic\">function<\/span> <span style=\"color:#bf4f24\">drawChart<\/span>() {\r\n\r\n    <span style=\"color:#a71d5d;font-style:italic\">var<\/span> data <span style=\"color:#794938\">=<\/span> google.visualization.arrayToDataTable([\r\n      [<span style=\"color:#0b6125\">'Language'<\/span>, <span style=\"color:#0b6125\">'Rating'<\/span>],\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"color: #0000BB\">&lt;?php<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #007700\">if(<\/span><span style=\"color: #0000BB\">$result<\/span><span style=\"color: #007700\">-&gt;<\/span><span style=\"color: #0000BB\">num_rows&nbsp;<\/span><span style=\"color: #007700\">&gt;&nbsp;<\/span><span style=\"color: #0000BB\">0<\/span><span style=\"color: #007700\">){<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;while(<\/span><span style=\"color: #0000BB\">$row&nbsp;<\/span><span style=\"color: #007700\">=&nbsp;<\/span><span style=\"color: #0000BB\">$result<\/span><span style=\"color: #007700\">-&gt;<\/span><span style=\"color: #0000BB\">fetch_assoc<\/span><span style=\"color: #007700\">()){<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo&nbsp;<\/span><span style=\"color: #DD0000\">\"['\"<\/span><span style=\"color: #007700\">.<\/span><span style=\"color: #0000BB\">$row<\/span><span style=\"color: #007700\">[<\/span><span style=\"color: #DD0000\">'name'<\/span><span style=\"color: #007700\">].<\/span><span style=\"color: #DD0000\">\"',&nbsp;\"<\/span><span style=\"color: #007700\">.<\/span><span style=\"color: #0000BB\">$row<\/span><span style=\"color: #007700\">[<\/span><span style=\"color: #DD0000\">'rating'<\/span><span style=\"color: #007700\">].<\/span><span style=\"color: #DD0000\">\"],\"<\/span><span style=\"color: #007700\">;<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #0000BB\">?&gt;<\/span>\r\n    ]);\r\n    \r\n    <span style=\"color:#a71d5d;font-style:italic\">var<\/span> options <span style=\"color:#794938\">=<\/span> {\r\n        title: <span style=\"color:#0b6125\">'Most Popular Programming Languages'<\/span>,\r\n        width: <span style=\"color:#811f24;font-weight:700\">900<\/span>,\r\n        height: <span style=\"color:#811f24;font-weight:700\">500<\/span>,\r\n    };\r\n    \r\n    <span style=\"color:#a71d5d;font-style:italic\">var<\/span> chart <span style=\"color:#794938\">=<\/span> <span style=\"color:#794938\">new<\/span> <span style=\"color:#bf4f24\">google.visualization<\/span>.PieChart(<span style=\"color:#691c97\">document<\/span>.<span style=\"color:#693a17\">getElementById<\/span>(<span style=\"color:#0b6125\">'piechart'<\/span>));\r\n    \r\n    chart.draw(data, options);\r\n}\r\n&lt;\/<span style=\"color:#bf4f24\">script<\/span>>\r\n&lt;\/<span style=\"color:#bf4f24\">head<\/span>>\r\n&lt;<span style=\"color:#bf4f24\">body<\/span>>\r\n    <span style=\"color:#5a525f;font-style:italic\">&lt;!-- Display the pie chart --><\/span>\r\n    &lt;<span style=\"color:#bf4f24\">div<\/span> <span style=\"color:#bf4f24\">id<\/span><span style=\"color:#794938\">=<\/span><span style=\"color:#0b6125\">\"piechart\"<\/span>>&lt;\/<span style=\"color:#bf4f24\">div<\/span>>\r\n&lt;\/<span style=\"color:#bf4f24\">body<\/span>>\r\n&lt;\/<span style=\"color:#bf4f24\">html<\/span>>\r\n<\/pre>\n<p>You can make various types of pie charts with Google Charts API. Some popular types of the pie chart are given below.<\/p>\n<h2>Making a Dynamic 3D Pie Chart<\/h2>\n<p>Set <code>is3D<\/code> option to <code>true<\/code> to make a 3D pie chart.<\/p>\n<pre>&lt;<span style=\"color:#bf4f24\">script<\/span> <span style=\"color:#bf4f24\">type<\/span>=<span style=\"color:#0b6125\">\"text\/javascript\"<\/span>>\r\ngoogle.charts<span style=\"color:#693a17\">.load<\/span>(<span style=\"color:#0b6125\">'current'<\/span>, {<span style=\"color:#0b6125\">'packages'<\/span>:[<span style=\"color:#0b6125\">'corechart'<\/span>]});\r\ngoogle.charts.setOnLoadCallback(drawChart);\r\n\r\n<span style=\"color:#a71d5d;font-style:italic\">function<\/span> <span style=\"color:#bf4f24\">drawChart<\/span>() {\r\n\r\n    <span style=\"color:#a71d5d;font-style:italic\">var<\/span> data <span style=\"color:#794938\">=<\/span> google.visualization.arrayToDataTable([\r\n      [<span style=\"color:#0b6125\">'Language'<\/span>, <span style=\"color:#0b6125\">'Rating'<\/span>],\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"color: #0000BB\">&lt;?php<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #007700\">if(<\/span><span style=\"color: #0000BB\">$result<\/span><span style=\"color: #007700\">-&gt;<\/span><span style=\"color: #0000BB\">num_rows&nbsp;<\/span><span style=\"color: #007700\">&gt;&nbsp;<\/span><span style=\"color: #0000BB\">0<\/span><span style=\"color: #007700\">){<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;while(<\/span><span style=\"color: #0000BB\">$row&nbsp;<\/span><span style=\"color: #007700\">=&nbsp;<\/span><span style=\"color: #0000BB\">$result<\/span><span style=\"color: #007700\">-&gt;<\/span><span style=\"color: #0000BB\">fetch_assoc<\/span><span style=\"color: #007700\">()){<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo&nbsp;<\/span><span style=\"color: #DD0000\">\"['\"<\/span><span style=\"color: #007700\">.<\/span><span style=\"color: #0000BB\">$row<\/span><span style=\"color: #007700\">[<\/span><span style=\"color: #DD0000\">'name'<\/span><span style=\"color: #007700\">].<\/span><span style=\"color: #DD0000\">\"',&nbsp;\"<\/span><span style=\"color: #007700\">.<\/span><span style=\"color: #0000BB\">$row<\/span><span style=\"color: #007700\">[<\/span><span style=\"color: #DD0000\">'rating'<\/span><span style=\"color: #007700\">].<\/span><span style=\"color: #DD0000\">\"],\"<\/span><span style=\"color: #007700\">;<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #0000BB\">?&gt;<\/span>\r\n    ]);\r\n    \r\n    <span style=\"color:#a71d5d;font-style:italic\">var<\/span> options <span style=\"color:#794938\">=<\/span> {\r\n        title: <span style=\"color:#0b6125\">'Most Popular Programming Languages'<\/span>,\r\n        width: <span style=\"color:#811f24;font-weight:700\">900<\/span>,\r\n        height: <span style=\"color:#811f24;font-weight:700\">500<\/span>,\r\n        is3D: <span style=\"color:#811f24;font-weight:700\">true<\/span>,\r\n    };\r\n    \r\n    <span style=\"color:#a71d5d;font-style:italic\">var<\/span> chart <span style=\"color:#794938\">=<\/span> <span style=\"color:#794938\">new<\/span> <span style=\"color:#bf4f24\">google.visualization<\/span>.PieChart(<span style=\"color:#691c97\">document<\/span>.<span style=\"color:#693a17\">getElementById<\/span>(<span style=\"color:#0b6125\">'piechart'<\/span>));\r\n    \r\n    chart.draw(data, options);\r\n}\r\n&lt;\/<span style=\"color:#bf4f24\">script<\/span>>\r\n<\/pre>\n<h2>Making a Dynamic Donut Pie Chart<\/h2>\n<p>Donut Chart is same like the normal pie chart with a hole in the center. Set <code>pieHole<\/code> option to make a Donut Pie Chart.<\/p>\n<pre>&lt;<span style=\"color:#bf4f24\">script<\/span> <span style=\"color:#bf4f24\">type<\/span>=<span style=\"color:#0b6125\">\"text\/javascript\"<\/span>>\r\ngoogle.charts<span style=\"color:#693a17\">.load<\/span>(<span style=\"color:#0b6125\">'current'<\/span>, {<span style=\"color:#0b6125\">'packages'<\/span>:[<span style=\"color:#0b6125\">'corechart'<\/span>]});\r\ngoogle.charts.setOnLoadCallback(drawChart);\r\n\r\n<span style=\"color:#a71d5d;font-style:italic\">function<\/span> <span style=\"color:#bf4f24\">drawChart<\/span>() {\r\n\r\n    <span style=\"color:#a71d5d;font-style:italic\">var<\/span> data <span style=\"color:#794938\">=<\/span> google.visualization.arrayToDataTable([\r\n      [<span style=\"color:#0b6125\">'Language'<\/span>, <span style=\"color:#0b6125\">'Rating'<\/span>],\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"color: #0000BB\">&lt;?php<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #007700\">if(<\/span><span style=\"color: #0000BB\">$result<\/span><span style=\"color: #007700\">-&gt;<\/span><span style=\"color: #0000BB\">num_rows&nbsp;<\/span><span style=\"color: #007700\">&gt;&nbsp;<\/span><span style=\"color: #0000BB\">0<\/span><span style=\"color: #007700\">){<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;while(<\/span><span style=\"color: #0000BB\">$row&nbsp;<\/span><span style=\"color: #007700\">=&nbsp;<\/span><span style=\"color: #0000BB\">$result<\/span><span style=\"color: #007700\">-&gt;<\/span><span style=\"color: #0000BB\">fetch_assoc<\/span><span style=\"color: #007700\">()){<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo&nbsp;<\/span><span style=\"color: #DD0000\">\"['\"<\/span><span style=\"color: #007700\">.<\/span><span style=\"color: #0000BB\">$row<\/span><span style=\"color: #007700\">[<\/span><span style=\"color: #DD0000\">'name'<\/span><span style=\"color: #007700\">].<\/span><span style=\"color: #DD0000\">\"',&nbsp;\"<\/span><span style=\"color: #007700\">.<\/span><span style=\"color: #0000BB\">$row<\/span><span style=\"color: #007700\">[<\/span><span style=\"color: #DD0000\">'rating'<\/span><span style=\"color: #007700\">].<\/span><span style=\"color: #DD0000\">\"],\"<\/span><span style=\"color: #007700\">;<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #0000BB\">?&gt;<\/span>\r\n    ]);\r\n    \r\n    <span style=\"color:#a71d5d;font-style:italic\">var<\/span> options <span style=\"color:#794938\">=<\/span> {\r\n        title: <span style=\"color:#0b6125\">'Most Popular Programming Languages'<\/span>,\r\n        width: <span style=\"color:#811f24;font-weight:700\">900<\/span>,\r\n        height: <span style=\"color:#811f24;font-weight:700\">500<\/span>,\r\n        pieHole: <span style=\"color:#811f24;font-weight:700\">0.5<\/span>,\r\n    };\r\n    \r\n    <span style=\"color:#a71d5d;font-style:italic\">var<\/span> chart <span style=\"color:#794938\">=<\/span> <span style=\"color:#794938\">new<\/span> <span style=\"color:#bf4f24\">google.visualization<\/span>.PieChart(<span style=\"color:#691c97\">document<\/span>.<span style=\"color:#693a17\">getElementById<\/span>(<span style=\"color:#0b6125\">'piechart'<\/span>));\r\n    \r\n    chart.draw(data, options);\r\n}\r\n&lt;\/<span style=\"color:#bf4f24\">script<\/span>>\r\n<\/pre>\n<h2>Making a Dynamic Slice Exploding Pie Chart<\/h2>\n<p>To separate slices from the rest of the pie chart, use offset property of the <code>slices<\/code> option.<\/p>\n<pre>&lt;<span style=\"color:#bf4f24\">script<\/span> <span style=\"color:#bf4f24\">type<\/span>=<span style=\"color:#0b6125\">\"text\/javascript\"<\/span>>\r\ngoogle.charts<span style=\"color:#693a17\">.load<\/span>(<span style=\"color:#0b6125\">'current'<\/span>, {<span style=\"color:#0b6125\">'packages'<\/span>:[<span style=\"color:#0b6125\">'corechart'<\/span>]});\r\ngoogle.charts.setOnLoadCallback(drawChart);\r\n\r\n<span style=\"color:#a71d5d;font-style:italic\">function<\/span> <span style=\"color:#bf4f24\">drawChart<\/span>() {\r\n\r\n    <span style=\"color:#a71d5d;font-style:italic\">var<\/span> data <span style=\"color:#794938\">=<\/span> google.visualization.arrayToDataTable([\r\n      [<span style=\"color:#0b6125\">'Language'<\/span>, <span style=\"color:#0b6125\">'Rating'<\/span>],\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"color: #0000BB\">&lt;?php<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #007700\">if(<\/span><span style=\"color: #0000BB\">$result<\/span><span style=\"color: #007700\">-&gt;<\/span><span style=\"color: #0000BB\">num_rows&nbsp;<\/span><span style=\"color: #007700\">&gt;&nbsp;<\/span><span style=\"color: #0000BB\">0<\/span><span style=\"color: #007700\">){<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;while(<\/span><span style=\"color: #0000BB\">$row&nbsp;<\/span><span style=\"color: #007700\">=&nbsp;<\/span><span style=\"color: #0000BB\">$result<\/span><span style=\"color: #007700\">-&gt;<\/span><span style=\"color: #0000BB\">fetch_assoc<\/span><span style=\"color: #007700\">()){<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo&nbsp;<\/span><span style=\"color: #DD0000\">\"['\"<\/span><span style=\"color: #007700\">.<\/span><span style=\"color: #0000BB\">$row<\/span><span style=\"color: #007700\">[<\/span><span style=\"color: #DD0000\">'name'<\/span><span style=\"color: #007700\">].<\/span><span style=\"color: #DD0000\">\"',&nbsp;\"<\/span><span style=\"color: #007700\">.<\/span><span style=\"color: #0000BB\">$row<\/span><span style=\"color: #007700\">[<\/span><span style=\"color: #DD0000\">'rating'<\/span><span style=\"color: #007700\">].<\/span><span style=\"color: #DD0000\">\"],\"<\/span><span style=\"color: #007700\">;<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #0000BB\">?&gt;<\/span>\r\n    ]);\r\n    \r\n    <span style=\"color:#a71d5d;font-style:italic\">var<\/span> options <span style=\"color:#794938\">=<\/span> {\r\n        title: <span style=\"color:#0b6125\">'Most Popular Programming Languages'<\/span>,\r\n        width: <span style=\"color:#811f24;font-weight:700\">900<\/span>,\r\n        height: <span style=\"color:#811f24;font-weight:700\">500<\/span>,\r\n        pieSliceText: <span style=\"color:#0b6125\">'label'<\/span>,\r\n        slices: {\r\n            <span style=\"color:#811f24;font-weight:700\">0<\/span>: {offset: <span style=\"color:#811f24;font-weight:700\">0.5<\/span>},\r\n            <span style=\"color:#811f24;font-weight:700\">6<\/span>: {offset: <span style=\"color:#811f24;font-weight:700\">0.4<\/span>},\r\n            <span style=\"color:#811f24;font-weight:700\">8<\/span>: {offset: <span style=\"color:#811f24;font-weight:700\">0.3<\/span>}\r\n        },\r\n    };\r\n    \r\n    <span style=\"color:#a71d5d;font-style:italic\">var<\/span> chart <span style=\"color:#794938\">=<\/span> <span style=\"color:#794938\">new<\/span> <span style=\"color:#bf4f24\">google.visualization<\/span>.PieChart(<span style=\"color:#691c97\">document<\/span>.<span style=\"color:#693a17\">getElementById<\/span>(<span style=\"color:#0b6125\">'piechart'<\/span>));\r\n    \r\n    chart.draw(data, options);\r\n}\r\n&lt;\/<span style=\"color:#bf4f24\">script<\/span>>\r\n<\/pre>\n<h2>Conclusion<\/h2>\n<p>In this dynamic pie chart tutorial, we&#8217;ve shown the most used types of the pie charts. However, Google Charts provides <a href=\"https:\/\/developers.google.com\/chart\/interactive\/docs\/gallery\/piechart#configuration-options\" target=\"_blank\">various option to configure<\/a> the pie chart. You can use those configuration options based on your requirement.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>A pie chart is a circular graph which is divided into slices to represent numerical proportion. The pie chart mainly used to show comparison and the graphical representation helps understand the comparison easily. The pie <\/p>\n","protected":false},"author":1,"featured_media":2343,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[159],"tags":[13,278,19,14,279],"class_list":["post-2342","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-googleapi","tag-google-api","tag-google-charts","tag-mysql","tag-php","tag-piechart","cat-159-id","has_thumb"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Create Dynamic Pie Chart in PHP with Google Charts - CodexWorld<\/title>\n<meta name=\"description\" content=\"Dynamic Pie Chart in PHP \u2013 Example script to create a dynamic pie chart with Google Charts API. Generate pie chart and show dynamic data from MySQL database in PHP.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.codexworld.com\/create-dynamic-pie-chart-php-mysql-google-charts-api\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Create Dynamic Pie Chart in PHP with Google Charts - CodexWorld\" \/>\n<meta property=\"og:description\" content=\"Dynamic Pie Chart in PHP \u2013 Example script to create a dynamic pie chart with Google Charts API. Generate pie chart and show dynamic data from MySQL database in PHP.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.codexworld.com\/create-dynamic-pie-chart-php-mysql-google-charts-api\/\" \/>\n<meta property=\"og:site_name\" content=\"CodexWorld\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/codexworld\" \/>\n<meta property=\"article:author\" content=\"https:\/\/www.facebook.com\/codexworld\" \/>\n<meta property=\"article:published_time\" content=\"2017-04-24T16:31:59+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.codexworld.com\/wp-content\/uploads\/2017\/04\/dynamic-pie-chart-php-mysql-google-charts-api-codexworld.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1366\" \/>\n\t<meta property=\"og:image:height\" content=\"768\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"CodexWorld\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@codexworldblog\" \/>\n<meta name=\"twitter:site\" content=\"@codexworldweb\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"CodexWorld\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"6 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/create-dynamic-pie-chart-php-mysql-google-charts-api\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/create-dynamic-pie-chart-php-mysql-google-charts-api\\\/\"},\"author\":{\"name\":\"CodexWorld\",\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/#\\\/schema\\\/person\\\/9da51d8fa3cdefeb5ec9c69136d4baf0\"},\"headline\":\"Create Dynamic Pie Chart in PHP with Google Charts\",\"datePublished\":\"2017-04-24T16:31:59+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/create-dynamic-pie-chart-php-mysql-google-charts-api\\\/\"},\"wordCount\":423,\"commentCount\":1,\"publisher\":{\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/create-dynamic-pie-chart-php-mysql-google-charts-api\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.codexworld.com\\\/wp-content\\\/uploads\\\/2017\\\/04\\\/dynamic-pie-chart-php-mysql-google-charts-api-codexworld.png\",\"keywords\":[\"Google API\",\"Google Charts\",\"MySQL\",\"PHP\",\"PieChart\"],\"articleSection\":[\"GoogleAPI\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.codexworld.com\\\/create-dynamic-pie-chart-php-mysql-google-charts-api\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/create-dynamic-pie-chart-php-mysql-google-charts-api\\\/\",\"url\":\"https:\\\/\\\/www.codexworld.com\\\/create-dynamic-pie-chart-php-mysql-google-charts-api\\\/\",\"name\":\"Create Dynamic Pie Chart in PHP with Google Charts - CodexWorld\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/create-dynamic-pie-chart-php-mysql-google-charts-api\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/create-dynamic-pie-chart-php-mysql-google-charts-api\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.codexworld.com\\\/wp-content\\\/uploads\\\/2017\\\/04\\\/dynamic-pie-chart-php-mysql-google-charts-api-codexworld.png\",\"datePublished\":\"2017-04-24T16:31:59+00:00\",\"description\":\"Dynamic Pie Chart in PHP \u2013 Example script to create a dynamic pie chart with Google Charts API. Generate pie chart and show dynamic data from MySQL database in PHP.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/create-dynamic-pie-chart-php-mysql-google-charts-api\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.codexworld.com\\\/create-dynamic-pie-chart-php-mysql-google-charts-api\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/create-dynamic-pie-chart-php-mysql-google-charts-api\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.codexworld.com\\\/wp-content\\\/uploads\\\/2017\\\/04\\\/dynamic-pie-chart-php-mysql-google-charts-api-codexworld.png\",\"contentUrl\":\"https:\\\/\\\/www.codexworld.com\\\/wp-content\\\/uploads\\\/2017\\\/04\\\/dynamic-pie-chart-php-mysql-google-charts-api-codexworld.png\",\"width\":1366,\"height\":768,\"caption\":\"dynamic-pie-chart-php-mysql-google-charts-api-codexworld\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/create-dynamic-pie-chart-php-mysql-google-charts-api\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.codexworld.com\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Create Dynamic Pie Chart in PHP with Google Charts\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/#website\",\"url\":\"https:\\\/\\\/www.codexworld.com\\\/\",\"name\":\"CodexWorld\",\"description\":\"Web &amp; Mobile App Development Company\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.codexworld.com\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/#organization\",\"name\":\"CodexWorld\",\"url\":\"https:\\\/\\\/www.codexworld.com\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.codexworld.com\\\/wp-content\\\/uploads\\\/2014\\\/09\\\/codexworld-logo.png\",\"contentUrl\":\"https:\\\/\\\/www.codexworld.com\\\/wp-content\\\/uploads\\\/2014\\\/09\\\/codexworld-logo.png\",\"width\":200,\"height\":19,\"caption\":\"CodexWorld\"},\"image\":{\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/codexworld\",\"https:\\\/\\\/x.com\\\/codexworldweb\",\"https:\\\/\\\/www.linkedin.com\\\/company\\\/codexworld\",\"https:\\\/\\\/www.youtube.com\\\/codexworld\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/#\\\/schema\\\/person\\\/9da51d8fa3cdefeb5ec9c69136d4baf0\",\"name\":\"CodexWorld\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/cf4999db3b409de559f80677afa01729bb2eeda19be273c254e8b2c22729e386?s=96&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/cf4999db3b409de559f80677afa01729bb2eeda19be273c254e8b2c22729e386?s=96&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/cf4999db3b409de559f80677afa01729bb2eeda19be273c254e8b2c22729e386?s=96&r=g\",\"caption\":\"CodexWorld\"},\"description\":\"CodexWorld is a programming blog, one-stop destination for web professionals \u2014 developers, programmers, freelancers, and site owners.\",\"sameAs\":[\"http:\\\/\\\/www.codexworld.com\",\"https:\\\/\\\/www.facebook.com\\\/codexworld\",\"https:\\\/\\\/x.com\\\/codexworldblog\"],\"url\":\"https:\\\/\\\/www.codexworld.com\\\/author\\\/nitya192265\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Create Dynamic Pie Chart in PHP with Google Charts - CodexWorld","description":"Dynamic Pie Chart in PHP \u2013 Example script to create a dynamic pie chart with Google Charts API. Generate pie chart and show dynamic data from MySQL database in PHP.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.codexworld.com\/create-dynamic-pie-chart-php-mysql-google-charts-api\/","og_locale":"en_US","og_type":"article","og_title":"Create Dynamic Pie Chart in PHP with Google Charts - CodexWorld","og_description":"Dynamic Pie Chart in PHP \u2013 Example script to create a dynamic pie chart with Google Charts API. Generate pie chart and show dynamic data from MySQL database in PHP.","og_url":"https:\/\/www.codexworld.com\/create-dynamic-pie-chart-php-mysql-google-charts-api\/","og_site_name":"CodexWorld","article_publisher":"https:\/\/www.facebook.com\/codexworld","article_author":"https:\/\/www.facebook.com\/codexworld","article_published_time":"2017-04-24T16:31:59+00:00","og_image":[{"width":1366,"height":768,"url":"https:\/\/www.codexworld.com\/wp-content\/uploads\/2017\/04\/dynamic-pie-chart-php-mysql-google-charts-api-codexworld.png","type":"image\/png"}],"author":"CodexWorld","twitter_card":"summary_large_image","twitter_creator":"@codexworldblog","twitter_site":"@codexworldweb","twitter_misc":{"Written by":"CodexWorld","Est. reading time":"6 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.codexworld.com\/create-dynamic-pie-chart-php-mysql-google-charts-api\/#article","isPartOf":{"@id":"https:\/\/www.codexworld.com\/create-dynamic-pie-chart-php-mysql-google-charts-api\/"},"author":{"name":"CodexWorld","@id":"https:\/\/www.codexworld.com\/#\/schema\/person\/9da51d8fa3cdefeb5ec9c69136d4baf0"},"headline":"Create Dynamic Pie Chart in PHP with Google Charts","datePublished":"2017-04-24T16:31:59+00:00","mainEntityOfPage":{"@id":"https:\/\/www.codexworld.com\/create-dynamic-pie-chart-php-mysql-google-charts-api\/"},"wordCount":423,"commentCount":1,"publisher":{"@id":"https:\/\/www.codexworld.com\/#organization"},"image":{"@id":"https:\/\/www.codexworld.com\/create-dynamic-pie-chart-php-mysql-google-charts-api\/#primaryimage"},"thumbnailUrl":"https:\/\/www.codexworld.com\/wp-content\/uploads\/2017\/04\/dynamic-pie-chart-php-mysql-google-charts-api-codexworld.png","keywords":["Google API","Google Charts","MySQL","PHP","PieChart"],"articleSection":["GoogleAPI"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.codexworld.com\/create-dynamic-pie-chart-php-mysql-google-charts-api\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.codexworld.com\/create-dynamic-pie-chart-php-mysql-google-charts-api\/","url":"https:\/\/www.codexworld.com\/create-dynamic-pie-chart-php-mysql-google-charts-api\/","name":"Create Dynamic Pie Chart in PHP with Google Charts - CodexWorld","isPartOf":{"@id":"https:\/\/www.codexworld.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.codexworld.com\/create-dynamic-pie-chart-php-mysql-google-charts-api\/#primaryimage"},"image":{"@id":"https:\/\/www.codexworld.com\/create-dynamic-pie-chart-php-mysql-google-charts-api\/#primaryimage"},"thumbnailUrl":"https:\/\/www.codexworld.com\/wp-content\/uploads\/2017\/04\/dynamic-pie-chart-php-mysql-google-charts-api-codexworld.png","datePublished":"2017-04-24T16:31:59+00:00","description":"Dynamic Pie Chart in PHP \u2013 Example script to create a dynamic pie chart with Google Charts API. Generate pie chart and show dynamic data from MySQL database in PHP.","breadcrumb":{"@id":"https:\/\/www.codexworld.com\/create-dynamic-pie-chart-php-mysql-google-charts-api\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.codexworld.com\/create-dynamic-pie-chart-php-mysql-google-charts-api\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.codexworld.com\/create-dynamic-pie-chart-php-mysql-google-charts-api\/#primaryimage","url":"https:\/\/www.codexworld.com\/wp-content\/uploads\/2017\/04\/dynamic-pie-chart-php-mysql-google-charts-api-codexworld.png","contentUrl":"https:\/\/www.codexworld.com\/wp-content\/uploads\/2017\/04\/dynamic-pie-chart-php-mysql-google-charts-api-codexworld.png","width":1366,"height":768,"caption":"dynamic-pie-chart-php-mysql-google-charts-api-codexworld"},{"@type":"BreadcrumbList","@id":"https:\/\/www.codexworld.com\/create-dynamic-pie-chart-php-mysql-google-charts-api\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.codexworld.com\/"},{"@type":"ListItem","position":2,"name":"Create Dynamic Pie Chart in PHP with Google Charts"}]},{"@type":"WebSite","@id":"https:\/\/www.codexworld.com\/#website","url":"https:\/\/www.codexworld.com\/","name":"CodexWorld","description":"Web &amp; Mobile App Development Company","publisher":{"@id":"https:\/\/www.codexworld.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.codexworld.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.codexworld.com\/#organization","name":"CodexWorld","url":"https:\/\/www.codexworld.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.codexworld.com\/#\/schema\/logo\/image\/","url":"https:\/\/www.codexworld.com\/wp-content\/uploads\/2014\/09\/codexworld-logo.png","contentUrl":"https:\/\/www.codexworld.com\/wp-content\/uploads\/2014\/09\/codexworld-logo.png","width":200,"height":19,"caption":"CodexWorld"},"image":{"@id":"https:\/\/www.codexworld.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/codexworld","https:\/\/x.com\/codexworldweb","https:\/\/www.linkedin.com\/company\/codexworld","https:\/\/www.youtube.com\/codexworld"]},{"@type":"Person","@id":"https:\/\/www.codexworld.com\/#\/schema\/person\/9da51d8fa3cdefeb5ec9c69136d4baf0","name":"CodexWorld","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/cf4999db3b409de559f80677afa01729bb2eeda19be273c254e8b2c22729e386?s=96&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/cf4999db3b409de559f80677afa01729bb2eeda19be273c254e8b2c22729e386?s=96&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/cf4999db3b409de559f80677afa01729bb2eeda19be273c254e8b2c22729e386?s=96&r=g","caption":"CodexWorld"},"description":"CodexWorld is a programming blog, one-stop destination for web professionals \u2014 developers, programmers, freelancers, and site owners.","sameAs":["http:\/\/www.codexworld.com","https:\/\/www.facebook.com\/codexworld","https:\/\/x.com\/codexworldblog"],"url":"https:\/\/www.codexworld.com\/author\/nitya192265\/"}]}},"jetpack_publicize_connections":[],"jetpack_featured_media_url":"https:\/\/www.codexworld.com\/wp-content\/uploads\/2017\/04\/dynamic-pie-chart-php-mysql-google-charts-api-codexworld.png","jetpack_shortlink":"https:\/\/wp.me\/p6bxIh-BM","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.codexworld.com\/wp-json\/wp\/v2\/posts\/2342","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.codexworld.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.codexworld.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.codexworld.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.codexworld.com\/wp-json\/wp\/v2\/comments?post=2342"}],"version-history":[{"count":1,"href":"https:\/\/www.codexworld.com\/wp-json\/wp\/v2\/posts\/2342\/revisions"}],"predecessor-version":[{"id":2344,"href":"https:\/\/www.codexworld.com\/wp-json\/wp\/v2\/posts\/2342\/revisions\/2344"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.codexworld.com\/wp-json\/wp\/v2\/media\/2343"}],"wp:attachment":[{"href":"https:\/\/www.codexworld.com\/wp-json\/wp\/v2\/media?parent=2342"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.codexworld.com\/wp-json\/wp\/v2\/categories?post=2342"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.codexworld.com\/wp-json\/wp\/v2\/tags?post=2342"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}