[visualization-api] Re: Timeline chart from JSON file
Where can I find please this specific format? I have not found any daily timeline tutorial, only Google's official. 2014. augusztus 2., szombat 2:26:00 UTC+2 időpontban Andrew Gallant a következőt írta: The DataTable constructor requires a very specific JSON format; if you aren't using that format, the constructor will throw an error and your chart will not draw. I can help you get your chart working if you share your code. I also suggest that you search this group for examples of creating charts from SQL queries (most examples here use PHP and MySQL, though you can easily substitute a different database in most cases). On Friday, August 1, 2014 4:11:30 AM UTC-4, Ákos Kovács wrote: I have created a .json file from an SQL query. (This file is without cols and rows, I do not, can be that a problem?) I tried to use this tutorial for generating a timeline graph, but it gives a blank page. https://developers.google.com/chart/interactive/docs/php_example -- 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 google-visualization-api+unsubscr...@googlegroups.com. To post to this group, send email to google-visualization-api@googlegroups.com. Visit this group at http://groups.google.com/group/google-visualization-api. For more options, visit https://groups.google.com/d/optout.
[visualization-api] Re: Official documentation on how to include multiple charts on the same page?
I am glad. -- 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 google-visualization-api+unsubscr...@googlegroups.com. To post to this group, send email to google-visualization-api@googlegroups.com. Visit this group at http://groups.google.com/group/google-visualization-api. For more options, visit https://groups.google.com/d/optout.
Re: [visualization-api] Re: Official documentation on how to include multiple charts on the same page?
Noted. I'll put it in the docs when I get a chance. Thanks for the suggestion! Jon On Fri, Aug 1, 2014 at 2:03 PM, WhoSoLovesUs d...@rvt.com wrote: Hi, ok I got it working ... thanks so much for sharing this :) Something like this would be handy to have in the Google Charts documentation somewhere, as I've seen it is a commonly asked question On Thursday, July 31, 2014 9:17:50 PM UTC-7, Andrew Gallant wrote: There are many ways to include multiple charts on the same page. The thing they all share in common are that each chart has to have a unique container div, so if I create 3 charts on a page, I might put them in 3 container divs with id's chart1, chart2, and chart3. You can separate out the code for each chart into its own function, or you can combine them all together, eg: function drawCharts () { // code to draw chart1 // code to draw chart2 // code to draw chart3 } google.load('visualization', '1', {packages: ['corechart'], callback: drawCharts}); is functionally equivalent to: function drawChart1 () { // code to draw chart1 } function drawChart2 () { // code to draw chart2 } function drawChart3 () { // code to draw chart3 } function drawCharts () { drawChart1(); drawChart2(); drawChart3(); } google.load('visualization', '1', {packages: ['corechart'], callback: drawCharts}); Is that what you are looking for? On Thursday, July 31, 2014 5:46:24 PM UTC-4, WhoSoLovesUs wrote: Hi, To someone familiar and comfortable with javascript this may seem like an easy task... But I'd like to put three charts on the same web page Is there any official documentation from Google about what to do in this case? I've looked online a fair bit; the problem is that every individual solution looks a little different to my eyes (not surprisingly) Thanks, basically I'm looking for some hand holding and explanation here :) -- 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 google-visualization-api+unsubscr...@googlegroups.com. To post to this group, send email to google-visualization-api@googlegroups.com. Visit this group at http://groups.google.com/group/google-visualization-api. For more options, visit https://groups.google.com/d/optout. -- 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 google-visualization-api+unsubscr...@googlegroups.com. To post to this group, send email to google-visualization-api@googlegroups.com. Visit this group at http://groups.google.com/group/google-visualization-api. For more options, visit https://groups.google.com/d/optout.
[visualization-api] Re: I'd like to commission someone to write a fairly basic line chart. Interested?
To fix the issue with the blank line at the end of the file, replace this line from the csvToDataTable function: rawData.push(row); with this: if (i === 0 || row.length === rawData[0].length) { rawData.push(row); } That will add the row of data only if it contains a number of elements equal to the number of elements in the header row, which ensures that you don't add any rows that are malformed due to a wrong number of elements (like having any empty row). On Friday, August 1, 2014 11:06:28 PM UTC-4, 66spl...@gmail.com wrote: One other quick question, any idea why the filename: Current - Log.csv doesnt work yet Current- Log.csv does? Another bummer of the software that makes the csv is that the filename is hard coded to Log - Current.csv Strange that 1 space works but 2 doesnt. any thoughts? On Friday, August 1, 2014 7:19:46 PM UTC-7, 66spl...@gmail.com wrote: It works!!! YESS Thank you sooo much!! I spent a couple hours on it last night and it was racking my brain. The test values worked, but my real values with different headings then Temp1 Temp2 etc wasnt working. I wasnt sure if it was the names or values or what, then the test values wouldnt work..was killing me!Turned out it was a line return at the end of the csv file! Got rid of that and bam, magical!!! So one quick question then, is there a way to accommodate for that line return? The program that is generating the csv doesnt give me the option. This is too cool, thank you thank you! On Thursday, July 31, 2014 9:05:13 PM UTC-7, Andrew Gallant wrote: Oops, sorry, my mistake. You need to add the csvToDataTable function I posted above to the javascript (just paste it in before the drawChart function). On Thursday, July 31, 2014 5:38:29 PM UTC-4, 66spl...@gmail.com wrote: There is Uncaught ReferenceError: csvToDataTable is not defined btw I set the path to the following: its in the root directory along with mychart.html url: '/current.csv' , On Thursday, July 31, 2014 5:57:50 AM UTC-7, Andrew Gallant wrote: Open the page in Chrome and open the developer's console (ctrl+shift+j). Are there any error messages? On Thursday, July 31, 2014 12:44:54 AM UTC-4, 66spl...@gmail.com wrote: Andrew, wow, thanks again, Im dying to see this working! I changed the path per your instructions but cant seem to get the page to render properly. I have it in the root dir of my web server but if I open a browser and point to that file it comes up as a white page. If I view the source I see it exactly as the page is saved, its like it didnt execute the html code just loaded the page. Does that make sense? If I point to my index.html file that works fine. Im using IIS on Windows 7 to serve the page. Anything special I need to turn on? On Monday, July 28, 2014 4:48:17 PM UTC-7, Andrew Gallant wrote: Storing the CSV file inside your web directory makes this much easier, as this allows you to use AJAX to fetch the data directly instead of writing some server-sude code to get the CSV. The jQuery library provides a handy shortcut for writing AJAX: $.ajax({ url: '/path/to/data.csv', // this is the path in your web directory, not your system directory dataType: 'text', success: function (csv) { // code to draw chart } }); I attached an HTML file that ties all of this together. On Sunday, July 27, 2014 2:01:35 PM UTC-4, 66spl...@gmail.com wrote: Wow, thank you so much Andrew. I would have never figured that parsing out... Either one of those examples to turn stuff on or off would work. The site is going to be only accessed by me so it doesnt have to be super sexy. The csv file is hosted on the machine that is running the webserver. I can store its location anywhere including the root dir of the website. Hopefully that makes it a bit easier. Thanks again for all your help on this! On Sunday, July 27, 2014 6:23:30 AM UTC-7, Andrew Gallant wrote: For turning on and off the lines, would either of these work for you? http://jsfiddle.net/asgallant/WaUu2/ http://jsfiddle.net/asgallant/6gz2Q/ If you can't change the format of the CSV, then you'll have to manually parse it, but your structure is simple enough that this shouldn't present a problem. Once it is loaded in the browser, this should suffice to transform it into a DataTable for the charts: function csvToDataTable (csv) { // split the csv on line breaks var csvRows = csv.split(/\r{0,1}\n/g); var rawData = [], row, match, year, month, day, hours, minutes, seconds; for (var i = 0; i csvRows.length; i++) { row = csvRows[i].split(','); if (i != 0) { // assumes dates are in the format MM/dd/ HH:mm:ss match = row[0].match(/(\d{2})\/(\d{2})\/(\d{4}) (\d{2}):(\d{2}):(\d{2})/); year = parseInt(match[3], 10); month =
[visualization-api] Re: Timeline chart from JSON file
This post https://groups.google.com/d/msg/google-visualization-api/2LNtd5Fe8L8/QXJHhQBvBHEJ contains a description of the JSON string. On Saturday, August 2, 2014 2:24:29 AM UTC-4, Ákos Kovács wrote: Where can I find please this specific format? I have not found any daily timeline tutorial, only Google's official. 2014. augusztus 2., szombat 2:26:00 UTC+2 időpontban Andrew Gallant a következőt írta: The DataTable constructor requires a very specific JSON format; if you aren't using that format, the constructor will throw an error and your chart will not draw. I can help you get your chart working if you share your code. I also suggest that you search this group for examples of creating charts from SQL queries (most examples here use PHP and MySQL, though you can easily substitute a different database in most cases). On Friday, August 1, 2014 4:11:30 AM UTC-4, Ákos Kovács wrote: I have created a .json file from an SQL query. (This file is without cols and rows, I do not, can be that a problem?) I tried to use this tutorial for generating a timeline graph, but it gives a blank page. https://developers.google.com/chart/interactive/docs/php_example -- 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 google-visualization-api+unsubscr...@googlegroups.com. To post to this group, send email to google-visualization-api@googlegroups.com. Visit this group at http://groups.google.com/group/google-visualization-api. For more options, visit https://groups.google.com/d/optout.
[visualization-api] Re: Visualization Playground Broken Link
It is too sad! To be honest, such tool is most useful in my daily operation. When can be fixed? Or, it will be cancelled permanently? Thanks! -- 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 google-visualization-api+unsubscr...@googlegroups.com. To post to this group, send email to google-visualization-api@googlegroups.com. Visit this group at http://groups.google.com/group/google-visualization-api. For more options, visit https://groups.google.com/d/optout.
[visualization-api] Re: Timeline chart from JSON file
Yes, I see, but how can I implement it to PHP? 2014. augusztus 2., szombat 17:14:25 UTC+2 időpontban Andrew Gallant a következőt írta: This post https://groups.google.com/d/msg/google-visualization-api/2LNtd5Fe8L8/QXJHhQBvBHEJ contains a description of the JSON string. On Saturday, August 2, 2014 2:24:29 AM UTC-4, Ákos Kovács wrote: Where can I find please this specific format? I have not found any daily timeline tutorial, only Google's official. 2014. augusztus 2., szombat 2:26:00 UTC+2 időpontban Andrew Gallant a következőt írta: The DataTable constructor requires a very specific JSON format; if you aren't using that format, the constructor will throw an error and your chart will not draw. I can help you get your chart working if you share your code. I also suggest that you search this group for examples of creating charts from SQL queries (most examples here use PHP and MySQL, though you can easily substitute a different database in most cases). On Friday, August 1, 2014 4:11:30 AM UTC-4, Ákos Kovács wrote: I have created a .json file from an SQL query. (This file is without cols and rows, I do not, can be that a problem?) I tried to use this tutorial for generating a timeline graph, but it gives a blank page. https://developers.google.com/chart/interactive/docs/php_example -- 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 google-visualization-api+unsubscr...@googlegroups.com. To post to this group, send email to google-visualization-api@googlegroups.com. Visit this group at http://groups.google.com/group/google-visualization-api. For more options, visit https://groups.google.com/d/optout.
Re: [visualization-api] Re: Visualization Playground Broken Link
Update! Thanks to Tom Rybka, we'll have a solution within a week. Jon On Sat, Aug 2, 2014 at 1:10 PM, joe...@gmail.com wrote: It is too sad! To be honest, such tool is most useful in my daily operation. When can be fixed? Or, it will be cancelled permanently? Thanks! -- 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 google-visualization-api+unsubscr...@googlegroups.com. To post to this group, send email to google-visualization-api@googlegroups.com. Visit this group at http://groups.google.com/group/google-visualization-api. For more options, visit https://groups.google.com/d/optout. -- 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 google-visualization-api+unsubscr...@googlegroups.com. To post to this group, send email to google-visualization-api@googlegroups.com. Visit this group at http://groups.google.com/group/google-visualization-api. For more options, visit https://groups.google.com/d/optout.