CSVParser

Type class

A parser for CSV format.

Sources

CSVParser can be used (imported) via one of the following packages.

/**
 * --------------------------------------------------------
 * Import from: "core.ts"
 * Use like: am4core.CSVParser
 * --------------------------------------------------------
 */
import * as am4core from "@amcharts/amcharts4/core";

/**
 * --------------------------------------------------------
 * Include via: <script src="core.js"></script>
 * Access items like: am4.CSVParser
 * --------------------------------------------------------
 */

Inheritance

CSVParser extends DataParser.

CSVParser is not extended by any other symbol.

Properties

contentType
#

Type string

Default "text/csv"

Content-type suitable for CSV format.

Methods

CSVToArray(

data: string,
delimiter: string

)

#

Returns any[]

Converts CSV into array.

The functionality of this function is taken from here:

http://www.bennadel.com/blog/1504-ask-ben-parsing-csv-strings-with-javascript-exec-regular-expression-command.htm

getDelimiterFromData(

data: string

)

#

Static

Returns string

Tries to determine a column separator.

isCSV(

data: string

)

#

Static

Returns boolean

Tests if the format is CSV.

parse(

csv: string

)

#

Returns any[]

Parses and returns data.

Events

CSVParser does not have any events.

Adapters

CSVParser does not have any adapters.