We have updated WebDataRocks EULA, effective as of April 18, 2024. Learn more about what's changed.
Documentation menu

highcharts.getData

highcharts.getData(options:Object, callbackHandler:Function, updateHandler:Function)

This method is used for integration with Highcharts. It is responsible for requesting the data from the pivot table and pre-processing it to the appropriate format for the specified chart’s type. Before the start of integrating, include the webdatarocks.highcharts.js library in your web project. It serves as a connector between Pivot Table and Highcharts. Read more about integration with Highcharts in this tutorial.

Parameters

NameTypeDescription
optionsObjectDescribes options for data pre-processing. It has the following parameters:
  • type
Stringoptional Specifies the chart type to prepare the data for: "area", "areaspline", "bar",
"column", "waterfall", "funnel", "pie", "arearange", "areasplinerange", "columnrange", "errorbar", "bubble", "scatter", "polygon", "spline". The default value is "line".
  • slice
ObjectoptionalDefines the slice of data for pre-processing for the specified chart. Otherwise, the API call will send the data displayed in the pivot table.
  • xAxisType
StringoptionalSpecifies a type of data on the X-axis. If set to "datetime", a chart with dates on the X-axis is created. Default value: "".
  • valuesOnly
BooleanoptionalIf you need the axis to be based only on numerical values, set this property to true. Default value: false. It is possible to apply valuesOnly for the following chart types: "bubble", "line", "polygon" and "spline". Note that it is always true for "scatter" chart.
  • withDrilldown
Booleanoptional If the chart is supposed to have drilldowns, set it to true. The default value is false. It is available only for such chart types as "area", "areaspline", "bar", "column", "waterfall", "funnel", "pie", "pyramid", "polygon", "spline", "line".
  • prepareDataFunction
Functionoptional An external function. Use it if webdatarocks.highcharts.js does not support the specified chart type or you need to pre-process the data in another way. This function takes raw (non-aggregated) data from the table as rawData parameter and an object with options defined in highcharts.getData() as options parameter. Read a more detailed getData() API call documentation to learn about rawData‘s structure.
callbackHandlerFunctionThis function specifies what happens after the data is ready. It has the following parameters: data and rawData (rawData is an optional argument, define it if you need to set a number formatting in the tooltip or on the axes, etc).
updateHandler Functionoptional This function is triggered when the data in the pivot table is updated, sorted or filtered. It has the following parameters: data and rawData.

Use the following functions from the Connector if you need to define a special number formatting for axes or tooltips in Highcharts. Pass a pivot table format object as an argument and each of them will return the formatting string in Highcharts format. These functions can be used in the body of callbackHandler and updateHandler functions.

NameReturn valueDescription
getAxisFormat(format)StringUse this function if you want to apply a formatting from the pivot table to the values on the axis. It gets the pivot table format object defined inside WebDataRocks and returns a Highcharts format string for value.
getPointXFormat(format) FunctionUse this function if you want to apply a formatting from the pivot table to point.x. It gets the pivot table format object defined inside WebDataRocks and returns a Highcharts format string for point.x.
getPointYFormat(format) FunctionUse this function if you want to apply a formatting from the pivot table to point.y. It gets the format object defined inside WebDataRocks and returns a Highcharts format string for point.y. Try the example on Codepen.
getPointZFormat(format) FunctionUse this function if you want to apply a formatting from the pivot table to point.z. It gets the pivot table format object defined inside WebDataRocks and returns a Highcharts format string for point.z.

To learn how to integrate WebDataRocks reporting tool with Highcharts, follow the link to the tutorial.