CSVParser

Type class

A parser for CSV format.

Sources

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

// CSVParser is available in all of the following modules.
// You only need to import one of them.

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

// CSVParser is available in all of the following modules.
// You only need to import one of them.

/**
 * --------------------------------------------------------
 * Include via: <script src="core.js"></script>
 * Access items like: am4core.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

)

#

Returns string

Tries to determine a column separator.

isCSV(

data: string

)

#

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.