Note that there are some explanatory texts on larger screens.

plurals
  1. POHow the google charts query language works?
    primarykey
    data
    text
    <p>I have implemented my own datasource in Go, which returns a JSON string. The data source is working fine and returning the correct JSON format expected by the chart (which is actually a table object to make the tests easier).</p> <p>Now, I'd like to be able to use the query language features for my chart and something I could not figure out is how exactly the query language works. Let's take the table below as example:</p> <pre><code>Name | Age | Phone ------------------------------- John | 23 | 12341234 Chris | 47 | 54223452 Sam | 36 | 69694356 </code></pre> <p>When called, my datasource will return a JSON representation of the entire table above. In theory, I should be able to do something like this from my Javascript</p> <p>query.setQuery('select Name, Age'); </p> <p>So, the result would ignore the column "Phone".</p> <p>Now, my question is:</p> <p>Is the setQuery() method applied to the JSON response only, or my datasource should be able to handle the query on request and return the correct data (only Name and Age columns). I'm not sure if the query language will act on the JSON response or if it's just an interface to tell the server what to do and the server should be able to prepare the correct data.</p> <p>I'm asking that because as I said, my JSON response works fine, however the setQuery() method is being ignored. My table always shows the entire Dataset, no matter what I put on the setQuery method. Even if I define a column which does not exist, it does not cause any error. I did some tests using a google spreadsheet and it works just fine. I should add that the structure of the JSON response from my app and the one from the google spreadsheet looks exactly the same. Any help would be very much appreciated.</p> <p>Thanks,</p> <p>JB</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload