{"id":992,"date":"2012-06-21T13:09:33","date_gmt":"2012-06-21T11:09:33","guid":{"rendered":"http:\/\/hen.co.za\/blog\/?p=992"},"modified":"2012-06-21T13:09:33","modified_gmt":"2012-06-21T11:09:33","slug":"java-pie","status":"publish","type":"post","link":"https:\/\/hen.co.za\/blog\/2012\/06\/java-pie\/","title":{"rendered":"Java pie"},"content":{"rendered":"<p>A useful JavaScript library I came across recently is the one created by\u00a0<a title=\"Balamurugan\" href=\"http:\/\/www.sbmkpm.com\" target=\"_blank\">Balamurugan<\/a> that is based on the\u00a0wz_jsgraphics library from\u00a0<a title=\"walterzorn\" href=\"http:\/\/www.walterzorn.com\" target=\"_blank\">walterzorn<\/a>.<\/p>\n<p>I made some modifications to the Pie library so more &#8216;properties&#8217; can be specified by the calling script\/code which makes it easier to use.<\/p>\n<p>An example:<\/p>\n<p><a href=\"https:\/\/hen.co.za\/blog\/wp-content\/uploads\/2012\/06\/JavaPie.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-994\" title=\"JavaPie\" src=\"https:\/\/hen.co.za\/blog\/wp-content\/uploads\/2012\/06\/JavaPie.png\" alt=\"JavaScript Pie graph\" width=\"457\" height=\"345\" srcset=\"https:\/\/hen.co.za\/blog\/wp-content\/uploads\/2012\/06\/JavaPie.png 457w, https:\/\/hen.co.za\/blog\/wp-content\/uploads\/2012\/06\/JavaPie-300x226.png 300w\" sizes=\"auto, (max-width: 457px) 100vw, 457px\" \/><\/a><\/p>\n<pre class=\"brush: xml; title: ; notranslate\" title=\"\">\r\n&lt;script type=&quot;text\/javascript&quot; src=&quot;wz_jsgraphics.js&quot;&gt;&lt;\/script&gt;\r\n&lt;script type=&quot;text\/javascript&quot; src=&quot;pie.js&quot;&gt;&lt;\/script&gt;\r\n&lt;div id=&quot;pieCanvas&quot; style=&quot;overflow: auto; position:relative;height:300px;width:400px;&quot;&gt;&lt;\/div&gt;\r\n&lt;script type=&quot;text\/javascript&quot;&gt;\r\n<\/pre>\n<p>&nbsp;<\/p>\n<pre class=\"brush: jscript; title: ; notranslate\" title=\"\">\r\nvar p = new pie();\r\np.radius = 100;\r\np.labelDistance = 120;\r\np.xCenter = 200;\r\np.yCenter = 150;\r\np.add(&quot;Jan&quot;,49);\r\np.add(&quot;Feb&quot;,51);\r\np.add(&quot;Mar&quot;, 87);\r\np.add(&quot;Apr&quot;,120);\r\np.add(&quot;May&quot;,56);\r\np.add(&quot;Jun&quot;,41);\r\np.add(&quot;Jul&quot;,31);\r\np.add(&quot;Aug&quot;,65);\r\np.fontName = &quot;Tahoma&quot;;\r\np.labelFontSize = 14;\r\np.render(&quot;pieCanvas&quot;, &quot;This is a test&quot;);\r\n<\/pre>\n<p>With this you will get a plain (but nice) pie graph that can use customize a bit if you like.<\/p>\n<p>Here is a link to my modified version: <a href=\"https:\/\/hen.co.za\/blog\/wp-content\/uploads\/2012\/06\/JavaScriptPie.zip\">JavaScriptPie<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>A useful JavaScript library I came across recently is the one created by\u00a0Balamurugan that is based on the\u00a0wz_jsgraphics library from\u00a0walterzorn. I made some modifications to the Pie library so more &#8216;properties&#8217; can be specified by the calling script\/code which makes &hellip;<\/p>\n<p class=\"read-more\"><a href=\"https:\/\/hen.co.za\/blog\/2012\/06\/java-pie\/\">Read more &raquo;<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3,16],"tags":[214,201,215,213,216],"class_list":["post-992","post","type-post","status-publish","format-standard","hentry","category-development","category-reference","tag-graph","tag-javascript","tag-pie","tag-pie-graph","tag-script"],"_links":{"self":[{"href":"https:\/\/hen.co.za\/blog\/wp-json\/wp\/v2\/posts\/992","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/hen.co.za\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/hen.co.za\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/hen.co.za\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/hen.co.za\/blog\/wp-json\/wp\/v2\/comments?post=992"}],"version-history":[{"count":2,"href":"https:\/\/hen.co.za\/blog\/wp-json\/wp\/v2\/posts\/992\/revisions"}],"predecessor-version":[{"id":996,"href":"https:\/\/hen.co.za\/blog\/wp-json\/wp\/v2\/posts\/992\/revisions\/996"}],"wp:attachment":[{"href":"https:\/\/hen.co.za\/blog\/wp-json\/wp\/v2\/media?parent=992"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/hen.co.za\/blog\/wp-json\/wp\/v2\/categories?post=992"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/hen.co.za\/blog\/wp-json\/wp\/v2\/tags?post=992"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}