how to hide column data

555 views
Skip to first unread message

Nate

unread,
Aug 1, 2011, 11:32:35 PM8/1/11
to Google Chart API
I am trying to create an embedded vertical bar chart (not created
through a http://chart.apis.google.com/chart?... URL) with hidden
columns using chd. For example: "chd: 't1:...'".

After failing to get this working, I found the chart wizard and tried
to generate the script automatically (http://code.google.com/apis/
chart/image/docs/chart_wizard.html). The URLs generated work great
for hidden and non-hidden data. However, pasting the generated html
(from the "embed with visualization API" button) does not work; the
hidden and non-hidden code displays the same in a variety of browsers
(safari, IE, firefox) even thought the chd parameter is different in
each. Does anyone know the proper way to hide data? Thanks.

duniyadnd

unread,
Aug 3, 2011, 4:41:25 PM8/3/11
to google-c...@googlegroups.com
Can you provide an example? I'm a little unclear about what you are asking. Thanks

Nate

unread,
Aug 3, 2011, 5:18:33 PM8/3/11
to Google Chart API
Hi,

1. Go to http://code.google.com/apis/chart/image/docs/chart_wizard.html
and click on the vertical bar chart (top right corner with the green
vertical bars).
2. Expand the "data" bar. You will find 2 data sets inside, data set
1 and data set 2. Have encoding set to "text" by clicking that
button.
3. Notice that the "&chd=t..." field is highlighted indicating that
that is the data field. Notice that chd=t: changes to chd=t1: when
either of the "visible" boxes are checked. The chart on the wizard
page also changes.
4. When pasted, the URL created shows a chart exactly like the one
shown on the wizard page whether or not the data is "visible". e.g.
if both sets are visible, both sets of columns appear. If one set of
data is visible, only that set appears.
5. Now, when you click on "embed with visualization API", you get
full html to load the chart using javascript. Save an html page (just
copy and paste the entire contents) with both sets set to "visible"
and another html page with only one set to "visible". You will notice
that the "chd" parameter changes as expected, but the pages' charts
show up identically in the browser. The expected result is two
different charts like the pasted URL gives you.

Let me know if this makes sense.

Thank you.
Reply all
Reply to author
Forward
0 new messages