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 will serve as a connector between Pivot Table and Highcharts. Read more about integration with Highcharts in this tutorial.

Parameters

    Name Type Description
    options Object Object which describes options for data pre-processing. It has the following parameters:
  • type
  • String optional Specify 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
  • Object optional Define 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
  • String optional Choose a type of data on the X-axis. If you set this property to "datetime", a chart with dates on the X-axis will be created. The default value is an empty string.
  • valuesOnly
  • Boolean optional If you need the axis to be based only on numerical values, set this property to true. The default value is 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
  • Boolean optional 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
  • Function optional 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.
    callbackHandler Function This 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 Function optional 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.

Name Return value Description
getAxisFormat(format) String Use 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) Function Use 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) Function Use 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 in the example on Codepen.
getPointZFormat(format) Function Use 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.