.. highlightlang:: us .. index:: XYSetLegendText .. _xysetlegendtext: XYSetLegendText =============== .. us.tag XYSetLegendText ENGLISH XYSet :ref:`XYSetLegendText` sets the legend text for a 1D or 2D dataset. .. function:: bool = XYSetLegendText(hData, ssText) .. us.return **Return Value** *bool* is TRUE (1) it the text could be set and FALSE (0) if the text could not be set. If the legend text is write protected, the function will return FALSE. .. us.params **Parameters** .. uparam:: ssText *ssText* is the legend text. If the legend text starts with an exclamation mark (!) the dataset will not be included into the legend or axis title. .. uparam:: hData The handle of a dataset created with :ref:`XYCreate` or :ref:`TYCreate`. .. us.comment **Comment** The legend text is used by the legend's field function. To make sure that text can be set, call :ref:`XYProtectLegendText` to unprotect the text. .. seealso:: :ref:`overview-xy-datasets`, :ref:`XYCreate`, :ref:`XYGetLegendText`, :ref:`XYProtectLegendText`, :ref:`XYIsLegendTextProtected` :sub:`id-1045080`