Skip to content

Graph Method Overview

This page provides a complete reference for all graph methods available in the reporting system. Each method is documented with syntax, parameters, and examples.

Use this decision table to select the appropriate chart type for your data and use case:

Use CaseChart TypeWhen to Use
Compare values across categoriesColumn or BarColumn for vertical (time series), Bar for horizontal (ranking)
Show trends over timeSpline or ColumnSpline for smooth curves, Column for discrete periods
Display proportions/percentagesPie or TreeMapPie for single level, TreeMap for hierarchical drill-down
Compare 3 variables (X, Y, size)BubbleWhen you need to show relationships with size dimension
Show performance/KPI with targetGaugeFor single metrics with performance zones
Compare multiple dimensionsSpiderwebFor multi-attribute profiles (5-10 categories)
Display geographic dataStreet MapWhen you have location coordinates
Mix different visualizationsCombinedWhen you need columns + lines, dual axes, etc.
Show hierarchical breakdownTreeMapFor multi-level data with drill-down capability

Quick selection guide:

  • Time series: Spline or Column
  • Ranking/Top N: Bar
  • Proportions: Pie (simple) or TreeMap (hierarchical)
  • 3D relationships: Bubble
  • KPIs: Gauge
  • Geographic: Street Map
  • Multi-metric: Combined

What it does: Initializes a new graph widget in the report. Mandatory first step for all graphs.

Required parameters: graph_id, title_label, split_element, data_filter, olap_scope

One-line example: $olap.addGraph("1", "Sales", "[month]", "", "0")

Full documentation:

The addGraph method is mandatory for creating a new graph, as it initializes the widget in the associated report.

Syntax:

$olap.addGraph(
"graph_id",
"title_label",
"split_element",
"data_filter",
"olap_scope"
)

Parameters:

ParameterDescription
graph_idA user-defined unique identifier for this Graph. The graph_id specified here must be passed as an argument to subsequent methods (e.g., addGraphAxis, addGraphData) to further configure and customize the graph.
title_labelThe text label displayed as the title of this graph.
split_elementThe column used to split the graph along the X-axis. Rows with the same value are grouped together; rows with different values produce separate visual elements (e.g., one bar per month if using [invoice_month]).
data_filterGeneral filter expression to limit which data is included for the graph. Set to NULL or "" if not required.
olap_scopeDefines which OLAP-actions affect the graph.
Valid arguments:
- 0 = Respond to all actions
- 1 = Respond only to header actions
- 2 = Respond only to report-level actions

Example:

$olap.addGraph(
"sales_trend",
"Sales Trend",
"[invoice_month]",
"[invoiced] = 1",
"0"
)

What it does: Adds a Y-axis to the graph. Supports multiple Y-axes (left and right) for different scales.

Required parameters: graph_id, axis_id, axis_label, opposite

One-line example: $olap.addGraphAxis("1", "1", "Amount", "false")

Full documentation:

Adds a Y-axis to the graph. You can add multiple Y-axes (e.g., left and right) to visualize measures with different units or scales, such as amounts and percentages.

Syntax:

$olap.addGraphAxis(
"graph_id",
"axis_id",
"axis_label",
"opposite",
"min",
"max",
"interval"
)

Required Parameters:

ParameterDescription
graph_idThe unique identifier of the graph to update.
axis_idA user-defined unique identifier for this axis. The axis_id specified here must be passed as an argument to subsequent methods to further configure and customize the axis of the graph.
axis_labelThe label displayed for this axis.
oppositeDefines which side of the graph the axis appears on.
Valid arguments:
- false (default) = left side
- true = right side

Optional Parameters:

ParameterDescription
minMinimum value of the axis. Set to NULL to calculate automatically.
maxMaximum value of the axis. Set to NULL to calculate automatically.
intervalStep size between values on the axis. Set to NULL to calculate automatically.

Example:

$olap.addGraphAxis(
"sales_trend",
"gross_margin_ratio",
"% of gross margin",
"True",
"NULL",
"NULL",
"NULL"
)

What it does: Adds data series to the graph. Multiple series can be added to the same graph.

Required parameters: graph_id, axis_id, dataseries_label, series, measure, chart_type

