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:
- Highcharts.Dictionary.<Highcharts.DataDateFormatObject>
Methods
-
complete()
-
If a complete callback function is provided in the options, interpret the columns into a Highcharts options object.
The function requires that the context has the
valueCount
property set. -
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 theseries.keys
option.Returns:
Array.<Array.<DataValueType>> | undefined .Data rows
Example
const data = Highcharts.data({ csv: document.getElementById('data').innerHTML }).getData();
-
parseCSV()
-
Parse a CSV input string
-
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
-
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.
-
parsed()
-
A hook for working directly on the parsed columns
-
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 The new data options.
redraw
boolean <optional>
true Whether to redraw the chart after the new options are set.
-
<static> rowsToColumns()
-
Reorganize rows into columns.