inlined responses:
On Monday, March 24, 2014 2:17:51 PM UTC-4, cyb wrote:
>
> What did you mean with functions ? Are these client side parser-functions
> for csv data ?
>
Within the code for Google charts, there exists code to parse CSV, but it's
not currently exported and visible to users yet. As such, it's there you
just can't access it yet.
>
> But google charts can at the moment not parse csv data directly on the
> client side ?
>
Correct, not yet. I'll file a bug to expose these functions to users for
future releases. (Again, this will not be in the v38 release that's going
out any day now, expect it in v39.)
>
> On Server-Side is use Spring MVC.. On my Website someone can upload a csv
> as a MultiPart Upload to my server or directly to my website.
>
> on the Server-Side there is a Rest-Service that gets the Multipart csv
> file:
>
> @RequestMapping(value="/upload", method=RequestMethod.POST)
> @ResponseStatus(value=HttpStatus.NO_CONTENT)
> public @ResponseBody String
> handleFileUpload(@RequestParam(value="name", required=false) String name,
> @RequestParam(value="file1") MultipartFile file){
>
> //Reads the CSV File
> InputStream inputStream = file.getInputStream();
> BufferedReader bufferedReader = new BufferedReader(new
> InputStreamReader(inputStream));
>
> }
>
> Is it now possible that i can convert the PartFile with the csv to a
> DataTable ?
>
> On the Client Side i have the same csv part file.. i can read it with a
> FileReader();
>
Okay, you have a couple of options, all of which require client side, or
server side code that you need to write.
1. You can have your data export the user data in the DataSourceFormat
(https://developers.google.com/chart/interactive/docs/dev/implementing_data_source).
This would require you parse the data server side, either when the user
uploads it, or when the user downloads it for display. With this format,
GViz can directly display the data.
(Basically, GViz will connect directly to your server, download the
data, and display it in the div.)
Again, you'd need to parse the data server side, and have it sent back
to your client side JS in the above format.
2. Your second option is to parse the data client side, and generate a
data table there. That's what you're currently doing, but your JS parser
doesn't work on mobile devices. Right now, as GViz doesn't export its CSV
parser, you could: write your own parser (probably not too hard to get
simple cases right), find a different parser
(https://code.google.com/p/csv-to-array/ seems to be one to try), or wait
for the next gviz release.
>
> Best regards
>
> Am Montag, 24. März 2014 18:47:44 UTC+1 schrieb Jeremy Faller:
>>
>> We have functions to do this, but they're not exported. I'll file a bug
>> to export them for the next release (not v38, which is due out any day now).
>>
>> In the meantime, if you can implement a change server side, you can have
>> your data conform to the DataSource protocol (
>> https://developers.google.com/chart/interactive/docs/dev/implementing_data_source),
>>
>> and Google Charts will handle csv very well.
>>
>> On Monday, March 24, 2014 12:39:44 PM UTC-4, cyb wrote:
>>>
>>> Hi,
>>>
>>> i get different data from a csv or json file. and this files must pe
>>> parsed that i can use it with google charts..
>>>
>>> so what is the best way to do this ?
>>>
>>> First the CSV:
>>>
>>> i get different CSV files they look like this:
>>>
>>> date,New York,San Francisco,Austin
>>> 20111001,63.4,62.7,72.2
>>> 20111002,58.0,59.9,67.7
>>> 20111003,53.3,59.1,69.4
>>> 20111004,70.0,80.0,90.0
>>>
>>>
>>>
>>> i have used the following javascript library to convert my csv to an
>>> Array that can google charts understand:
>>> https://code.google.com/p/jquery-csv/
>>>
>>> but the problem is, this library did not work on mobile devices, i have
>>> tested it on an ipad.
>>> So what is the easiest an best solution for parsing a csv to the google
>>> format ? the solution must run on mobile devices.
>>>
>>> Or are there any Frameworks that i can use on server side (java) to
>>> convert a csv to a json object that google understands !? Then i can send
>>> the json file to my website that google charts can read it !
>>>
>>> Best regards cyb
>>>
>>>
--
You received this message because you are subscribed to the Google Groups
"Google Visualization API" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/google-visualization-api.
For more options, visit https://groups.google.com/d/optout.