{"id":84,"date":"2016-07-01T20:07:52","date_gmt":"2016-07-01T20:07:52","guid":{"rendered":"http:\/\/liberty.fdn.fr\/?page_id=84"},"modified":"2016-07-17T13:47:13","modified_gmt":"2016-07-17T13:47:13","slug":"sgngd","status":"publish","type":"page","link":"http:\/\/renaudguezennec.eu\/index.php\/projects\/sgngd\/","title":{"rendered":"SGNGD : SvgGd is Not GD"},"content":{"rendered":"<h2>SVG Charts for PHP<\/h2>\n<h3>Description:<\/h3>\n<p>SGNGD is a PHP library to help you for generating SVG charts.<br \/>\nBased-on SVG technology, charts are more efficient. With few code lines, you can create many relevant charts such as:<\/p>\n<ul>\n<li>Pie Chart<\/li>\n<li>Bar Chart<\/li>\n<li>Horizontal Bar chart<\/li>\n<li>Kiviat Chart<\/li>\n<li>Point Cloud Chart<\/li>\n<li>Mathematical function plotter<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<h3>\u00a0 Example of use:<code><\/code><\/h3>\n<p><code>\/**!<br \/>\n*<br \/>\n* Copyright 2008 Renaud Guezennec<br \/>\n*<br \/>\n* This file is part of SGNGD.<br \/>\n*<br \/>\n* SGNGD is free software: you can redistribute it and\/or modify<br \/>\n* it under the terms of the GNU General Public License as published by<br \/>\n* the Free Software Foundation, either version 3 of the License, or<br \/>\n* (at your option) any later version.<br \/>\n*<br \/>\n* SDNGD distributed in the hope that it will be useful,<br \/>\n* but WITHOUT ANY WARRANTY; without even the implied warranty of<br \/>\n* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the<br \/>\n* GNU General Public License for more details.<br \/>\n*<br \/>\n* You should have received a copy of the GNU General Public License<br \/>\n* along with SGNGD. If not, see &lt;http:\/\/www.gnu.org\/licenses\/&gt;.<br \/>\n*<br \/>\n*\/<\/code><\/p>\n<p><code><br \/>\n\/**<br \/>\n* \\author:Renaud Guezennec<br \/>\n*<br \/>\n*<br \/>\n* \\brief Example of KiviatChart use.<br \/>\n* \\version 0.1<br \/>\n* \\date 28\/03\/2009<br \/>\n*\/<br \/>\nrequire_once('Chart.php');<br \/>\n$chartsvg = new KiviatChart(\"kiviatChart SVG\",FULLDEFINED);<br \/>\n\/*$chartsvg-&gt;setStartColor(new Color(0,150,0));<br \/>\n$chartsvg-&gt;setEndColor(new Color(255,150,0));*\/<br \/>\n$data[]=array('Life'=&gt;3,'intellect'=&gt;8,'Magic'=&gt;9,'Speed'=&gt;10,'Defense'=&gt;4,'Endurance'=&gt;4);<br \/>\n$data[]=array('Life'=&gt;6,'intellect'=&gt;6,'Magic'=&gt;6,'Speed'=&gt;8,'Defense'=&gt;1,'Endurance'=&gt;4);<br \/>\n$data[]=array('Life'=&gt;9,'intellect'=&gt;2,'Magic'=&gt;2,'Speed'=&gt;6,'Defense'=&gt;7,'Endurance'=&gt;4);<br \/>\n$chartsvg-&gt;AddData('Elf',$data[0],new Color(255,0,0));<br \/>\n$chartsvg-&gt;AddData('Golem',$data[1],new Color(0,255,0));<br \/>\n$chartsvg-&gt;AddData('Dwarf',$data[2],new Color(0,0,255));<br \/>\n$chartsvg-&gt;SetScale(5);<br \/>\n$chartsvg-&gt;Compute();<br \/>\nheader('Content-Type: image\/svg+xml');<br \/>\necho $chartsvg-&gt;display();<br \/>\n?&gt;<br \/>\n<\/code><\/p>\n<h3><strong>Installation<\/strong>:<\/h3>\n<p>Extract the archive in a directory of your web site.<\/p>\n<h3><strong>How to use<\/strong>: (Quick Start)<\/h3>\n<p>-Open a new php file.<br \/>\n-Include SGNGD: require_once( path_to_SGNGD\/Chart.php );<br \/>\n-Make a new instance of which chart you want:PieChart or BarChart (others are coming soon). $class = new BarChart();<br \/>\n-Add items by calling $class-&gt;AddData( name ,value);<br \/>\n-Call $class-&gt;compute().<br \/>\n-Define the type of page by call header: header(&#8216;Content-Type: image\/svg xml&#8217;);<br \/>\nand display the chart by calling echo $class-&gt;display();<br \/>\nYou can manage colors of your chart, the size and few other things.<br \/>\nFor more details, take a look to the user manual.<\/p>\n<p>&nbsp;<\/p>\n<h2>Download<\/h2>\n<p>:<\/p>\n<p>Manuel: <a href=\"\/wp-content\/uploads\/2016\/07\/SGNGD-usermanual.pdf\" rel=\"\">SGNGD-usermanual.pdf<\/a><br \/>\nSource: <a href=\"\/wp-content\/uploads\/2016\/07\/SGNGD.tar.gz\" rel=\"\">SGNGD.tar.gz<\/a><\nGit: <a href=\"https:\/\/github.com\/obiwankennedy\/SGNGD\"> https:\/\/github.com\/obiwankennedy\/SGNGD<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>SVG Charts for PHP Description: SGNGD is a PHP library to help you for generating SVG charts. Based-on SVG technology, charts are more efficient. With few code lines, you can create many relevant charts such as: Pie Chart Bar Chart Horizontal Bar chart Kiviat Chart Point Cloud Chart Mathematical function plotter &nbsp; &nbsp; \u00a0 Example [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":5,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_import_markdown_pro_load_document_selector":0,"_import_markdown_pro_submit_text_textarea":"","footnotes":""},"class_list":["post-84","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"http:\/\/renaudguezennec.eu\/index.php\/wp-json\/wp\/v2\/pages\/84","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/renaudguezennec.eu\/index.php\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"http:\/\/renaudguezennec.eu\/index.php\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"http:\/\/renaudguezennec.eu\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/renaudguezennec.eu\/index.php\/wp-json\/wp\/v2\/comments?post=84"}],"version-history":[{"count":7,"href":"http:\/\/renaudguezennec.eu\/index.php\/wp-json\/wp\/v2\/pages\/84\/revisions"}],"predecessor-version":[{"id":105,"href":"http:\/\/renaudguezennec.eu\/index.php\/wp-json\/wp\/v2\/pages\/84\/revisions\/105"}],"up":[{"embeddable":true,"href":"http:\/\/renaudguezennec.eu\/index.php\/wp-json\/wp\/v2\/pages\/5"}],"wp:attachment":[{"href":"http:\/\/renaudguezennec.eu\/index.php\/wp-json\/wp\/v2\/media?parent=84"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}