One-line example: $olap.addGraphData("1", "1", "-", "[product]", "sum([sales])", "column", "", "", "")

Full documentation:

Adds data to the graph. Multiple data series can be added to the same graph using this function.

Syntax:

$olap.addGraphData(
"graph_id",
"axis_id",
"dataseries_label",
"series",
"measure",
"chart_type",
"aggregation",
"filter",
"limit",
"orderby"
)

Required Parameters:

ParameterDescription
graph_idThe unique identifier of the graph to update.
axis_idThe unique identifier for this axis to update.
dataseries_labelThe label for the data series shown in the graph legend and tooltip. Use a dash (”-”) to inherit the value from the series column, or combine it with text (e.g., “Revenue: -”).
seriesThe column used to create multiple visual series (e.g., color-coded groups) within each X-axis category. Rows with different values in this column appear as different colored segments in the graph (e.g., stacked bars per product group per month).
measureThe expression to calculate for each series.
chart_typeThe chart type used for the series.
Valid arguments: column, bar, line, spline, trendline, areaspline, pie, bubble, treemap, spiderweb
aggregationDefines how the data is grouped. Set to NULL or "" if not required.
Valid arguments: stacked, aggregated
filterOptional filter expression for this series. Will be combined with any filters in the addGraph method. Set to NULL or "" if not required.

Optional Parameters:

ParameterDescription
limitLimits the number of series shown.
order_byDefines the sorting method for the series. Set to NULL or "" if not required.
Valid arguments: M, …

Example:

$olap.addGraphData(
"sales_trend",
"gross_margin_ratio",
"-",
"[product_group_description]",
"sum([gross_margin_amount])/ sum([invoiced_amount])",
"column",
"stacked",
"NULL",
"NULL",
"NULL"
)

What it does: Defines responsive width for different screen sizes using Bootstrap grid classes.

Required parameters: graph_id, xs_size, sm_size, md_size, lg_size

One-line example: $olap.setGraphSize("1", "XS12", "SM6", "MD6", "LG6")

Full documentation:

Defines the width of the graph widget for different screen sizes, using Bootstrap grid classes. This enables responsive layouts so graphs look good on mobile, tablet, and desktop devices.

Syntax:

$olap.setGraphSize(
"graph_id",
"xs_size",
"sm_size",
"md_size",
"lg_size"
)

Parameters:

ParameterDescription
graph_idThe unique identifier of the graph to update.
xs_sizeWidth of the graph on extra small screens (mobile).
Valid arguments: XS1, XS2, …, XS12
sm_sizeWidth of the graph on small screens (tablets).
Valid arguments: SM1, SM2, …, SM12
md_sizeWidth of the graph on medium screens (desktops).
Valid arguments: MD1, MD2, …, MD12
lg_sizeWidth of the graph on large screens (large desktops).
Valid arguments: LG1, LG2, …, LG12

Example:

$olap.setGraphSize(
"sales_trend",
"XS12",
"SM6",
"MD6",
"LG6"
)

What it does: Defines a custom color palette for the graph, overriding the default project color scheme.

Required parameters: graph_id, range

One-line example: $olap.setGraphColors("1", "blue:red:green:purple")

Full documentation:

Defines a custom color palette for the graph. This overrides the default project color scheme.

Syntax:

$olap.setGraphColors(
"graph_id",
"range"
)

Parameters:

ParameterDescription
graph_idThe unique identifier of the graph to update.
color_rangeA colon-separated list of HTML color codes or predefined color names. Colors are assigned in the order they are defined.
Example: blue:red:green:purple

Example:

$olap.setGraphColors(
"sales_trend",
"#E91E63: #FCE4EC: #F8BBD0: #F48FB1: #F06292"
)

What it does: Overrides the default data source, allowing the graph to retrieve data from an alternative table or view.

Required parameters: graph_id, matrix_name

One-line example: $olap.setGraphSource("1", "mssql", "fact_sales_ledger")

Full documentation:

Overrides the default data source for a graph, allowing it to retrieve data from an alternative table or view. This is useful when graph data is stored in a different dataset than the report’s main data source. Using filter and drill functionality works if the dimensions are equally named (same column names).

Syntax:

$olap.setGraphSource(
"graph_id",
"alias_key",
"matrix_name"
)

