Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.


Div
classpdfExportLandscape
Script

Scripting Documentation for graphomate sparklines for SAP Lumira Designer 

Rev

2

2020.

0

4 as of

August 2017

October 2020

Div
classnoPrintnoprint

PDF Export

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 Property Standard Properties Sheet under the group Events.

Event NameDescription
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:

  • getSelectedMember(), getSelectedMemberKey(), getSelectedMemberText()

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
getBarWidthFactor()GRAPHOMATESPARKLINES_1.getBarWidthFactor();float0.5Returns the current setting for the bar width factor.

getDisplayCategoryLabels()

GRAPHOMATESPARKLINES_1.getDisplayCategoryLabels();

booleantrueReturns 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();

booleanfalse

Returns whether Overall Range and Relative Range are displayed or not.

getDisplayTrailingValues()

GRAPHOMATESPARKLINES_1.getDisplayTrailingValues();

booleantrue

Returns if trailing values are displayed or not.

getDisplayType()GRAPHOMATESPARKLINES_1.getDisplayType();StringlineReturns either "line" or "bar" for the current display type.

getEnableRuler()

GRAPHOMATESPARKLINES_1.getEnableRuler();

booleantrue

Returns whether the vertical helpline is currently activated or not.

getEnableZoom()

GRAPHOMATESPARKLINES_1.getEnableZoom();

booleantrue

Returns whether the runtime zoom function is enabled or not.

getEnableZoomAnimation()

GRAPHOMATESPARKLINES_1.getEnableZoomAnimation();

booleantrue

Returns whether the appearing of the zoom popup is animated or not.

getHighlightMinMax()

GRAPHOMATESPARKLINES_1.getHighlightMinMax();

booleantrue

Returns if maximum/minimum highlighting is turned on or off.

getIsDataInRows()

GRAPHOMATESPARKLINES_1.getIsDataInRows();booleantrue

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");String10274After 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();float2000Returns the current duration of the zoom animation in ms.
getTitleFontsize()GRAPHOMATESPARKLINES_1.getTitleFontsize();Float18Returns the current font size of the title.
getSparklinePadding()GRAPHOMATESPARKLINES_1.getSparklinePadding();Float4Returns the current padding in px.
getDisplayTrailingValues()GRAPHOMATESPARKLINES_1.getDisplayTrailingValues();booleantrueReturns "true" if the last value of the dataseries is shown.
getSparklineLineThickness()GRAPHOMATESPARKLINES_1.getSparklineLineThickness();Float2Returns the thickness in px.
getFontSize()GRAPHOMATESPARKLINES_1.getFontSize();Float12Returns the font size in px.
getFontFamily()GRAPHOMATESPARKLINES_1.getFontFamily();StringConsolasReturns the font family.
getNumeraljsFormatString()GRAPHOMATESPARKLINES_1.getNumeraljsFormatString();String0.0,0Returns the numeral.js string.
getLocale()GRAPHOMATESPARKLINES_1.getLocale();StringenReturn the current locale.
getLabelFormatMode()GRAPHOMATESPARKLINES_1.getLabelFormatMode();StringextendedReturns 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();StringNone|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();Float200Returns the current zoom height in px.
getZoomFontSize()GRAPHOMATESPARKLINES_1.getZoomFontSize();Float8Returns the current font size of the pop up window.
getZoomLineThickness()GRAPHOMATESPARKLINES_1.getZoomLineThickness();Float2Returns the thickness of the line in the pop up window.
getEnableZoomTooltip()GRAPHOMATESPARKLINES_1.getEnableZoomTooltip();BooleantrueReturns whether the zoom tooltip is enabled or not. 
getEnableZoomCategoryLabels()GRAPHOMATESPARKLINES_1.getEnableZoomCategoryLabels();BooleantrueReturns whether the category labels in the pop up window are enabled or not.
getTextColor()GRAPHOMATESPARKLINES_1.getTextColor();String#ff99e6Returns text color.
getGoodColor()GRAPHOMATESPARKLINES_1.getGoodColor();String#ff99e6Returns the value for good color.
getBadColor()GRAPHOMATESPARKLINES_1.getBadColor();String#ff99e6Returns the value for bad color.
getSparklineColor()GRAPHOMATESPARKLINES_1.getSparklineColor();String#ff99e6Returns the color of the sparkline.
getSparklineBackgroundColor()GRAPHOMATESPARKLINES_1.getSparklineBackgroundColor();String#ff99e6Returns the color of the background of the sparkline.
getSparklineRangeColor()GRAPHOMATESPARKLINES_1.getSparklineRangeColor();String#ff99e6Returns the color of the range in the sparkline.
getZoomLineColor()GRAPHOMATESPARKLINES_1.getZoomLineColor();String#ff99e6Returns the color of the line in the pop up window.
getZoomHelplineColor()GRAPHOMATESPARKLINES_1.getZoomHelplineColor();String#ff99e6Returns the helpline color of the sparkline in the pop up window.
getHighlightColorgetZoomHighlightColor()GRAPHOMATESPARKLINES_1.getHighlightColor();String#ff99e6Returns the color which is shown when hovering on line in the pop up window.
getRulerLineColor()GRAPHOMATESPARKLINES_1.getRulerLineColor();String#ff99e6Returns the actual color of the ruler.
getRulerBoxColor()GRAPHOMATESPARKLINES_1.getRulerBoxColor();String#ff99e6Returns the actual color of the background of the numbers which are shown when the ruler is shown.



