{"id":1851,"date":"2022-02-16T04:38:25","date_gmt":"2022-02-16T04:38:25","guid":{"rendered":"https:\/\/swatilathia.com\/?p=1851"},"modified":"2022-03-09T05:29:08","modified_gmt":"2022-03-09T05:29:08","slug":"how-to-make-a-perfect-pie-chart-using-css-gradients","status":"publish","type":"post","link":"https:\/\/swatilathia.com\/?p=1851","title":{"rendered":"How to make a perfect Pie chart using CSS Gradients"},"content":{"rendered":"<body>\n<p class=\"wp-block-paragraph\"><span style=\"background-color: rgba(22, 24, 26, 0.2);\"><b>Y<\/b><\/span>ou<strong> <\/strong>just<strong> <\/strong>need<strong> <\/strong>to<strong> <\/strong>provide border-radius 50% to remove a corner of a given area\/square\/rectangle. If you want to start your color at a specified angle, then you must provide the color name with starting angle &amp; the same color name with the ending angle. Ending angle of last color need not to be provided. It automatically ends &amp; fills the color.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;html&gt;\n&lt;head&gt;\n&lt;style&gt;\n#d1{\n  height: 200px;\n  width: 200px;\n  background-image: conic-gradient(Pink,pink ,purple,purple,green,green,blue);\n  border-radius:50%;\n}\n#d2{\n  height: 200px;\n  width: 200px;\n  background-image: conic-gradient(Pink 0deg,pink 90deg,purple 90deg,purple 180deg,green 180deg,green 270deg,blue 270deg);\n  border-radius:50%;\n}\n&lt;\/style&gt;\n&lt;\/head&gt;\n&lt;body&gt;\n      &lt;h1&gt;Pie Chart using Conic Gradient&lt;\/h1&gt;\n      &lt;div id=\"d1\"&gt;&lt;\/div&gt;&lt;br&gt;&lt;br&gt;\n      &lt;div id=\"d2\"&gt;&lt;\/div&gt;&lt;br&gt;&lt;br&gt;\n&lt;\/body&gt;\n&lt;\/html&gt;<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Look at the output of above code<\/p>\n\n\n\n\n\n<style>\n#d1{\n  height: 200px;\n  width: 200px;\n  background-image: conic-gradient(Pink,pink ,purple,purple,green,green,blue);\n  border-radius:50%;\n}\n#d2{\n  height: 200px;\n  width: 200px;\n  background-image: conic-gradient(Pink 0deg,pink 90deg,purple 90deg,purple 180deg,green 180deg,green 270deg,blue 270deg);\n  border-radius:50%;\n}\n<\/style>\n\n\n      <h1>Pie Chart using Conic Gradient<\/h1>\n      <div id=\"d1\"><\/div><br><br>\n      <div id=\"d2\"><\/div><br><br>\n\n\n<\/body>","protected":false},"excerpt":{"rendered":"<p>You just need to provide border-radius 50% to remove a corner of a given area\/square\/rectangle. If you want to start your color at a specified angle, then you must provide the color name with starting angle &amp; the same color name with the ending angle. Ending angle of last color need not to be provided. [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"zakra_page_container_layout":"customizer","zakra_page_sidebar_layout":"customizer","zakra_remove_content_margin":false,"zakra_sidebar":"customizer","zakra_transparent_header":"customizer","zakra_logo":0,"zakra_main_header_style":"default","zakra_menu_item_color":"","zakra_menu_item_hover_color":"","zakra_menu_item_active_color":"","zakra_menu_active_style":"","zakra_page_header":true,"om_disable_all_campaigns":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[20,32],"tags":[50,38,49],"class_list":["post-1851","post","type-post","status-publish","format-standard","hentry","category-css","category-css-tutorial","tag-css3-gradient-property","tag-how-to-make-pie-chart-in-css","tag-pie-charts"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/swatilathia.com\/index.php?rest_route=\/wp\/v2\/posts\/1851","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/swatilathia.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/swatilathia.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/swatilathia.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/swatilathia.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1851"}],"version-history":[{"count":5,"href":"https:\/\/swatilathia.com\/index.php?rest_route=\/wp\/v2\/posts\/1851\/revisions"}],"predecessor-version":[{"id":1916,"href":"https:\/\/swatilathia.com\/index.php?rest_route=\/wp\/v2\/posts\/1851\/revisions\/1916"}],"wp:attachment":[{"href":"https:\/\/swatilathia.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1851"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/swatilathia.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1851"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/swatilathia.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1851"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}