rrd: more examples for RRDGraph::setOptions #65756

git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@332610 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
Miroslav Kubelik 2014-01-13 22:31:22 +00:00
parent 9e0df2f6fe
commit 616af19042

View file

@ -45,7 +45,7 @@
&reftitle.examples;
<para>
<example>
<title><methodname>RRDGraph::setOptions</methodname> examples</title>
<title><methodname>RRDGraph::setOptions</methodname> example</title>
<programlisting role="php">
<![CDATA[
<?php
@ -58,6 +58,54 @@ $graphObj->setOptions(array(
"LINE2:realspeed#FF0000"
));
?>
]]>
</programlisting>
</example>
<example>
<title>Set multiple color options</title>
<programlisting role="php">
<![CDATA[
<?php
$graphObj->setOptions(array(
"--start" => "920804400",
"--end" => 920808000,
"--vertical-label" => "m/s",
"--color=BACK#00000000",
"--color=GRID#00000000",
"--color=MGRID#00000000",
"DEF:myspeed=$rrdFile:speed:AVERAGE",
"CDEF:realspeed=myspeed,1000,*",
"LINE2:realspeed#FF0000"
));
?>
]]>
</programlisting>
<para>
Don't use key value syntax for same rrd option. It looks more readable, but
it doesn't work.
</para>
<programlisting role="php">
<![CDATA[
<?php
$graphObj->setOptions(array(
"--color" => "BACK#00000000",
"--color" => "GRID#00000000",
"--color" => "MGRID#00000000"
));
?>
]]>
</programlisting>
<para>
In nature of php it's same as
</para>
<programlisting role="php">
<![CDATA[
<?php
$graphObj->setOptions(array(
"--color" => "MGRID#00000000"
));
?>
]]>
</programlisting>
</example>