Class: Data

Highcharts. Data

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

The Data class

参数:
名字 类型 特质 详情
dataOptions Highcharts.DataOptions
chartOptions Highcharts.Options <可选>
chart Highcharts.Chart <可选>
依赖:
  • module:modules/data

依赖

  • module:modules/data

成员

dateFormats :Highcharts.Dictionary.<Highcharts.DataDateFormatObject>

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

Type:

方法

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

返回值:
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.

返回值:
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.

参数:
名字 类型 详情
column Array.<Highcharts.DataValueType>

Column to parse

col number

Column index

parseCSV( [inOptions])

Parse a CSV input string

参数:
名字 类型 特质 详情
inOptions Highcharts.DataOptions <可选>
返回值:

parsed()

A hook for working directly on the parsed columns

返回值:

parseDate(val)

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

参数:
名字 类型 详情
val string
返回值:

parseGoogleSpreadsheet()

Parse a Google spreadsheet.

返回值:
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.

rowsToColumns(rows)

Reorganize rows into columns.

参数:
名字 类型 详情
rows Array.<Array.<Highcharts.DataValueType>>
返回值:

trim(str [, inside])

Trim a string from whitespaces.

参数:
名字 类型 特质 默认值 详情
str string

String to trim

inside boolean <可选>
false

Remove all spaces between numbers.

返回值:
string .

Trimed string

update(options [, redraw])

Updates the chart with new data options.

参数:
名字 类型 特质 默认值 详情
options Highcharts.DataOptions
redraw boolean <可选>
true