php-doc-en/reference/rrd/rrdgraph/setoptions.xml
2014-01-13 22:31:22 +00:00

135 lines
3.1 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
<refentry xml:id="rrdgraph.setoptions" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refnamediv>
<refname>RRDGraph::setOptions</refname>
<refpurpose>Sets the options for rrd graph export</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<modifier>public</modifier> <type>void</type><methodname>RRDGraph::setOptions</methodname>
<methodparam><type>array</type><parameter>options</parameter></methodparam>
</methodsynopsis>
<para>
</para>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<variablelist>
<varlistentry>
<term><parameter>options</parameter></term>
<listitem>
<para>
List of options for the image generation from the RRD database file. It can
be list of strings or list of strings with keys for better readability. Read
the rrd graph man pages for list of available options.
</para>
</listitem>
</varlistentry>
</variablelist>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
&return.void;
</para>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<para>
<example>
<title><methodname>RRDGraph::setOptions</methodname> example</title>
<programlisting role="php">
<![CDATA[
<?php
$graphObj->setOptions(array(
"--start" => "920804400",
"--end" => 920808000,
"--vertical-label" => "m/s",
"DEF:myspeed=$rrdFile:speed:AVERAGE",
"CDEF:realspeed=myspeed,1000,*",
"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>
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->