csv

[ root » graph » csv ]

Allows you to either import data from an external CSV file (and a few other similar file types) or import data using a data string within the JSON code.

AttributeTypeInfo

columns

Array

In case of fixed width column format of the CSV data, specifies the dimensions for each column. Some csv files are formatted based on the idea of "fixed sized columns", not by the standard comma or semicolon "separator". So, the columns array holds the number of characters for each column so that the parser will be able to split each line in the correct way

[...]

data-string dataString

String

Demo

Sets the CSV data directly embedded in the JSON, as a string. However new-line characters are not allowed in the definition of an attribute in json syntax, and therefore the row separator character will likely need also be overridden with the "row-separator" attribute if "data-string" is used in place of "url".

"Apple,25,34\r\nPear,-16,10\r\nLemon,22,-5\r\nOrange,41,21" | ...

horizontal-labels horizontalLabels

Boolean

Demo

Specifies if the CSV data contains descriptive headers for each column as the first or second row (depending on title presence).

true | false | 1 | 0

mirrored

Boolean

Demo

Specifies if the CSV data should be processed in a mirrored way (per line instead of per column). Note the different format used for the data-string.

true | false | 1 | 0

row-separator rowSeparator

String

Demo

Sets the separator between the data rows when using a data-string instead of an external .CSV file. The default value is "\r\n".

"_" | "&" | "\r\n" | ...

separate-scales separateScales

Boolean

Demo

Specifies whether or not each column in the csv data should have its own scale on the chart.

true | false | 1 | 0

separator

String

Demo

Sets the separator between the data cells, default is ",". Any single character can be used as a separator.

"*" | "/" | "," | ...

smart-scales smartScales

Boolean

Demo

Smart-Scales will analyze the CSV data to determine if each column of data is of a different enough type of data to deserve a separate scale. If it is, smart-scales will assign the unique data columns to separate scales.

true | false | 1 | 0

title

Boolean

Demo

Specifies if the CSV data contains a descriptive title on the first line. If this attribute it not included, then the library looks at the data to decide if the first line is intended to be a title or not. If it thinks it is, The first line will become the title of the graph. If there is a title line in the CSV and "title":"true" is set, the first line will be the graph title, but if "title":"false" is specified, that first line will become a scale-label.

true | false | 1 | 0

url

String

Demo

Sets the url for the CSV data source.

"http://www.domain.com/link.php" | "%FILEPATH%/fruit.csv" | "/resources/datacsv.txt" | ...

vertical-labels verticalLabels

Boolean

Demo

Specifies if the CSV data contains descriptive headers for each row.

true | false | 1 | 0