Scripting Documentation for graphomate sparklines for SAP Lumira Designer
Rev 2.2 as of June 2019
Introduction
The graphomate sparklines extension 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 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.
Events
The following events are available. User-made scripts can be deposited on the Standard Properties Sheet under the group Events.
Event Name | Description |
---|---|
On Element Clicked | Is triggered when the user clicks on an element of the chart at runtime; this event is triggered regardless of whether the zoom popup is enabled or not. In order to allow a drilldown, it is necessary to react on the user input at this point. The return values of the following functions are updated at the moment of the event:
|
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 Name | Example | Return type | Example Return Value | Description |
---|---|---|---|---|
getBarWidthFactor() | GRAPHOMATESPARKLINES_1.getBarWidthFactor(); | float | 0.5 | Returns the current setting for the bar width factor. |
getDisplayCategoryLabels() | GRAPHOMATESPARKLINES_1.getDisplayCategoryLabels(); | boolean | true | Returns if Category Labels are displayed or not. In case of true, they are shown, otherwise not. |
getDisplayLeadingValues() | GRAPHOMATESPARKLINES_1.getDisplayLeadingValue(); | boolean | true | Returns if leading values are displayed or not. |
getDisplayOverallRange() | GRAPHOMATESPARKLINES_1.getDisplayOverallRange(); | boolean | false | Returns whether Overall Range and Relative Range are displayed or not. |
getDisplayTrailingValues() | GRAPHOMATESPARKLINES_1.getDisplayTrailingValues(); | boolean | true | Returns if trailing values are displayed or not. |
getDisplayType() | GRAPHOMATESPARKLINES_1.getDisplayType(); | String | line | Returns either "line" or "bar" for the current display type. |
getEnableRuler() | GRAPHOMATESPARKLINES_1.getEnableRuler(); | boolean | true | Returns whether the vertical helpline is currently activated or not. |
getEnableZoom() | GRAPHOMATESPARKLINES_1.getEnableZoom(); | boolean | true | Returns whether the runtime zoom function is enabled or not. |
getEnableZoomAnimation() | GRAPHOMATESPARKLINES_1.getEnableZoomAnimation(); | boolean | true | Returns whether the appearing of the zoom popup is animated or not. |
getHighlightMinMax() | GRAPHOMATESPARKLINES_1.getHighlightMinMax(); | boolean | true | Returns if maximum/minimum highlighting is turned on or off. |
getIsDataInRows() | GRAPHOMATESPARKLINES_1.getIsDataInRows(); | boolean | true | Returns the current orientation of data interpretation. |
getSelectedMember(dimension dimensionKey) | GRAPHOMATESPARKLINES_1.getSelectedMember().text; | Member | 0D_NWI_RCOD | After the user clicked on a sparkline, this function returns the member of the specified dimension dimensionKey. The member provides different properties such as text, internalKey and externalKey. |
getSelectedMemberKey(string value dimensionKey) | GRAPHOMATESPARKLINES_1.getSelectedMemberKey("0D_NWI_RCOD"); | String | 10274 | After the user clicked on a sparkline, this function returns the Key of the member of the selected dimension dimensionKey. |
getSelectedMemberText(string value dimensionKey) | GRAPHOMATESPARKLINES_1.getSelectedMemberText("0D_NWI_RCOD"); | String | North West | After the user clicked on a sparkline, this function returns the text of the member of the selected dimension dimensionKey. The return value is similar to the function getSelectedMemberKey(). |
getSelection() | GRAPHOMATESPARKLINES_1.getSelection(); | String | {} | Returns the selection currently in use. If “{}“ is returned that means that the complete resultset is used to generate sparklines. |
getTitle() | GRAPHOMATESPARKLINES_1.getTitle(); | String | Switzerland,%202015%0A | Returns the current title of the sparkline component. |
getZoomDuration() | GRAPHOMATESPARKLINES_1.getZoomDuration(); | float | 2000 | Returns the current duration of the zoom animation in ms. |
getTitleFontsize() | GRAPHOMATESPARKLINES_1.getTitleFontsize(); | Float | 18 | Returns the current font size of the title. |
getSparklinePadding() | GRAPHOMATESPARKLINES_1.getSparklinePadding(); | Float | 4 | Returns the current padding in px. |
getDisplayTrailingValues() | GRAPHOMATESPARKLINES_1.getDisplayTrailingValues(); | boolean | true | Returns "true" if the last value of the dataseries is shown. |
getSparklineLineThickness() | GRAPHOMATESPARKLINES_1.getSparklineLineThickness() | Float | 2 | Returns the thickness in px. |
getFontSize() | GRAPHOMATESPARKLINES_1.getFontSize() | Float | 12 | Returns the font size in px. |
getFontFamily() | GRAPHOMATESPARKLINES_1.getFontFamily() | String | Consolas | Returns the font family. |
getNumeraljsFormatString() | GRAPHOMATESPARKLINES_1.getNumeraljsFormatString() | String | 0.0,0 | Returns the numeral.js string. |
getLocale() | GRAPHOMATESPARKLINES_1.getLocale() | String | en | Return the current locale. |
getLabelFormatMode() | GRAPHOMATESPARKLINES_1.getLabelFormatMode() | String | extended | Returns the current mode of the label format. |
getExtendedNumberFormat() | GRAPHOMATESPARKLINES_1.getExtendedNumberFormat() | String | ()|€|,|.|10^1|2|? | Returns the current extended number format. |
getExtendedNumberFormatPercent() | GRAPHOMATESPARKLINES_1.getExtendedNumberFormatPercent() | String | None|4|.|,|10^2|4|! | Returns the current extended number format percent. |
getSuppressRepeatingCategoryLabels() | GRAPHOMATESPARKLINES_1.getSuppressRepeatingCategoryLabels() | String | [true,true,false,false,false] | Returns the current values of the labels which show repeating category labels und which not. |
getZoomHeight() | GRAPHOMATESPARKLINES_1.getZoomHeight() | Float | 200 | Returns the current zoom height in px. |
getZoomFontSize() | GRAPHOMATESPARKLINES_1.getZoomFontSize() | Float | 8 | Returns the current font size of the pop up window. |
getZoomLineThickness() | GRAPHOMATESPARKLINES_1.getZoomLineThickness() | Float | 2 | Returns the thickness of the line in the pop up window. |
getEnableZoomTooltip() | GRAPHOMATESPARKLINES_1.getEnableZoomTooltip() | Boolean | true | Returns whether the zoom tooltip is enabled or not. |
getEnableZoomCategoryLabels() | GRAPHOMATESPARKLINES_1.getEnableZoomCategoryLabels() | Boolean | true | Returns whether the category labels in the pop up window are enabled or not. |
getTextColor() | GRAPHOMATESPARKLINES_1.getTextColor() | String | #ff99e6 | Returns text color. |
getGoodColor() | GRAPHOMATESPARKLINES_1.getGoodColor() | String | #ff99e6 | Returns the value for good color. |
getBadColor() | GRAPHOMATESPARKLINES_1.getBadColor() | String | #ff99e6 | Returns the value for bad color. |
getSparklineColor() | GRAPHOMATESPARKLINES_1.getSparklineColor() | String | #ff99e6 | Returns the color of the sparkline. |
getSparklineBackgroundColor() | GRAPHOMATESPARKLINES_1.getSparklineBackgroundColor() | String | #ff99e6 | Returns the color of the background of the sparkline. |
getSparklineRangeColor() | GRAPHOMATESPARKLINES_1.getSparklineRangeColor() | String | #ff99e6 | Returns the color of the range in the sparkline. |
getZoomLineColor() | GRAPHOMATESPARKLINES_1.getZoomLineColor() | String | #ff99e6 | Returns the color of the line in the pop up window. |
getZoomHelplineColor() | GRAPHOMATESPARKLINES_1.getZoomHelplineColor() | String | #ff99e6 | Returns the helpline color of the sparkline in the pop up window. |
getZoomHighlightColor() | GRAPHOMATESPARKLINES_1.getHighlightColor() | String | #ff99e6 | Returns the color which is shown when hovering on line in the pop up window. |
getRulerLineColor() | GRAPHOMATESPARKLINES_1.getRulerLineColor() | String | #ff99e6 | Returns the actual color of the ruler. |
getRulerBoxColor() | GRAPHOMATESPARKLINES_1.getRulerBoxColor() | String | #ff99e6 | Returns the actual color of the background of the numbers which are shown when the ruler is shown. |
Setter Name | Example | Description |
---|---|---|
setBarwidthFactor(float value) | GRAPHOMATESPARKLINES_1.setBarWidthFactor(0.6); | Sets the bar width factor to the passed value. The available space per bar is then multiplied with the factor; a value of 1 will thus result in bars touching each other, 0.5 will leave gaps as wide as the bars. |
setDisplayCategoryLabels(boolean value) | GRAPHOMATESPARKLINES_1.setDisplayLeadingValues(true); | Governs the display of leading values (the first data point of each individual sparkline). |
setDisplayOverallRange(boolean value) | GRAPHOMATESPARKLINES_1.setDisplayOverallRange(true); | Governs whether Overall Range and Relative Range in the sparkline background are displayed. |
setDisplayTrailingValues(boolean value) | GRAPHOMATESPARKLINES_1.setDisplayTrailingValues(true); | Governs the display of trailing values (last data point of each individual sparkline). |
setDisplayType(String type) | GRAPHOMATESPARKLINES_1.setDisplayType(); | Sets the display type to the passed value; parameter must be either "line" or "bars". |
setEnableRuler(boolean value) | GRAPHOMATESPARKLINES_1.setEnableRuler(true); | Switches the vertical helpline on or off. |
setEnableZoom(boolean value) | GRAPHOMATESPARKLINES_1.setEnableZoom(true); | Switches the runtime zoom function on or off. |
setEnableZoomAnimation(boolean value) | GRAPHOMATESPARKLINES_1.setEnableZoomAnimation(true); | With this function, the animation of the zoom popup can be switched on or off. If false is passed, the zoom popup will appear directly, without animation. |
setHighlightMinMax(boolean value) | GRAPHOMATESPARKLINES_1.setHighlightMinMax(true); | Switches the highlighting of maximum/minimum values on or off. |
setIsDataInRows(boolean value) | GRAPHOMATESPARKLINES_1.setIsDataInRows(true); | Governs the orientation of data interpretation. If true is passed, the selection will be interpreted as rows, in case of false, sparklines will be generated from the selection‘s columns. |
setSelection(string value) | GRAPHOMATESPARKLINES_1.setSelection(“{}“); | Sets the selection to the passed string. If “{}“ is specified, the complete resultset will be used to generate sparklines. |
setZoomDuration(float value) | GRAPHOMATESPARKLINES_1.setZoomDuration(2000); | Sets the duration of the zoom animation. Parameter needs to be passed in ms. |
setTitleFontsize(Float Value) | GRAPHOMATESPARKLINES_1.setTitleFontsize(18); | Sets the font size for the title. |
setSparklinePadding(Float Value) | GRAPHOMATESPARKLINES_1.setSparklinePadding | Sets the padding for the sparkline. |
setDisplayTrailingValues(Boolean Value) | GRAPHOMATESPARKLINES_1.setDisplayTrailingValues | Switches between wheter the last value of the dataseries should be shown or not. |
setSparklineLineThickness(Float Value) | GRAPHOMATESPARKLINES_1.setSparklineLineThickness | Sets the line thickness. |
setFontSize(Float Value) | GRAPHOMATESPARKLINES_1.setFontSize | Sets the font size. |
setFontFamily(String Value) | GRAPHOMATESPARKLINES_1.setFontFamily | Sets the font family. |
setNumeraljsFormatString(String Value) | GRAPHOMATESPARKLINES_1.setNumeraljsFormatString | Sets the numeral.js string. |
setLocale(String Value) | GRAPHOMATESPARKLINES_1.setLocale | Sets the locale. Possible values: "de", "en", "fr" or "auto". |
setLabelFormatMode(String Value) | GRAPHOMATESPARKLINES_1.setLabelFormatMode | Sets the label format. Possible values: "basic" or "extended". |
setExtendedNumberFormat(String Value) | GRAPHOMATESPARKLINES_1.setExtendedNumberFormat | Sets the extended number format. |
setExtendedNumberFormatPercent(String Value) | GRAPHOMATESPARKLINES_1.setExtendedNumberFormatPercent | Sets the extended number format percent. |
setSuppressRepeatingCategoryLabels(String Value) | GRAPHOMATESPARKLINES_1.setSuppressRepeatingCategoryLabels | Sets whether reapeted category labels should be shown or not for each series. |
setZoomHeight(Float Value) | GRAPHOMATESPARKLINES_1.setZoomHeight | Sets the height of the pop up window. |
setZoomFontSize(Float Value) |
| Sets the font size of the pop up window. |
setZoomLineThickness(Float Value) | GRAPHOMATESPARKLINES_1.setZoomLineThickness | Sets the thickness of the line in the pop up window. |
setEnableZoomTooltip(Boolean Value) | GRAPHOMATESPARKLINES_1.setEnableZoomTooltip | Sets whether the tooltip in the pop up window should be shown or not. |
setEnableZoomCategoryLabels(Boolean Value) | GRAPHOMATESPARKLINES_1.setEnableZoomCategoryLabels | Sets whether the category labels in the pop up window should be shown or not. |
setTextColor(String Value) | GRAPHOMATESPARKLINES_1.setTextColor | Sets the text color. |
setGoodColor(String Value) | GRAPHOMATESPARKLINES_1.setGoodColor | Sets the color for positive values. |
setBadColor(String Value) | GRAPHOMATESPARKLINES_1.setBadColor | Sets the color for negative values. |
setSparklineColor(String Value) | GRAPHOMATESPARKLINES_1.setSparklineColor | Sets the color for the line. |
setSparklineBackgroundColor(String Value) |
| Sets the color for the background. |
setSparklineRangeColor(String Value) | GRAPHOMATESPARKLINES_1.setSparklineRangeColor | Sets the color for the range. |
setZoomLineColor(String Value) | GRAPHOMATESPARKLINES_1.setZoomLineColor | Sets the color for the line in the pop up window. |
setZoomHelplineColor(String Value) | GRAPHOMATESPARKLINES_1.setZoomHelplineColor | Sets the color for the helplines in the pop up window. |
setZoomHighlightColor(String Value) | GRAPHOMATESPARKLINES_1.setHighlightColor | Sets the color for the line which appears on hover in the pop up window. |
setRulerLineColor(String Value) | GRAPHOMATESPARKLINES_1.setRulerLineColor | Sets the color for the ruler(-line). |
setRulerBoxColor(String Value) | GRAPHOMATESPARKLINES_1.setRulerBoxColor( | Sets the color for the background of the numbers which are shown on hover over the ruler. |