<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://atk-framework.com/index.php?action=history&amp;feed=atom&amp;title=Achievo%2FHowto%2FDevelopers%2FAdd_graphs_to_your_node</id>
	<title>Achievo/Howto/Developers/Add graphs to your node - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://atk-framework.com/index.php?action=history&amp;feed=atom&amp;title=Achievo%2FHowto%2FDevelopers%2FAdd_graphs_to_your_node"/>
	<link rel="alternate" type="text/html" href="https://atk-framework.com/index.php?title=Achievo/Howto/Developers/Add_graphs_to_your_node&amp;action=history"/>
	<updated>2026-09-20T20:42:25Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.45.1</generator>
	<entry>
		<id>https://atk-framework.com/index.php?title=Achievo/Howto/Developers/Add_graphs_to_your_node&amp;diff=17321&amp;oldid=prev</id>
		<title>Sandy at 22:57, 7 November 2008</title>
		<link rel="alternate" type="text/html" href="https://atk-framework.com/index.php?title=Achievo/Howto/Developers/Add_graphs_to_your_node&amp;diff=17321&amp;oldid=prev"/>
		<updated>2008-11-07T22:57:58Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 22:57, 7 November 2008&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l1&quot;&gt;Line 1:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;{{achievo_howto|Easy|[[Sandy Pleyte]] &amp;lt;sandy@achievo.org&amp;gt;}}&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;{{achievo_howto|Easy|[[Sandy Pleyte]] &amp;lt;sandy@achievo.org&amp;gt;}}&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Achievo has a graph module which includes [http://www.aditus.nu/jpgraph/ jpgraph]. To add graphs to &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;you &lt;/del&gt;node you can use the dataGraphAttribute&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Achievo has a graph module which includes [http://www.aditus.nu/jpgraph/ jpgraph]. To add graphs to &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;your &lt;/ins&gt;node you can use the dataGraphAttribute &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;which is located in the graph module.&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Sandy</name></author>
	</entry>
	<entry>
		<id>https://atk-framework.com/index.php?title=Achievo/Howto/Developers/Add_graphs_to_your_node&amp;diff=17291&amp;oldid=prev</id>
		<title>Sandy: New page: {{achievo_howto|Easy|Sandy Pleyte &lt;sandy@achievo.org&gt;}}  Achievo has a graph module which includes [http://www.aditus.nu/jpgraph/ jpgraph]. To add graphs to you node you can use the da...</title>
		<link rel="alternate" type="text/html" href="https://atk-framework.com/index.php?title=Achievo/Howto/Developers/Add_graphs_to_your_node&amp;diff=17291&amp;oldid=prev"/>
		<updated>2008-11-07T21:36:06Z</updated>

		<summary type="html">&lt;p&gt;New page: {{achievo_howto|Easy|&lt;a href=&quot;/Sandy_Pleyte&quot; class=&quot;mw-redirect&quot; title=&quot;Sandy Pleyte&quot;&gt;Sandy Pleyte&lt;/a&gt; &amp;lt;sandy@achievo.org&amp;gt;}}  Achievo has a graph module which includes [http://www.aditus.nu/jpgraph/ jpgraph]. To add graphs to you node you can use the da...&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{achievo_howto|Easy|[[Sandy Pleyte]] &amp;lt;sandy@achievo.org&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
Achievo has a graph module which includes [http://www.aditus.nu/jpgraph/ jpgraph]. To add graphs to you node you can use the dataGraphAttribute&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
dataGraphAttribute($name, $callback, $params=array(), $graphtype=&amp;quot;auto&amp;quot;, $flags=0)&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;name&amp;#039;&amp;#039;&amp;#039; &amp;#039;&amp;#039;String&amp;#039;&amp;#039; &lt;br /&gt;
The name of the graph (must be unique within the node).&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;callback&amp;#039;&amp;#039;&amp;#039; &amp;#039;&amp;#039;String&amp;#039;&amp;#039; &lt;br /&gt;
&lt;br /&gt;
The name of the method to call on the node to  collect the data.&lt;br /&gt;
Example: if you specify &amp;quot;totals&amp;quot; as $callback, the system invokes the method &amp;quot;graph_totals()&amp;quot; in the node.&lt;br /&gt;
Callback prototype:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
function graph_&amp;lt;callbackname&amp;gt;($params)&lt;br /&gt;
{&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The callback must return an array of data in the following format:&lt;br /&gt;
  array(&amp;#039;plotname1&amp;#039;=&amp;gt;array(&amp;#039;x-axis/legend title&amp;#039;=&amp;gt;&lt;br /&gt;
                           &amp;#039;y-axis/pie value&amp;#039;,&lt;br /&gt;
                           ...),&lt;br /&gt;
        &amp;#039;plotname2&amp;#039;=&amp;gt;...);&lt;br /&gt;
&lt;br /&gt;
In other words, it must return one or more plots.&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;callback&amp;#039;&amp;#039;&amp;#039; &amp;#039;&amp;#039;Array&amp;#039;&amp;#039; &lt;br /&gt;
&lt;br /&gt;
Specify an array of parameters to be passed to the callback method. It is possible to specify &amp;#039;templates&amp;#039; as values. For example, specifying array(&amp;quot;selected&amp;quot;=&amp;gt;&amp;quot;[id]&amp;quot; will result in a callback invokation with a parameter &amp;#039;selected&amp;#039; which has the id of the current record as parameter. A special template is [pk], which passes the entire primary key of the current record.&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;graphtype&amp;#039;&amp;#039;&amp;#039; &amp;#039;&amp;#039;String&amp;#039;&amp;#039; &lt;br /&gt;
&lt;br /&gt;
The type of graph to plot. Currently supported are:&lt;br /&gt;
&amp;quot;pie&amp;quot; - Create a pie chart&lt;br /&gt;
&amp;quot;bar&amp;quot; - Create a bar chart&lt;br /&gt;
&amp;quot;line&amp;quot; - Create a line chart&lt;br /&gt;
&amp;quot;auto&amp;quot; - Creates a pie chart if only one plot is passed and a bar chart if more than one are passed&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;graphtype&amp;#039;&amp;#039;&amp;#039; &amp;#039;&amp;#039;Integer&amp;#039;&amp;#039; &lt;br /&gt;
&lt;br /&gt;
Any standard attribute (AF_*) flag can be passed. As of yet, there are no specific flags for this attribute.&lt;br /&gt;
&lt;br /&gt;
== Example node ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
useattrib(&amp;#039;graph.dataGraphAttribute&amp;#039;); &lt;br /&gt;
class graphtest extends atkNode &lt;br /&gt;
{&lt;br /&gt;
  function __construct()&lt;br /&gt;
  {&lt;br /&gt;
    $this-&amp;gt;atkNode(&amp;#039;graphtest&amp;#039;,NF_ADD_LINK);&lt;br /&gt;
    $this-&amp;gt;add(new atkAttribute(&amp;quot;id&amp;quot; ,AF_AUTOKEY));&lt;br /&gt;
    $this-&amp;gt;add(new atkAttribute(&amp;quot;title&amp;quot;));&lt;br /&gt;
    &lt;br /&gt;
    $this-&amp;gt;add(new dataGraphAttribute(&amp;#039;pie_graph&amp;#039;,&amp;#039;pie&amp;#039;,array(&amp;quot;title&amp;quot;=&amp;gt;&amp;quot;[title]&amp;quot;),&amp;#039;pie&amp;#039;));&lt;br /&gt;
    $this-&amp;gt;add(new dataGraphAttribute(&amp;#039;bar_graph&amp;#039;,&amp;#039;bar&amp;#039;,array(&amp;quot;title&amp;quot;=&amp;gt;&amp;quot;[title]&amp;quot;),&amp;#039;bar&amp;#039;));&lt;br /&gt;
    $this-&amp;gt;add(new dataGraphAttribute(&amp;#039;line_graph&amp;#039;,&amp;#039;line&amp;#039;,array(&amp;quot;title&amp;quot;=&amp;gt;&amp;quot;[title]&amp;quot;),&amp;#039;line&amp;#039;));&lt;br /&gt;
    &lt;br /&gt;
    $this-&amp;gt;setTable(&amp;quot;crm_lead&amp;quot;);&lt;br /&gt;
  }&lt;br /&gt;
  &lt;br /&gt;
  function graph_pie($params)&lt;br /&gt;
  {&lt;br /&gt;
    return array(&amp;#039;pie graph&amp;#039;=&amp;gt;array(&lt;br /&gt;
                 &amp;#039;Label 1&amp;#039;=&amp;gt;10,&lt;br /&gt;
                 &amp;#039;Label 2&amp;#039;=&amp;gt;11,&lt;br /&gt;
                 &amp;#039;label 3&amp;#039;=&amp;gt;13));&lt;br /&gt;
  }&lt;br /&gt;
  &lt;br /&gt;
  function graph_bar($params)&lt;br /&gt;
  {&lt;br /&gt;
    return array(&amp;#039;bar graph&amp;#039;=&amp;gt;array(&lt;br /&gt;
                 &amp;#039;1&amp;#039;=&amp;gt;1,&amp;#039;2&amp;#039;=&amp;gt;2,&amp;#039;3&amp;#039;=&amp;gt;1,&amp;#039;4&amp;#039;=&amp;gt;4,&lt;br /&gt;
                 &amp;#039;5&amp;#039;=&amp;gt;7,&amp;#039;6&amp;#039;=&amp;gt;4));&lt;br /&gt;
  } &lt;br /&gt;
&lt;br /&gt;
  function graph_line($params)&lt;br /&gt;
  {&lt;br /&gt;
    return array(&amp;#039;Line 1&amp;#039;=&amp;gt;array(&lt;br /&gt;
                 &amp;#039;1&amp;#039;=&amp;gt;1,&amp;#039;2&amp;#039;=&amp;gt;2,&lt;br /&gt;
                 &amp;#039;3&amp;#039;=&amp;gt;1,&amp;#039;4&amp;#039;=&amp;gt;4,&lt;br /&gt;
                 &amp;#039;5&amp;#039;=&amp;gt;7,&amp;#039;6&amp;#039;=&amp;gt;4),&lt;br /&gt;
                 &amp;#039;Line 2&amp;#039;=&amp;gt;array(&lt;br /&gt;
                 &amp;#039;1&amp;#039;=&amp;gt;7,&amp;#039;2&amp;#039;=&amp;gt;4,&lt;br /&gt;
                 &amp;#039;3&amp;#039;=&amp;gt;6,&amp;#039;4&amp;#039;=&amp;gt;4,&lt;br /&gt;
                 &amp;#039;5&amp;#039;=&amp;gt;2,&amp;#039;6&amp;#039;=&amp;gt;2));&lt;br /&gt;
  } &lt;br /&gt;
 &lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>Sandy</name></author>
	</entry>
</feed>