.. include:: ../substitutions
.. include:: ../../toolkit-substitutions

.. oe:namespace:: OEDepict

.. _OEDepict_OEDrawLegendLayout:


.. oe:function:: OEDrawLegendLayout


   .. oe:language:: c++ java csharp

      .. oe:api::

         bool OEDrawLegendLayout(OELegendLayout& layout)

   .. oe:language:: python

      .. oe:api:: python

         OEDrawLegendLayout(layout: OELegendLayout) -> bool

   Draws the legend layout.

   .. note::

      Interactive legend can only be used in :file:`.svg` image format.

   .. seealso::

      * :ref:`OELegendLayout <OEDepict_OELegendLayout>` class
      * :ref:`OELegendLayoutOptions <OEDepict_OELegendLayoutOptions>` class
      * :oe:constns:`OEDepict::OELegendLayoutStyle` namespace
      * :oe:constns:`OEDepict::OELegendColorStyle` namespace
      * :oe:constns:`OEDepict::OELegendInteractiveStyle` namespace

   **Example**

   .. oe:source:: LegendLayout.cpp
      :language: c++
      :frag:     SNIPPET-LEGEND-LAYOUT

   .. oe:source:: LegendLayout.py
      :language: python
      :frag:     SNIPPET-LEGEND-LAYOUT

   .. oe:source:: LegendLayout.java
      :language: java
      :noindent:
      :frag:     SNIPPET-LEGEND-LAYOUT

   .. oe:source:: LegendLayout.cs
      :language: csharp
      :noindent:
      :frag:     SNIPPET-LEGEND-LAYOUT

   .. hint::

      The :oe:func:`OEDepict::OEDrawLegendLayout` function should be called
      after rendering all other information to the image.

   .. only:: oehtml

      .. oe:language:: c++

         .. admonition:: Download code

            :download:`LegendLayout.cpp <../../../../../sublibs/tklibs/depict/examples/docs/LegendLayout.cpp>`

      .. oe:language:: python

         .. admonition:: Download code

            :download:`LegendLayout.py <../../../../../wrappers/python/docexamples/depict/LegendLayout.py>`

      .. oe:language:: java

         .. admonition:: Download code

            :download:`LegendLayout.java <../../../../../wrappers/java/examples/openeye/docexamples/oedepict/LegendLayout.java>`

      .. oe:language:: csharp

         .. admonition:: Download code

            :download:`LegendLayout.cs <../../../../../wrappers/csharp/Csharp-Examples/OEDepictDocs/LegendLayout.cs>`

.. only:: oehtml

   .. raw:: html

      <p align="center">
      <b>click on the "Legend" label</b>
      </p>

      <p align="center">
      <object data="../../_images/LegendLayout.svg" type="image/svg+xml"  width = "350" ></object>
      <p>

      <p align="center">
      <b>Example of using the OEDrawLegendLayout function</b>
      <p>

   .. image:: ../../depicttk/images/LegendLayout.svg
      :width: 1pt

   .. only:: oepdf

      |NOPDFIMAGE|

   .. seealso::

      * :ref:`chapter_svg` chapter