Setter NameExampleDescription
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(4);Sets the padding for the sparkline.
setDisplayTrailingValues(Boolean Value)GRAPHOMATESPARKLINES_1.setDisplayTrailingValues(true);Switches between wheter the last value of the dataseries should be shown or not.
setSparklineLineThickness(Float Value)GRAPHOMATESPARKLINES_1.setSparklineLineThickness(3);Sets the line thickness.
setFontSize(Float Value)GRAPHOMATESPARKLINES_1.setFontSize(9);Sets the font size.
setFontFamily(String Value)GRAPHOMATESPARKLINES_1.setFontFamily("Consolas");Sets the font family.
setNumeraljsFormatString(String Value)GRAPHOMATESPARKLINES_1.setNumeraljsFormatString("0.0,0");Sets the numeral.js string.
setLocale(String Value)GRAPHOMATESPARKLINES_1.setLocale("en");Sets the locale. Possible values: "de", "en", "fr" or "auto".
setLabelFormatMode(String Value)GRAPHOMATESPARKLINES_1.setLabelFormatMode("extended");Sets the label format. Possible values: "basic" or "extended".
setExtendedNumberFormat(String Value)GRAPHOMATESPARKLINES_1.setExtendedNumberFormat("()|€|,|.|10^1|2|?");Sets the extended number format.
setExtendedNumberFormatPercent(String Value)GRAPHOMATESPARKLINES_1.setExtendedNumberFormatPercent("None|4|.|,|10^2|4|!");Sets the extended number format percent.
setSuppressRepeatingCategoryLabels(String Value)GRAPHOMATESPARKLINES_1.setSuppressRepeatingCategoryLabels("[true,true,false,false,false]");Sets whether reapeted category labels should be shown or not for each series.
setZoomHeight(Float Value)GRAPHOMATESPARKLINES_1.setZoomHeight(238);Sets the height of the pop up window.
setZoomFontSize(Float Value)GRAPHOMATESPARKLINES_1.setZoomFontSize(7);
Sets the font size of the pop up window.
setZoomLineThickness(Float Value)GRAPHOMATESPARKLINES_1.setZoomLineThickness(2);Sets the thickness of the line in the pop up window.
setEnableZoomTooltip(Boolean Value)GRAPHOMATESPARKLINES_1.setEnableZoomTooltip(true);Sets whether the tooltip in the pop up window should be shown or not.
setEnableZoomCategoryLabels(Boolean Value)GRAPHOMATESPARKLINES_1.setEnableZoomCategoryLabels(true);Sets whether the category labels in the pop up window should be shown or not.
setTextColor(String Value)GRAPHOMATESPARKLINES_1.setTextColor("#ff99e6");Sets the text color.
setGoodColor(String Value)GRAPHOMATESPARKLINES_1.setGoodColor("#ff99e6");Sets the color for positive values.
setBadColor(String Value)GRAPHOMATESPARKLINES_1.setBadColor("#ff99e6");Sets the color for negative values.
setSparklineColor(String Value)GRAPHOMATESPARKLINES_1.setSparklineColor("#ff99e6");Sets the color for the line.
setSparklineBackgroundColor(String Value)GRAPHOMATESPARKLINES_1.setSparklineBackgroundColor("#ff99e6");
Sets the color for the background.
setSparklineRangeColor(String Value)GRAPHOMATESPARKLINES_1.setSparklineRangeColor("#ff99e6");Sets the color for the range.
setZoomLineColor(String Value)GRAPHOMATESPARKLINES_1.setZoomLineColor("#ff99e6");Sets the color for the line in the pop up window.
setZoomHelplineColor(String Value)GRAPHOMATESPARKLINES_1.setZoomHelplineColor("#ff99e6");Sets the color for the helplines in the pop up window.
setHighlightColorsetZoomHighlightColor(String Value)GRAPHOMATESPARKLINES_1.setHighlightColor("#ff99e6");Sets the color for the line which appears on hover in the pop up window.
setRulerLineColor(String Value)GRAPHOMATESPARKLINES_1.setRulerLineColor("#ff99e6");Sets the color for the ruler(-line).
setRulerBoxColor(String Value)GRAPHOMATESPARKLINES_1.setRulerBoxColor("#ff99e6");Sets the color for the background of the numbers which are shown on hover over the ruler.


...