Parameters:

ParameterDescription
graph_idThe unique identifier of the graph to update.
matrix_nameThe name of the alternative data source table or view.
alias_key(Optional) The connection key for an external database if the data source is in a different database.

Example:

$olap.setGraphSource(
"sales_trend",
"mssql",
"fact_sales_ledger"
)

What it does: Defines the type and formatting of the X-axis.

Required parameters: graph_id, xaxis_type

One-line example: $olap.setGraphXAxisType("1", "Linear", "Month", "1", "12", "1")

Full documentation:

Defines the type and formatting of the X-axis.

Syntax:

$olap.setGraphXAxisType(
"graph_id",
"xaxis_type",
"xaxis_label",
"min",
"max",
"interval"
)

Required Parameters:

ParameterDescription
graph_idThe unique identifier of the graph to update.
xaxis_typeDefines the X-axis type.
Valid arguments: Category, Linear, …

Optional Parameters:

ParameterDescription
xaxis_labelTitle of the X-axis.
minMinimum value of the axis. Set to NULL to calculate automatically.
maxMaximum value of the axis. Set to NULL to calculate automatically.
intervalStep size between values on the axis. Set to NULL to calculate automatically.

Example:

$olap.setGraphXAxisType(
"sales_trend",
"Linear",
"Month",
"1",
"12",
"1"
)

What it does: Controls how zero and NULL values are displayed in a data series.

Required parameters: graph_id, axis_id, zero_mode

One-line example: $olap.setGraphDataSkipZeros("1", "1", "3")

Full documentation:

Controls how zero values are displayed in a specific data series. This helps declutter the graph or highlight only meaningful values.

Syntax:

$olap.setGraphDataSkipZeros(
"graph_id",
"axis_id",
"zero_mode"
)

Parameters:

ParameterDescription
graph_idThe unique identifier of the graph to update.
axis_idThe unique identifier for this axis to update.
zero_modeDefines how zero and NULL values are treated in the graph.
Valid arguments:
- 1 (default) = Show all values (including zeros)
- 2 = Hide zero values (but keep NULLs)
- 3 = Hide both zero and NULL values

Example:

$olap.setGraphDataSkipZeros(
"sales_trend",
"gross_margin_ratio",
"3"
)

What it does: Hides the graph legend. Useful when there are many series values.

Required parameters: graph_id

One-line example: $olap.hideGraphLegend("1")

Full documentation:

Hides the legend of the graph data (the Series values). Useful when there is a lot of different values in the Series. Using mouseover will show the series description.

Syntax:

$olap.hideGraphLegend(
"graph_id"
)

Parameters:

ParameterDescription
graph_idThe unique identifier of the graph to update.

Example:

$olap.hideGraphLegend(
"sales_trend"
)

What it does: Overrides the default height of all graphs in the report.

Required parameters: height

One-line example: $olap.setMainGraphHeight(50)

Full documentation:

Overrides the default height of all graphs in the report.

Syntax:

$olap.setMainGraphHeight(
height
)

Parameters:

ParameterDescription
heightThe height of the graph area, in percentage of the default height.
Example: Setting to 50 makes graphs half as tall, allowing for two rows of graphs on a single screen.

Example:

$olap.setMainGraphHeight(
50
)

What it does: Overrides the default width of all graphs in the report.

Required parameters: width

One-line example: $olap.setMainGraphWidth(50)

Full documentation:

Overrides the default width of all graphs in the report.

Syntax:

$olap.setMainGraphWidth(
width
)

Parameters:

ParameterDescription
widthThe width of the graph area, in percentage of the default width.
Example: Setting to 50 makes graphs half as wide, allowing for two columns of graphs on a single screen.

Example:

$olap.setMainGraphWidth(
50
)

What it does: Adds a clickable link to the graph widget that navigates to a report or internal URL.

Required parameters: graph_id, internal_url

One-line example: $olap.setGraphUrlLink("1", "x35_109")

Full documentation:

Adds a clickable link to the graph widget that navigates to a report or another internal URL when the link is clicked.

Syntax:

$olap.setGraphUrlLink(
"graph_id",
"internal_url"
)

Parameters:

