Hide a column

23 views
Skip to first unread message

Ray Thomas

unread,
Apr 20, 2017, 10:44:30 AM4/20/17
to Google Visualization API
I have run into a problem only showing certain columns from the data in a table. A have data in 5 columns, when it displays I do not want column 5 (index 4) to display. There's several methods I tried: 

setColumns([0, 1, 2, 3]);
removeColumn(4);
setView({'columns': [0, 1, 2, 3]}); 
view: {'columns': [0,1,2,3],}  (in options)

None of these seem to work, the last column still continues to be displayed. 

I have probably missed something really basic, but can someone help?

The code can be seen at https://jsfiddle.net/brisray/26rb8zwq/ and the live code is at http://hmsgambia.org/crewlist.htm

Ray

Daniel LaLiberte

unread,
Apr 20, 2017, 10:57:44 AM4/20/17
to Google Visualization API
How you use any of those methods makes all the difference.  It works for me to specify the 'view' property in the ChartWrapper settings, but this only works in the top-level properties, not in the options.

   var chart = new google.visualization.ChartWrapper({
     chartType: 'Table',
     containerId: 'crew_table_div',
     view: { columns: [0, 1, 2, 3] },
     options: { ...}
  });


--
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+unsub...@googlegroups.com.
To post to this group, send email to google-visualization-api@googlegroups.com.
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/5e5c20b2-2b91-4b24-b752-9e4ec5ea0d6a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--

Ray Thomas

unread,
Apr 20, 2017, 4:14:17 PM4/20/17
to Google Visualization API
Thank you again Daniel.

I'm already using the visualizations on my employer's website. Luckily for me they require very little user interaction and the data is well formatted. Using it on my hobby site is a way of checking I properly understand what's going on should they require user interaction and/or data manipulation.

Ray
Reply all
Reply to author
Forward
0 new messages