Class: Data

Highcharts. Data

new Data(dataOptions [, chartOptions] [, chart])

The Data class

Parameters:
Name Type Argument Description
dataOptions Highcharts.DataOptions
chartOptions Highcharts.Options <optional>
chart Highcharts.Chart <optional>
Requires:
  • module:modules/data

Requires

  • module:modules/data

Members

dateFormats :Highcharts.Dictionary.<Highcharts.DataDateFormatObject>

A collection of available date formats, extendable from the outside to support custom date formats.

Type:

Methods

<static> rowsToColumns()

Reorganize rows into columns.

complete()

If a complete callback function is provided in the options, interpret the columns into a Highcharts options object.

fetchLiveData()

Fetch or refetch live data

Returns:
boolean .

The URLs that were tried can be found in the options

getColumnDistribution()

Get the column distribution. For example, a line series takes a single column for Y values. A range series takes two columns for low and high values respectively, and an OHLC series takes four columns.

getData()

Get the parsed data in a form that we can apply directly to the series.data config. Array positions can be mapped using the series.keys option.

Returns:
Array.<Array.<(number|string)>> | undefined .

Data rows

Example
const data = Highcharts.data({
  csv: document.getElementById('data').innerHTML
}).getData();

parseColumn(column, col)

Parse a single column. Set properties like .isDatetime and .isNumeric.

Parameters:
Name Type Description
column Array.<Highcharts.DataValueType>

Column to parse

col number

Column index

parseCSV()

Parse a CSV input string

parsed()

A hook for working directly on the parsed columns

parseDate()

Parse a date and return it as a number. Overridable through options.parseDate.

parseGoogleSpreadsheet()

Parse a Google spreadsheet.

Returns:
boolean .

Always returns false, because it is an intermediate fetch.

parseTable()

Parse a HTML table

parseTypes()

Parse numeric cells in to number types and date types in to true dates.

trim(str [, inside])

Trim a string from whitespaces.

Parameters:
Name Type Argument Default Description
str string

String to trim

inside boolean <optional>
false

Remove all spaces between numbers.

Returns:
string .

Trimed string

update(options [, redraw])

Updates the chart with new data options.

Parameters:
Name Type Argument Default Description
options Highcharts.DataOptions
redraw boolean <optional>
true