RadianSmile / jquery-csv

Automatically exported from code.google.com/p/jquery-csv
MIT License
0 stars 0 forks source link

Generate Motion chart #46

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1.create a csv file with 4 columns
2.first column with string values
3.2-4 columns with numbers 

What is the expected output? What do you see instead?
i expect to see a graph but i see a blank box instead

What version of the product are you using? On what operating system?
version 0.7 beta on windows 7 os

Please provide any additional information below.
nil

Original issue reported on code.google.com by monrach...@gmail.com on 8 Feb 2015 at 5:23

Attachments:

GoogleCodeExporter commented 8 years ago
By default, jquery-csv does not apply implicit casting. In short, the data 
inputted to the parser is a string so the result will be strings.

There are 2 reasons for this. First, CSV is a text-based format so it's faster 
to skip any implicit casting. Second, applying implicit casting by default 
makes the assumption that the output format should be scalar; when that is not 
desired it creates unexpected side-effects.

If you need the parser to apply implicit casting there is a parser hook called 
castToScalar() that will accomplish what you require.

The following snippet is copied directly from the Google Visualization API's 
example code.
   var parsedData = $.csv.toArrays(csv, {
        onParseValue: $.csv.hooks.castToScalar
    });

Note: In the 'options' argument, create an object literal with a property named 
onParseValue, and set the property's value to $.csv.hooks.castToScalar.

Original comment by evanpla...@gmail.com on 15 Feb 2015 at 4:59