<?xml version="1.0" encoding="UTF-8"?>
<!--
 * Copyright (C) INRIA -  Serge Steer Serge.Steer@inria.fr
 *
 * Copyright (C) 2012 - 2016 - Scilab Enterprises
 *
 * This file is hereby licensed under the terms of the GNU GPL v2.0,
 * pursuant to article 5.3.4 of the CeCILL v.2.1.
 * This file was originally licensed under the terms of the CeCILL v2.1,
 * and continues to be available under such terms.
 * For more information, see the COPYING file which you should have received
 * along with this program.
-->
<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:lang="en_US" xml:id="datatipCreate">
    <refnamediv>
        <refname>datatipCreate</refname>
        <refpurpose>Create a datatip on a polyline by program</refpurpose>
    </refnamediv>
    <refsynopsisdiv>
        <title>Syntax</title>
        <synopsis>datatip_handle = datatipCreate(polyline_handle,index)
            datatip_handle = datatipCreate(polyline_handle,pt)
        </synopsis>
    </refsynopsisdiv>
    <refsection>
        <title>Arguments</title>
        <variablelist>
            <varlistentry>
                <term>polyline_handle</term>
                <listitem>
                    <para>
                        A handle on a polyline
                    </para>
                </listitem>
            </varlistentry>
            <varlistentry>
                <term>index</term>
                <listitem>
                    <para>
                        The index of a polyline data point where to draw the data tip.
                    </para>
                </listitem>
            </varlistentry>
            <varlistentry>
                <term>pt</term>
                <listitem>
                    <para>
                        A vector with 2 or 3 elements, the coordinates of the point where to draw the data tip.
                    </para>
                </listitem>
            </varlistentry>
            <varlistentry>
                <term>datatip_handle</term>
                <listitem>
                    <para>
                        The handle on the newly created entity
                    </para>
                </listitem>
            </varlistentry>
        </variablelist>
    </refsection>
    <refsection>
        <title>Description</title>
        <para>
            This function can be used to create datatips on a polyline by
            program. Called with an index as second argument, it sets the
            tip at the coordinates given by polyline point specified by the
            index. Called with a point as second argument it sets the tip
            at the coordinates corresponding to the orthogonal projection
            of the point on the polyline if the interpolation mode is on or to
            the nearest mesh point.
        </para>
    </refsection>
    <refsection>
        <title>Examples</title>
        <programlisting role="example"><![CDATA[
    x=linspace(0,1,9)';
    y=x.^3;
    clf();
    plot(x,y);
    e=gce();p=e.children(1);//get the handle on the polyline
    p.mark_mode="on";p.mark_style=2;p.mark_size=12;
    t=datatipCreate(p,5);

    datatipCreate(p,[0.65,0.3]);
    ]]></programlisting>
        <scilab:image>
            x=linspace(0,1,9)';
            y=x.^3;
            plot(x,y);
            e=gce();p=e.children(1);//get the handle on the polyline
            p.mark_mode="on";p.mark_style=2;p.mark_size=12;
            t=datatipCreate(p,5);

            datatipCreate(p,[0.65,0.3]);
        </scilab:image>
    </refsection>
    <refsection role="see also">
        <title>See also</title>
        <simplelist type="inline">
            <member>
                <link linkend="datatips">datatips</link>
            </member>
            <member>
                <link linkend="datatipMove">datatipMove</link>
            </member>
        </simplelist>
    </refsection>
</refentry>
