...
class | pdfExportLandscape |
---|
Scripting Documentation for graphomate charts for SAP Lumira Designer
Introduction
The graphomate charts extension supports the scripting language of Designer. Therefore, it is possible to determine properties of the extension at run-time. New data can be set, titles can be adapted and scales be changed. Furthermore, it is possible to use drilldown functionalities of the extension and thus create interactive dashboards.
This document provides a list of available functions, events and examples. We are steadily working on expanding the range of functions. If you miss certain functions, please give us a note. Therefore you can use our online form under http://www.graphomate.com/en/feedback.
Events
The following events are available. User-made scripts can be deposited on the Standard Properties Sheet under the point Events.
...
Is triggered if the user clicks on an element on the chart at run-time. 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:
getSelectedMemberKey(), getSelectedMemberText(), getClickedElementIndex(), getClickedSeriesIndex()
...
Is triggered when the chart receives updated data. This is happening, for example, when the dimension of a Data Source or if a filter has been changed.
This would be the appropriate point to change Data Types or the Waterfall Calculation Path.
Functions
The following functions are available in the graphomate charts extension. They can be addressed in the scripting editor of Designer.
Guideline to umlauts, special characters and blank spaces
In general umlauts, special characters and blank spaces Umlauts are percent encoded for technical reasons in the Additional Properties Sheet (see: http://en.wikipedia.org/wiki/Percent-encoding).
Example:
Nestlé - Development of sales in % compared to the previous year
becomes:
Nestl%C3%A9%20 %20Development%20of%20sales%20in%20%25%20compared%20to%20the%20previous%20year
This makes it necessary to percent encode string values even while transferring them from the scripting language or Standard Properties Sheet. (On the Internet there are many free tools for en-/decoding, for example: http://www.url-encode-decode.com/.)
...
getAxisLabels()
...
GRAPHOMATECHART_1.getAxisLabels();
...
String
...
Budget, Actual
...
Returns axis labels as a comma-separated string value.
...
getAxisThickness()
...
GRAPHOMATECHART_1.getAxisThickness();
...
Integer
...
3.0
...
Returns the axis thickness as an integer value.
...
getBarWidth()
...
GRAPHOMATECHART_1.getBarWidth();
...
Float
...
5.0
...
Returns the width of the bars as a float value.
...
getBaseChartVisible()
...
GRAPHOMATECHART_1.getBaseChartVisible();
...
Boolean
...
true
...
Returns whether the base chart is visible.
...
getCalculationPath()
...
GRAPHOMATECHART_1.getCalculationPath();
...
String
...
+,+,+,-,-,=, ,s+,+,=,-,-
...
Returns the waterfall calculation path as a comma-separated string value.
...
getCalculateDeviationsFromNull()
...
GRAPHOMATECHART_1.getCalculateDeviationsFromNull();
...
Boolean
...
true
...
Returns whether NULL values are used to calculate deviations.
...
getCategoryAxisVisible()
...
GRAPHOMATECHART_1.getCategoryAxisVisible();
...
Boolean
...
true
...
Returns whether the category axis is visible.
...
getCategoryCount()
...
GRAPHOMATECHART_1.getCategoryCount();
...
Integer
...
12
...
Returns whether the number of to be displayed categories is limited. Returns an integer value. A value of 0 means that there is no limitation.
...
getCategoryLabelRotation()
...
GRAPHOMATECHART_1.getCategoryLabelRotation();
...
Integer
...
45
...
Returns the rotation angle of the category labels.
...
getCategoryWidth()
...
GRAPHOMATECHART_1.getCategoryWidth();
...
Integer
...
20
...
Returns the width of the categories as an integer value if the Category Width is fixed.
...
getChartType()
...
GRAPHOMATECHART_1.getChartType();
...
String
...
line
...
Returns the chart type as a string-value.
...
getClickedElementIndex()
...
GRAPHOMATECHART_1.getClickedElementIndex();
...
Integer
...
3
...
Returns the index of the last clicked element/category.
...
getClickedPositionValue()
...
GRAPHOMATECHART_1.getClickedPositionValue();
...
Float
...
234234.432
...
Returns the relative value of the clicked position in the chart.
This can be utilized to create a zoom function, when the clicked value is passed back to the chart as the manual scale minimum.
...
getClickedSeriesIndex()
...
GRAPHOMATECHART_1.getClickedSeriesIndex();
...
Integer
...
1
...
Returns the index of the last clicked Data Series.
...
getComparisonGroup()
...
GRAPHOMATECHART_1.getComparisionGroup();
...
String
...
A
...
Returns the Comparison Group as a string value.
...
getDatatypes(Integer seriesIndex)
...
GRAPHOMATECHART_1.getDatatypes(1);
...
String
...
PY,PY,PY,PY,AC,AC,AC,AC,PL,PL,PL,PL
...
This function returns the Data Types of the selected Data Series seriesIndex as a comma-separated string.
...
getDeviationBadColor()
...
GRAPHOMATECHART_1.getDeviationBadColor();
...
String
...
#ff3300
...
This function returns the color used for "bad" deviations.
...
getDeviationGoodColor()
...
GRAPHOMATECHART_1.getDeviationGoodColor();
...
String
...
#2e2e2e
...
This function returns the color used for "good" deviations.
...
getDeviationVisibility()
...
GRAPHOMATECHART_1.getDeviationVisibility();
...
String
...
0,1,4
...
Returns a list of indexes of visible deviation charts as a comma-separated string.
...
getElementsOffset()
...
GRAPHOMATECHART_1.getElementsOffset();
...
Float
...
2.0
...
This function returns the offset between the elements of a category as a float value.
...
getEndingLineOverlap()
...
GRAPHOMATECHART_1.getEndingLineOverlap();
...
Integer
...
3
...
Returns how far the Ending Lines protrude over the bars.
...
getEndingLineThickness()
...
GRAPHOMATECHART_1.getEndingLineThickness();
...
Integer
...
2
...
Returns the thickness of the Ending Lines.
...
getEndingLineVisible()
...
GRAPHOMATECHART_1.getEndingLineVisible();
...
Boolean
...
false
...
Returns whether to display Ending Lines above the bars.
...
getExtendedNumberFormat()
...
GRAPHOMATECHART_1.getExtendedNumberFormat();
...
String
...
-||.|,|1|1|%25
...
Returns the number format for the Extended Mode. The format string can be found in the manual.
...
-||.|,|1|1|%25
...
getFixedCategoryWidth()
...
GRAPHOMATECHART_1.getFixedCategoryWidth();
...
Boolean
...
true
...
This function returns a boolean value whether the Category Width is fixed.
...
getHighlightMode()
...
GRAPHOMATECHART_1.getHighlightMode();
...
String
...
single
...
This function returns the current setting for the highlight mode.
...
getLabelFormatMode()
...
GRAPHOMATECHART_1.getLabelFormatMode();
...
String
...
extended
...
Returns which mode is used for the label format.
...
getLabelPositioningMode()
...
GRAPHOMATECHART_1.getLabelPositioningMode();
...
String
...
auto
...
Returns the current label positioning mode.
...
getLockData()
...
GRAPHOMATECHART_1.getLockData();
...
Boolean
...
true
...
Returns whether this component ignores data updates.
...
getManualScalePercentMax()
...
GRAPHOMATECHART_1.getManualScalePercentMax();
...
Float
...
80.5
...
Returns the manual percentage scaling maximum as a float value.
...
getManualScalePercentMin()
...
GRAPHOMATECHART_1.getManualScalePercentMin();
...
Float
...
-80.5
...
Returns the manual percentage scaling maximum as a float value.
...
[{"startElement":1,"endElement":2,"startSeries":1,"endSeries":1}, {"startElement":3,"endElement":4,"startSeries":1,"endSeries":1}, {"startElement":5,"endElement":6,"startSeries":1,"endSeries":1}]
...
Returns a list of the current mulit highlights (highlighted values above the chart). Returns a JSON-string, which contains an array consisting of an object for each multi highlight. The following elements are part of an object (the order of these elements must be maintained): {"startElement":1,"endElement":2,"startSeries":1,"endSeries":1}.
...
getNegativeDeviationIsGood()
...
GRAPHOMATECHART_1.getNegativeDeviationIsGood();
...
Boolean
...
true
...
Returns whether the negative deviations are interpreted as positive or negative.
...
getNegativeOutlierThreshold()
...
GRAPHOMATECHART_1.getNegativeOutlierThreshold();
...
Float
...
-80.0
...
Returns the negative outlier threshold as a float value.
...
getNumberFormat()
...
GRAPHOMATECHART_1.getNumberFormat();
...
String
...
0,0.0
...
Returns the number format for the Basic Mode. The format string corresponds to the format numeral.js (see http://www.numeraljs.com).
...
getNumberFormatPercentage()
...
GRAPHOMATECHART_1.getNumberFormatPercentage();
...
String
...
0%
...
Returns the number format for the percentage values in the Basic Mode. The format string corresponds to the format numeral.js (see http://www.numeraljs.com).
...
getPositiveOutlierThreshold()
...
GRAPHOMATECHART_1.getPositiveOutlierThreshold();
...
Float
...
80.0
...
Returns the positive outlier threshold as a float value.
...
getSelectedMember(Dimension dimensionKey)
...
GRAPHOMATECHART_1.getSelectedMember();
...
Member
...
0D_NWI_RCOD
...
After the user clicked on an element/a category in the chart, this function returns the member of the specified dimension dimensionKey. The member provides different properties such as text, internalKey and externalKey.
...
getSelectedMemberKey(String dimensionKey)
...
GRAPHOMATECHART_1.getSelectedMemberKey("0D_NWI_RCOD");
...
String
...
10273
...
After the user clicked on an element/a category in the chart, this function returns the Key of the member of the selected dimension dimensionKey.
...
GRAPHOMATECHART_1.getSelectedMemberText("0D_NWI_RCOD");
...
String
...
North West
...
After the user clicked on an element/a category in the chart, this function returns the text of the member of the selected dimension dimensionKey. The return value is similar to the function getSelectedMemberKey().
...
getSeparatorLength()
...
GRAPHOMATECHART_1.getSeparatorLength();
...
Integer
...
5
...
Returns the length of the Seperators in pixels.
...
getSeparatorMode()
...
GRAPHOMATECHART_1.getSeparatorMode();
...
String
...
datatypes
...
Returns the Separator Mode.
...
getSeparatorPositions()
...
GRAPHOMATECHART_1.getSeparatorPositions();
...
String
...
2,4,6
...
Returns a list of (manual) set positions of Separators as comma-separated string value.
...
getSeparatorSourceRowIndex()
...
GRAPHOMATECHART_1.getSeparatorSourceRowIndex();
...
Integer
...
3
...
Returns the index of the row/series, from which the Separators can be derived. This function is dependent on the Separator Mode (setSeperatorMode ()).
...
getSeparatorThickness()
...
GRAPHOMATECHART_1.getSeparatorThickness();
...
Integer
...
2
...
Returns the thickness of the Serators in pixels.
...
getSeries(Integer seriesIndex)
...
GRAPHOMATECHART_1.getSeries(1);
...
String
...
{"Keyfigures":"0D_NWI_NSAL"}
...
Returns the data description of the selected Data Series seriesIndex as JSON string.
...
getSeriesLabels()
...
GRAPHOMATECHART_1.getSeriesLabels();
...
String
...
Budget,Actual,Target
...
Returns the series label of the chart as comma-separated string.
...
getShowAxisLabelsLeft()
...
GRAPHOMATECHART_1.getShowAxisLabelsLeft();
...
Boolean
...
true
...
Returns whether the Axis Labels are displayed on the left.
...
getShowAxisLabelsRight()
...
GRAPHOMATECHART_1.getShowAxisLabelsRight();
...
Boolean
...
true
...
Returns whether the Axis Labels are displayed on the right.
...
getShowCategoryLabels()
...
GRAPHOMATECHART_1.getShowCategoryLabels();
...
Boolean
...
false
...
Returns whether the Category Labels are displayed.
...
getShowDatatypesInAxis()
...
GRAPHOMATECHART_1.getShowDatatypesInAxis();
...
Boolean
...
true
...
Returns whether the Data Types are displayed in the axis or in the elements.
...
getShowTitle()
...
GRAPHOMATECHART_1.getShowTitle();
...
Boolean
...
true
...
Returns whether the title is displayed.
...
getSpaceFactorBaseChart()
...
GRAPHOMATECHART_1.getSpaceFactorBaseChart();
...
Float
...
0.8
...
Returns the proportional Space Factor of the Base Chart (relative to the other Space Factors).
...
getSpaceFactorDeviationChart()
...
GRAPHOMATECHART_1.getSpaceFactorDeviationChart();
...
Float
...
0.2
...
Returns the proportional Space Factor of the deviation chart (relative to the other Space Factors).
...
getStackedBarLabelPosition()
...
GRAPHOMATECHART_1.getStackedBarLabelPosition();
...
String
...
middle
...
Returns the position of the labels in the stacked bar chart.
...
getStackedBarNegativeValues()
...
Div | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Scripting Documentation for graphomate charts for SAP Lumira DesignerRev. 2021.2 as of May 2021
IntroductionThe graphomate charts extension supports the scripting language of Designer. Therefore, it is possible to determine properties of the extension at run-time. New data can be set, titles can be adapted and scales be changed. Furthermore, it is possible to use drilldown functionalities of the extension and thus create interactive dashboards. EventsThe following events are available. User-made scripts can be deposited on the Standard Properties Sheet under the point Events.
FunctionsThe following functions are available in the graphomate charts extension. They can be addressed in the scripting editor of Designer. Guideline to umlauts, special characters and blank spacesIn general umlauts, special characters and blank spaces Umlauts are percent encoded for technical reasons in the Additional Properties Sheet (see: http://en.wikipedia.org/wiki/Percent-encoding). Example: This makes it necessary to percent encode string values even while transferring them from the scripting language or Standard Properties Sheet. (On the Internet there are many free tools for en-/decoding, for example: http://www.url-encode-decode.com/.)
refresh(string value) If the chart should unexpectedly not refresh, this command should help: It is absolutely necessary to pass the value of refreshValue() as parameter val! refreshValue() scalingHelperMode(string value)
refresh(string value) If the chart should unexpectedly not refresh, this command should help:
It is absolutely necessary to pass the value of refreshValue() as parameter val! refreshValue() scalingHelperMode(string value)
ExamplesDynamically filter a Data Source using a dropdown box In order to allow a user to dynamically filter on a dimension of a Data Source, we first have to fill a dropdown box with all valid value. Using setItem puts the list in the dropdown box.
Deleting filter of data sourceThe following command allows you to delete a filter of a Data Source:
Setting a filter on a data source by drilldown Before it is possible to make a drilldown with the graphomate charts, the following condition must be fulfilled: The property categoryLabels must be filled with data! The Category Labels therefore do not have to be visible, but can be visible. This is necessary, because the chart receives its information about dimension and members only from this property. If this condition is fulfilled, it is possible to receive the Key of the selected dimension member with the following script, which is set on the event On Element Clicked of graphomate charts:
The Key of the selected dimension must be passed as a parameter. This retrieved Memberkey can be set as a filter on a Data Source – similar to the example with the dropdown box:
or – in a combined command:
Set title after drilldownIn order to adapt the title to the drilldown – for example, to show the selected area, it is possible to read out the Membertext in the same way as Memberkey.
Realize a zoom functionIn order to implement a zoom functionality on a chart, the scaling mode must be set to Manual. This can be either preset or realized via scripting:
At first the relative value of the clicked position is determined. In the second line, this value is then used as the manual scale minimum and by doing that a zooming function is established. |
...