Hi I would like to allow user to upload a csv file and let him/her select x-axis y-axis from the columns of csv file and then plot a graph.
Is this possible by using dhtmlxChart. If yes can anyone please share a working demo.
Thanks in advance!
You can call load() or parse() method several times. Here is a small sample:
var data = "
var dataNew = "
Thanks Alexandra. I’m a newbie to dhtmlx. I just wanted to use the dhtmlxchart feature.
This is how my csv file looks. The column being the column title and their corresponding values.
Id mo_gr mo_igg btech_va ctech_v_igg t_pnp t_prt pnpprt_r
1 A 0.2 0.26 0.34 2 2 1 (50 columns like this)
Is this right??
But I want to take the values(column titles ) dynamically as selected by the user to plot the graph.
Sorry again I’m a complete newbie to DHTMLX .
There ready data “csv” driver does not consider header. It parses all rows as data records.
You can write own data driver based on existent dhtmlx.DataDriver.csv (please see debug version of dataview library to see its definition).
Or you can use dhtmlx.ajax to load data and convert loaded text into json object:
var driver = dhtmlx.DataDriver.csv;
var rows = driver.getRecords(driver.toObject(text,xml));
// your code here (call parse(jsonArray) method)