ParameterDescription
graph_idThe unique identifier of the graph to update.
internal_urlThe clickable link. Part of or the full internal URL (e.g., report reference). The full internal URL in the example: http://localhost:18080/demo/ui#!x35_109

Example:

$olap.setGraphUrlLink(
"sales_trend",
"x35_109"
)

What it does: Adds advanced clickable links from graph elements to other reports or URLs with dynamic filtering.

Required parameters: graph_id, key_column, position, url, url_label, menu

One-line example: $olap.setGraphLinkScript("1","[owner_key]",1,"node=53:18;filter=[owner_key]='{0}'","-> Open report",1)

Full documentation:

There are various ways to link from a graph to another report. Contact your consultant for more information.

Syntax:

$olap.setGraphLinkScript(
"graph_id",
"key_column",
"position",
"url",
"url_label",
"menu"
)

Parameters:

ParameterDescription
graph_idThe graph to set the link.
key_columnThe field to filter on.
positionThe axis id.
urlThe last part of the url to the report you want to link.
url_labelThe link description.
menu0 = don’t show label, 1 = show label

Examples:

$olap.setGraphLinkScript("1","[owner_key]",1,"node=53:18;filter=[owner_key]='{0}'","-> Open opportunities report",1)
$olap.setGraphLinkScript("1","[owner_key]",2,"report=closedopportunity;filter=[owner_key]='{0}'","-> Closed opportunities report",1)
$olap.setGraphLinkScript("1","[owner_key]",3,"https://www.google.no/q={0}","-> Google search",1)
$olap.setGraphLinkScript('1','[account_key]',1,'document=Account;key={0};tab=opportunity','-> Account','menu(0/1)')
$olap.setGraphLinkScript("1","[cost_center_group_2]",1,"node=35:53;filter=[cost_center_group_2]='{0}'","-> Open detailed report",0)

What it does: Sets markers on graph data points.

Required parameters: GraphId, Id, Marker

One-line example: $olap.setGraphDataMarker("1", "1", "0")

Full documentation:

Sets markers on graph data points.

Syntax:

$olap.setGraphDataMarker("GraphId", "Id", "Marker")

Parameters:

ParameterDescription
GraphIdThe graph id.
IdThe axis id.
MarkerThe marker type.

Example:

$olap.setGraphDataMarker("1", "1", "0")

What it does: Sets color intervals for gauge graphs, defining performance zones.

Required parameters: GraphId, Id, Title, Color, FromValue, ToValue

One-line example: $olap.addGraphPlotBands('4', '1', 'Low','#ff0000','0','.533')

Full documentation:

Use this function when you want to set the intervals of the colors in a gauge graph.

Syntax:

$olap.addGraphPlotBands('GraphId', 'Id', 'Title','Color','FromValue','ToValue')

Parameters:

ParameterDescription
GraphIdThe graph id.
IdThe axis id.
TitleTitle for the plot band
ColorThe color in the range
FromValueRange from value (relative 0-1.0)
ToValueRange to value (relative 0-1.0)

Example:

$olap.addGraphPlotBands('4', '1', '50','#ff0000','0','.533');
$olap.addGraphPlotBands('4', '1', '150','#F9DD51','.5333','.6');
$olap.addGraphPlotBands('4', '1', '2000','#98DF58','.6','1.2');

What it does: Adds data for three-dimensional bubble charts with X, Y, and size dimensions.

Required parameters: GraphId, AxisId, DataId, Serie, Measure, Measure2, Measure3

One-line example: $olap.addGraphBubbleData("5", "1","-", "[dept]", "avg([x])", "avg([y])", "count([z])", "", "","")

Full documentation:

Three-dimensional graph method for bubble charts.

Syntax:

$olap.addGraphBubbleData("GraphId", "AxisId","DataId", "Serie", "Measure", "Measure2", "Measure3", "Filter", "Limit","OrderBy")

Parameters:

ParameterDescription
GraphIdThe graph id.
AxisIdThe axis id.
DataIdUsing a ”-” will use the value from serie. Any other value will be used as text. Can also be combined, “Product Group: - “
SerieTo split the measure, will be different colors for each split.
MeasureFirst measure (typically X-axis)
Measure2Second measure (typically Y-axis)
Measure3Third measure (typically bubble size/Z dimension)
FilterFilter data in graph.
LimitCan be used to limit. Applies to the first measure. Input e.g. “10”
OrderByOrder by measure. Applies to the first measure. Input “M”

