Corda.com

 

Comma Separated Values Data

< BACK TO DATA SOURCES

Corda Server can import data from comma separated values (CSV) files. This is a common format that can be viewed and edited in many spreadsheet programs. Comma separated value files are files where each data value is separated by a comma, and each row of data is placed on a new line.

For example, there are example comma separated value files in the examples/data folder of the Corda Server document root directory. You could import the file data1.csv into a graph using the Corda Embedder loadData() command, as shown below:

myImage.loadData("graph","examples/data/data1.csv");

Or, you could import data from the example uspop.csv file using the Corda Embedder loadMapData() command, as shown below:

myImage.loadMapData("US","Areas","examples/data/uspop.csv");

CSV data can also be imported from URLs, meaning that you can have a web application generate your CSV data on the fly. For example:

myImage.loadData("graph","http://myserver.com/getdata?mon=Jan");

To see example code that imports data from CSV files, view your web environment below:

Web Environment Application Code Examples
ASP PopChart Dynamic Graphs
ASP.NET PopChart Dynamic Graphs
ColdFusion PopChart Dynamic Graphs
JSP PopChart Dynamic Graphs
JSP Tag Library PopChart Dynamic Graphs
Java Servlet PopChart Dynamic Graphs
JavaScript PopChart Dynamic Graphs
Perl PopChart Dynamic Graphs
PHP PopChart Dynamic Graphs

For more information on importing comma separated values data, refer to Chapter 5 of the PopChart and OptiMap Web Development manual.