PHP is an option for this. On Friday, January 31, 2014 3:45:55 PM UTC-5, Ashok Kumar wrote: > > So do i need to use PHP for processing a query on CSV file. > > On Friday, 31 January 2014 20:49:48 UTC+1, asgallant wrote: >> >> Yes, it is possible, but you have to write server-side code that parses >> the query string and your CSV file, and outputs the appropriate data. >> >> On Friday, January 31, 2014 2:10:43 PM UTC-5, Ashok Kumar wrote: >>> >>> Hi, >>> >>> I have placed my CSV file inside IIS server. >>> >>> Is it possible to achieve the query functionality in this setup. >>> >>> Regards, >>> Ashok >>> >>> On Friday, 31 January 2014 19:35:01 UTC+1, asgallant wrote: >>>> >>>> The Query's #setQuery function appends the query to the URL string - it >>>> is up to your server to parse the query string and return the appropriate >>>> data. A static CSV file is not capable of doing this. >>>> >>>> On Friday, January 31, 2014 9:09:00 AM UTC-5, Ashok Kumar wrote: >>>>> >>>>> Hi, >>>>> >>>>> I am not able to filter and display the gauge chart based on my query. >>>>> Also the gauge chart is always displayed for the entire CSV data and not >>>>> based on my query.Find below the code that i used. >>>>> >>>>> <!DOCTYPE html> >>>>> <html> >>>>> <head> >>>>> <title>Google Chart Example</title> >>>>> <script src="https://www.google.com/jsapi"></script> >>>>> <script src="http://code.jquery.com/jquery-1.10.1.min.js"></script> >>>>> <script src="http://localhost/jquery.csv-0.71.js"></script> >>>>> <script type="text/javascript"> >>>>> google.load("visualization", "1", {packages:["gauge"]}); >>>>> </script> >>>>> <script> >>>>> function drawChart() >>>>> { >>>>> //$.get("http://localhost/output.csv",function(csvString) >>>>> //{ >>>>> var queryOptions = >>>>> { >>>>> //csvColumns: >>>>> ['string','string','string','date','string','number','number','number','string','string','string','number','string','string','string','string','string'], >>>>> //csvColumns: >>>>> ['string','string','string','string','string','string','string','string','string','string','string','string','string','string','string','string','string'] >>>>> csvColumns: ['string','number'], >>>>> csvHasHeader: true >>>>> } >>>>> //csvUrl= 'http://localhost/output.csv'; >>>>> csvUrl= 'http://localhost/temperatures.csv'; >>>>> var query = new google.visualization.Query(csvUrl,queryOptions); >>>>> //var query = new google.visualization.Query(' >>>>> http://spreadsheets.google.com/tq?key=pCQbetd-CptGXxxQIG7VFIQ&range=B1:D11&pub=1' >>>>> ); >>>>> //var arrayData = $.csv.toArrays(csvString, {onParseValue: >>>>> $.csv.hooks.castToScalar}); >>>>> query.setQuery('select B,C where C > 6'); >>>>> query.send(handleQueryResponse); >>>>> function handleQueryResponse(response) >>>>> { >>>>> if (response.isError()) >>>>> { >>>>> alert('Error in query: ' + response.getMessage() + ' ' + >>>>> response.getDetailedMessage()); >>>>> return; >>>>> } >>>>> var data = response.getDataTable(); >>>>> //alert(data[1,1]); >>>>> //var dataView1 = new google.visualization.DataView(data); >>>>> //dataView1.setColumns([1]); >>>>> var chart = new >>>>> google.visualization.Gauge(document.getElementById('chart')); >>>>> chart.draw(data,{width: 400, height: 250,redFrom: 18, redTo: >>>>> 20,yellowFrom:15, yellowTo: 17,minorTicks: 5,min: 1,max: >>>>> 20,animation:{duration: 400,easing: 'linear'}}); >>>>> } >>>>> } >>>>> google.setOnLoadCallback(drawChart); >>>>> </script> >>>>> </head> >>>>> <body> >>>>> <div id="chart"> >>>>> </div> >>>>> </body> >>>>> </html> >>>>> >>>>> This is my CSV Data. >>>>> >>>>> Label,License_Utilized,validation >>>>> License,10,5 >>>>> License1,18,7 >>>>> >>>>> Thanks, >>>>> Ashok >>>>> >>>>> >>>>> >>>>> >>>>> >>>>>
-- 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.
