Thanks my problem is now solved
On Fri, Nov 29, 2013 at 6:45 AM, asgallant <[email protected]>wrote: > Open the page in a browser, view the source code, and post the javascript > here. I need to see what your $jsonTable variable is outputting. > > > On Thursday, November 28, 2013 7:52:39 AM UTC-5, Qurat Haider wrote: > >> now i have changed the version to 1 and packages to corechart but still >> my chart is not loaded. i have used speed data type in array as float and >> Time as string and if i replaced the speed as string then error will appear >> that string is not used X-axis. i think there is some problem with data >> types. Please tell me how can i fix this problem?(i want to display Time on >> X-axis and Speed on Y-axis) >> >> >> On Thu, Nov 28, 2013 at 5:31 AM, asgallant <[email protected]>wrote: >> >>> First, change to loading version 1 instead of 1.1 (the release >>> candidate), and don't use the "columnchart" package, as it is old and >>> deprecated (and with the new version released yesterday, it might not be in >>> the API at all any more, as the dev team removed a bunch of deprecated >>> features). Load the "corechart" package instead: >>> >>> google.load('visualization', '1', {'packages':['corechart']}); >>> >>> If you still have problems, we can work through them to figure it out. >>> >>> >>> On Wednesday, November 27, 2013 7:23:20 PM UTC-5, Qurat Haider wrote: >>>> >>>> my column chart was working fine before this new release now my chart >>>> is not displayed on browser. Ctrl+Shift+j shows the syntax error on var >>>> float and JsonTable undefined >>>> >>>> $data = mysql_query("select SUM(speed) as speed, CAST( Time AS date) >>>> as Time from gps where DeviceId=$DeviceId and Time between '$from' and >>>> '$to' group by CAST(Time AS date) order by CAST( Time AS date)") >>>> or die(mysql_error()); >>>> >>>> >>>> >>>> $table = array(); >>>> $table['cols'] = array( >>>> >>>> array('label' => 'Time', 'type' => 'string'), >>>> array('label' => 'speed', 'type' => 'string') >>>> >>>> >>>> ); >>>> $rows = array(); >>>> while ($nt = mysql_fetch_array($data)) >>>> >>>> { >>>> >>>> $temp = array(); >>>> $temp[] = array('v' => (string)$nt['Time']); >>>> $temp[] = array('v' =>(string) $nt['speed']); >>>> //$temp[] = array('v' => (string)$nt['Time']); >>>> >>>> >>>> >>>> // insert the temp array into $rows >>>> $rows[]['c'] = $temp; >>>> // $rows[] = array('c' => $temp); >>>> >>>> } >>>> $table['rows'] = $rows; >>>> $jsonTable = json_encode($table); >>>> >>>> // set up header; first two prevent IE from caching queries >>>> //header('Cache-Control: no-cache, must-revalidate'); >>>> //header('Content-type: application/json'); >>>> >>>> // echo $jsonTable; >>>> } >>>> ?> >>>> >>>> google.load('visualization', '1.1', {'packages':['columnchart']}); >>>> google.setOnLoadCallback(drawChart); >>>> >>>> function drawChart() { >>>> >>>> // Create our data table out of JSON data loaded from server. >>>> var data = new google.visualization.DataTable(<?=$jsonTable?>); >>>> var options = { >>>> title: 'Speed Chart', >>>> //is3D: 'true', >>>> width: 1000, >>>> height: 500, >>>> align:'left' >>>> }; >>>> // Instantiate and draw our chart, passing in some options. >>>> // Do not forget to check your div ID >>>> var chart = new google.visualization.ColumnChart(document. >>>> getElementById('chart_div')); >>>> chart.draw(data, options); >>>> } >>>> >>> -- >>> You received this message because you are subscribed to a topic in the >>> Google Groups "Google Visualization API" group. >>> To unsubscribe from this topic, visit https://groups.google.com/d/ >>> topic/google-visualization-api/i38y8tfUy4U/unsubscribe. >>> To unsubscribe from this group and all its topics, 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/groups/opt_out. >>> >> >> -- > You received this message because you are subscribed to a topic in the > Google Groups "Google Visualization API" group. > To unsubscribe from this topic, visit > https://groups.google.com/d/topic/google-visualization-api/i38y8tfUy4U/unsubscribe > . > To unsubscribe from this group and all its topics, 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/groups/opt_out. > -- 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/groups/opt_out.
