Hi Jason, It sounds like you might want to make a separate query for this second part of your data, to display in a separate PieChart. A single Dashboard can only process a single data table as input, and you *can* use the view option to specify that a PieChart should only use particular columns, but then the entire table with all rows should be correctly formatted. And then you have to also specify appropriate view options for your other charts.
To debug your Dashboard, to see what data is being sent to each chart, you could use a Table chart instead of any other chart. Be sure to include the 'table' package in your load() call. The view option for ChartWrapper is documented under the ChartDraw function, which takes the same arguments: https://developers.google.com/chart/interactive/docs/reference#google.visualization.drawchart On Fri, Feb 5, 2016 at 12:38 PM, Jason <[email protected]> wrote: > Okay so I can not seem to find the literature on the VIEW aspect/option. > Can I use it for tableCharts? Can I use it to distinguish between two > separate tables in a spreadsheet in the same dataset? Or must I have two > separate datasets/queries in the same dashboard? How would I accomplish > such a thing? > > I saw the example for 'view' in the pieChart part of the Dashboard > documentation, but could not find the corresponding write up with more > details on 'view'. I have my table properly functioning, in JSFiddle and > the source spreadsheet, but added another table to the source spreadsheet > that I would like to use specifically for a pieChart on the same Dashboard. > I tried expanding my queryString to include the additional columns (N,O) > then changed my &range=A1:F25 to A1:O25, to accommodate the new table > further in the spreadsheet. Adding in the 'view': {'columns': []} to the > table and piechart to account each using a specific column range. None of > that worked. > *note* The new table in my source Google Spreadsheet is generated by a > QUERY(), if that changes anything. > > My original code, that works, is as follows (the pieChart doesn't display > the information I want but pops up, whenever I add the 'view' clause it > doesn't show up at all): > > <script type="text/javascript" src="https://www.google.com/jsapi > "></script> > > <div id='dashboard_div'> > <div id='chart_div'></div> > <p></p> > <div id='table_div'></div> > <div id='control_div'></div> > </div> > > google.load('visualization', '1.0', > {'packages': ['table', 'controls']}); > > google.setOnLoadCallback(queryData); > > function queryData() > { > var queryString = encodeURIComponent('SELECT A,B,C,D,E,F'); > var gidInfoRange = '/gviz/tq?gid=2013544456&headers=1&range=A1:F25&tq='; > var query = new google.visualization.Query( > 'personalLink' + gidInfoRange + queryString); > > query.send(handleQueryResponse); > > }; > > function handleQueryResponse(response) > { > if (response.isError()) > { > alert('Error in query: ' + response.getMessage() + ' ' + > response.getDetailedMessage()); > return; > } > > var data = response.getDataTable(); > > var dashboard = new google.visualization.Dashboard( > document.getElementById('dashboard_div')); > > var tableCategoryFilter = new google.visualization.ControlWrapper({ > 'controlType': 'CategoryFilter', > 'containerId': 'control_div', > 'options': { > 'filterColumnIndex': 0 > } > }); > //Define Table from spreadsheet data > var tableChart = new google.visualization.ChartWrapper({ > 'chartType': 'Table', > 'containerId': 'table_div' > }); > > //Define first chart (material bar Chart) > var pieChart = new google.visualization.ChartWrapper({ > 'chartType': 'PieChart', > 'containerId': 'chart_div', > 'options': { > 'width': 300, > 'height': 300, > 'pieSliceText': 'value' > } > > > }); > > dashboard.bind([tableCategoryFilter],[tableChart]); > dashboard.draw(data); > }; > > > -- > 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 > https://groups.google.com/group/google-visualization-api. > To view this discussion on the web visit > https://groups.google.com/d/msgid/google-visualization-api/47763d87-e814-4aff-82ef-f51ee7bb484d%40googlegroups.com > <https://groups.google.com/d/msgid/google-visualization-api/47763d87-e814-4aff-82ef-f51ee7bb484d%40googlegroups.com?utm_medium=email&utm_source=footer> > . > For more options, visit https://groups.google.com/d/optout. > -- Daniel LaLiberte <https://plus.google.com/100631381223468223275?prsrc=2> [email protected] <[email protected]> 5CC, Cambridge MA -- 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 https://groups.google.com/group/google-visualization-api. To view this discussion on the web visit https://groups.google.com/d/msgid/google-visualization-api/CAOtcSJOWYLQyJ6dbQybv3x6H_dCAP-UACBSi42oXX8zKqGe5Rw%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
