Scripting Documentation

Scripting Documentation of graphomate legends for SAP Lumira Designer

Rev 2020.4 as of October 2020

PDF

Introduction

The graphomate legends supports the SAP Designer scripting language. This enables the user to dynamically interact with the add-on during runtime. Script commands include manipulation of the [extension] layout or setting of data. This document features a list of all currently available script commands. Please do not hesitate to contact us if any feature is missing. For this, you can use our online form.

Functions

The following functions are available. They can be addressed in the scripting editor of Designer. We differentiate between getter and setter functions as they get information from the extension or set its properties.


Getter NameExampleReturn typeExample Return ValueDescription
getBoldText()GRAPHOMATELEGENDS_1.getBoldText();booleanfalseReturns true if the legend texts are formatted bold; otherwise returns false.
getColoredText()GRAPHOMATELEGENDS_1.getColoredText();booleantrueReturns true if the texts are colored in the icon color; otherwise returns false.
getDataSet(int dataSetIndex)GRAPHOMATELEGENDS_1.getDataSet(1);String‘{“0CALMONTH”:”22009”}’Returns the selection string corresponding to the data property with the given index.
getFollowingIcons()GRAPHOMATELEGENDS_1.getFollowingIcons();booleantrueReturns true if icons are displayed right of the text, and false, if icons are displayed in front of the text.
getFontSize()GRAPHOMATELEGENDS_1.getFontSize();float13.5Returns the fontsize of the texts.
getSelectedMember()GRAPHOMATELEGENDS_1.getSelectedMember("0D_NWI_RCOD");Member
Returns the member of the passed dimension for the last clicked legend entry.
getShowIcons()GRAPHOMATELEGENDS_1.getShowIcons();booleantrueReturns true if icons are displayed, otherwise false.
getVerticalAlignment()GRAPHOMATELEGENDS_1.getVerticalAlignment();booleanfalseReturns true if the legend entries are aligned vertically; otherwise return false.
Setter NameExampleDescription
setBoldText(boolean boldText)GRAPHOMATELEGENDS_1.setBoldText(true);If true is passed, formats the texts in bold fontweight.
setColoredText(boolean coloredText)GRAPHOMATELEGENDS_1.setColoredText(true);If set to true, the texts will be colored in the icon color instead of the text color.
setDataSet(int dataSetIndex, String dataSet)GRAPHOMATELEGENDS_1.setDataSet(1, ‘{“0CALMONTH”:”22009”}’);Sets the data property with the given index to the passed selection string.
setEntryOption(int index, String targetProperty, String newValue)GRAPHOMATELEGENDS_1.setEntryOption(1, “shape”, “circle”);

This script function can be used to change a single property of a legend key. The following parameters have to be passed:

-    index: Index of the legend entry to be changed. If the index doesn't exist, a new legend entry is created.

-    targetProperty: Name of the property to be changed („shape“, „filltype“, „color“ or „text“)

-    newValue: new Value of the property

The following inputs are acceptable:

-    for property „shape“: „rect“, „circle“ or „rhomb“

-    for property „filltype“: „filled“, „hatchedUp“, „hatchedDown“, „dotted“, „empty“, "hatchedUpBold", "hatchedDownBold"

-    for the property „color“, any color in hex notation can be passed (e. g. „#000000“ for black, or „#ff0000“ for red).

-    for property „text“, any string of characters is acceptable.

If invalid parameters are passed, the legend entry to formatted will fall back to a solid black rectangle.

setFollowingIcons(boolean followingIcons)GRAPHOMATELEGENDS_1.setFollowingIcons(true);Governs whether icons are displayed left (false) or right (true) of the text.
setFontSize(float fontsize)GRAPHOMATELEGENDS_1.setFontSize(13.5);Sets the fontsize of the texts.
setShowIcons(boolean showIcons)GRAPHOMATELEGENDS_1.setShowIcons(false);Governs if icons are displayed; if true is passed to this function, icons are shown.
setVerticalAlignment(boolean verticalAlignment)GRAPHOMATELEGENDS_1.setVerticalAlignment(true);Sets the alignment of the legend entries. If true, entries will be aligned vertcially; if false, entries will be displayed horizontally in a single line.