Example:

$olap.addGraphBubbleData("5", "1","-", "[department_name]", "round(avg([career_length]),1)", "round(avg([age]),1)", "count(distinct [employee_number])", "", "","")

What it does: Adds data for street map graphs using latitude and longitude coordinates.

Required parameters: GraphId, AxisId, DataId, Serie, Latitude, Longitude, Measure

One-line example: $olap.addGraphStreetMapData("1", "1","1", "[id]", "[lat]", "[lon]", "sum([value])", "", "")

Full documentation:

Adds data for street map graphs using latitude and longitude coordinates.

Syntax:

$olap.addGraphStreetMapData("GraphId", "AxisId","DataId", "Serie", "Latitude", "Longitude", "Measure", "Filter", "Limit")

Parameters:

ParameterDescription
GraphIdThe graph id.
AxisIdThe axis id.
DataIdData identifier
SerieSeries column
LatitudeLatitude coordinate column
LongitudeLongitude coordinate column
MeasureMeasure to display
FilterFilter expression
LimitLimit number of data points

Example:

$olap.addGraphStreetMapData("graphId", "axisId","dataId", "serie", "latitude", "longitude", "measure", "filter", "limit")

What it does: Adds data for street map graphs using UTM (Universal Transverse Mercator) coordinates.

Required parameters: graphId, axisId, dataId, serie, zone, letter, east, northing, measure

One-line example: $olap.addGraphStreetMapUtmData("1", "1","1", "[id]", "'33'", "'W'", "[east]", "[north]", "sum([value])", "", "")

Full documentation:

Adds data for street map graphs using UTM (Universal Transverse Mercator) coordinates.

Syntax:

$olap.addGraphStreetMapUtmData("graphId", "axisId","dataId", "serie", "zone", "letter", "east", "northing", "measure", "filter", "limit")

Parameters:

ParameterDescription
graphIdThe graph id.
axisIdThe axis id.
dataIdData identifier
serieSeries column
zoneUTM zone number (in quotes)
letterUTM zone letter (in quotes)
eastUTM easting coordinate column
northingUTM northing coordinate column
measureMeasure to display
filterFilter expression
limitLimit number of data points

Example:

$olap.addGraphStreetMapUtmData("1", "1","1", "[running_number_ts]", "'33'", "'W'", "[customer_utm33_east]", "[customer_utm33_west]", "sum(7)", "[customer_activity_level]=0", "")

What it does: Adds data to a graph with target values (used for gauge charts).

Required parameters: graphId, axisId, dataId, serie, measure, target, chartType

One-line example: $olap.addGraphDataWithTarget("4", "1","1", "[item]", "sum([value])/sum([total])*100", "(100)", "gauge","", "", "","")

Full documentation:

Adds data to a graph with target values.

Syntax:

$olap.addGraphDataWithTarget("graphId", "axisId","dataId", "serie", "measure","target", "chartType","stacked", "filter", "limit","orderBy")

Parameters:

ParameterDescription
graphIdThe graph id.
axisIdThe axis id.
dataIdData identifier
serieSeries column
measureKPI calculation
targetTarget value in parentheses
chartTypeMust be "gauge"
stackedNot used (use "")
filterFilter expression
limitLimit number of gauges
orderBySort method

This part of the user guide is under construction.

What it does: Sets different colors for each point in the graph.

Required parameters: graphId, value

One-line example: $olap.setColorByPoint("1", "1")

Full documentation:

Sets different colors for each point in the graph.

Syntax:

$olap.setColorByPoint("graphId", "1")

This part of the user guide is under construction.

What it does: Shows the values directly on the graph data points.

Required parameters: graphId, id

One-line example: $olap.setShowGraphDataLabels('1','1')

Full documentation:

Shows the values in the graph.

Syntax:

$olap.setShowGraphDataLabels('graphId','id')

Parameters:

ParameterDescription
graphIdThe graph id.
idThe id of the axis, used when adding data to the graph.

Example:

$olap.setShowGraphDataLabels('1','1')