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.
Which chart type should I choose?
Section titled “Which chart type should I choose?”Use this decision table to select the appropriate chart type for your data and use case:
| Use Case | Chart Type | When to Use |
|---|---|---|
| Compare values across categories | Column or Bar | Column for vertical (time series), Bar for horizontal (ranking) |
| Show trends over time | Spline or Column | Spline for smooth curves, Column for discrete periods |
| Display proportions/percentages | Pie or TreeMap | Pie for single level, TreeMap for hierarchical drill-down |
| Compare 3 variables (X, Y, size) | Bubble | When you need to show relationships with size dimension |
| Show performance/KPI with target | Gauge | For single metrics with performance zones |
| Compare multiple dimensions | Spiderweb | For multi-attribute profiles (5-10 categories) |
| Display geographic data | Street Map | When you have location coordinates |
| Mix different visualizations | Combined | When you need columns + lines, dual axes, etc. |
| Show hierarchical breakdown | TreeMap | For 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
addGraph
Section titled “addGraph”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:
| Parameter | Description |
|---|---|
graph_id | A 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_label | The text label displayed as the title of this graph. |
split_element | The 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_filter | General filter expression to limit which data is included for the graph. Set to NULL or "" if not required. |
olap_scope | Defines 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")addGraphAxis
Section titled “addGraphAxis”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:
| Parameter | Description |
|---|---|
graph_id | The unique identifier of the graph to update. |
axis_id | A 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_label | The label displayed for this axis. |
opposite | Defines which side of the graph the axis appears on. Valid arguments: - false (default) = left side- true = right side |
Optional Parameters:
| Parameter | Description |
|---|---|
min | Minimum value of the axis. Set to NULL to calculate automatically. |
max | Maximum value of the axis. Set to NULL to calculate automatically. |
interval | Step 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")addGraphData
Section titled “addGraphData”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:
| Parameter | Description |
|---|---|
graph_id | The unique identifier of the graph to update. |
axis_id | The unique identifier for this axis to update. |
dataseries_label | The 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: -”). |
series | The 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). |
measure | The expression to calculate for each series. |
chart_type | The chart type used for the series. Valid arguments: column, bar, line, spline, trendline, areaspline, pie, bubble, treemap, spiderweb |
aggregation | Defines how the data is grouped. Set to NULL or "" if not required.Valid arguments: stacked, aggregated |
filter | Optional filter expression for this series. Will be combined with any filters in the addGraph method. Set to NULL or "" if not required. |
Optional Parameters:
| Parameter | Description |
|---|---|
limit | Limits the number of series shown. |
order_by | Defines 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")setGraphSize
Section titled “setGraphSize”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:
| Parameter | Description |
|---|---|
graph_id | The unique identifier of the graph to update. |
xs_size | Width of the graph on extra small screens (mobile). Valid arguments: XS1, XS2, …, XS12 |
sm_size | Width of the graph on small screens (tablets). Valid arguments: SM1, SM2, …, SM12 |
md_size | Width of the graph on medium screens (desktops). Valid arguments: MD1, MD2, …, MD12 |
lg_size | Width of the graph on large screens (large desktops). Valid arguments: LG1, LG2, …, LG12 |
Example:
$olap.setGraphSize( "sales_trend", "XS12", "SM6", "MD6", "LG6")setGraphColors
Section titled “setGraphColors”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:
| Parameter | Description |
|---|---|
graph_id | The unique identifier of the graph to update. |
color_range | A 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")setGraphSource
Section titled “setGraphSource”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:
| Parameter | Description |
|---|---|
graph_id | The unique identifier of the graph to update. |
matrix_name | The 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")setGraphXAxisType
Section titled “setGraphXAxisType”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:
| Parameter | Description |
|---|---|
graph_id | The unique identifier of the graph to update. |
xaxis_type | Defines the X-axis type. Valid arguments: Category, Linear, … |
Optional Parameters:
| Parameter | Description |
|---|---|
xaxis_label | Title of the X-axis. |
min | Minimum value of the axis. Set to NULL to calculate automatically. |
max | Maximum value of the axis. Set to NULL to calculate automatically. |
interval | Step size between values on the axis. Set to NULL to calculate automatically. |
Example:
$olap.setGraphXAxisType( "sales_trend", "Linear", "Month", "1", "12", "1")setGraphDataSkipZeros
Section titled “setGraphDataSkipZeros”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:
| Parameter | Description |
|---|---|
graph_id | The unique identifier of the graph to update. |
axis_id | The unique identifier for this axis to update. |
zero_mode | Defines 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")hideGraphLegend
Section titled “hideGraphLegend”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:
| Parameter | Description |
|---|---|
graph_id | The unique identifier of the graph to update. |
Example:
$olap.hideGraphLegend( "sales_trend")setMainGraphHeight
Section titled “setMainGraphHeight”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:
| Parameter | Description |
|---|---|
height | The 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)setMainGraphWidth
Section titled “setMainGraphWidth”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:
| Parameter | Description |
|---|---|
width | The 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)setGraphUrlLink
Section titled “setGraphUrlLink”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:
| Parameter | Description |
|---|---|
graph_id | The unique identifier of the graph to update. |
internal_url | The 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")setGraphLinkScript
Section titled “setGraphLinkScript”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:
| Parameter | Description |
|---|---|
graph_id | The graph to set the link. |
key_column | The field to filter on. |
position | The axis id. |
url | The last part of the url to the report you want to link. |
url_label | The link description. |
menu | 0 = 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)setGraphDataMarker
Section titled “setGraphDataMarker”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:
| Parameter | Description |
|---|---|
GraphId | The graph id. |
Id | The axis id. |
Marker | The marker type. |
Example:
$olap.setGraphDataMarker("1", "1", "0")addGraphPlotBands
Section titled “addGraphPlotBands”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:
| Parameter | Description |
|---|---|
GraphId | The graph id. |
Id | The axis id. |
Title | Title for the plot band |
Color | The color in the range |
FromValue | Range from value (relative 0-1.0) |
ToValue | Range 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');addGraphBubbleData
Section titled “addGraphBubbleData”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:
| Parameter | Description |
|---|---|
GraphId | The graph id. |
AxisId | The axis id. |
DataId | Using a ”-” will use the value from serie. Any other value will be used as text. Can also be combined, “Product Group: - “ |
Serie | To split the measure, will be different colors for each split. |
Measure | First measure (typically X-axis) |
Measure2 | Second measure (typically Y-axis) |
Measure3 | Third measure (typically bubble size/Z dimension) |
Filter | Filter data in graph. |
Limit | Can be used to limit. Applies to the first measure. Input e.g. “10” |
OrderBy | Order 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])", "", "","")addGraphStreetMapData
Section titled “addGraphStreetMapData”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:
| Parameter | Description |
|---|---|
GraphId | The graph id. |
AxisId | The axis id. |
DataId | Data identifier |
Serie | Series column |
Latitude | Latitude coordinate column |
Longitude | Longitude coordinate column |
Measure | Measure to display |
Filter | Filter expression |
Limit | Limit number of data points |
Example:
$olap.addGraphStreetMapData("graphId", "axisId","dataId", "serie", "latitude", "longitude", "measure", "filter", "limit")addGraphStreetMapUtmData
Section titled “addGraphStreetMapUtmData”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:
| Parameter | Description |
|---|---|
graphId | The graph id. |
axisId | The axis id. |
dataId | Data identifier |
serie | Series column |
zone | UTM zone number (in quotes) |
letter | UTM zone letter (in quotes) |
east | UTM easting coordinate column |
northing | UTM northing coordinate column |
measure | Measure to display |
filter | Filter expression |
limit | Limit 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", "")addGraphDataWithTarget
Section titled “addGraphDataWithTarget”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:
| Parameter | Description |
|---|---|
graphId | The graph id. |
axisId | The axis id. |
dataId | Data identifier |
serie | Series column |
measure | KPI calculation |
target | Target value in parentheses |
chartType | Must be "gauge" |
stacked | Not used (use "") |
filter | Filter expression |
limit | Limit number of gauges |
orderBy | Sort method |
This part of the user guide is under construction.
setColorByPoint
Section titled “setColorByPoint”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.
setShowGraphDataLabels
Section titled “setShowGraphDataLabels”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:
| Parameter | Description |
|---|---|
graphId | The graph id. |
id | The id of the axis, used when adding data to the graph. |
Example:
$olap.setShowGraphDataLabels('1','1')