Google Org Chart issue

90 views
Skip to first unread message

TheInnovator

unread,
Jan 24, 2014, 8:06:16 AM1/24/14
to google-visua...@googlegroups.com
I am trying to implement a Google Org chart and add the position as you see here
https://developers.google.com/chart/interactive/docs/gallery/orgchart#Data_Format
(Mike 'President' and Jim 'Vice President')

When I try the same I get the following
http://isaac.issharepoint.com/examples/WebPartPages/BuildOrgChart.aspx

Here's a snippet of my code:
I am using it in a SharePoint page
$(xData.responseXML).SPFilterNode('z:row').each(function() {													
					//OrgName=$(this).attr("ows_OrgName");	
					name = "{v:"+$(this).attr("ows_Name")+", f:<font color='red'>test</font>},'',''";

					//alert("name: "+name);
					ReportTo = $(this).attr("ows_Title");
					//ReportTo = $(this).attr("ows_ReportToOrg");
					
					ToolTip = $(this).attr("ows_ToolTip");	
						
					data.addRow([name, ReportTo, ToolTip]);
				});
				}	

Thanks for any help you can provide	

Sergey Grabkovsky

unread,
Jan 24, 2014, 9:42:21 AM1/24/14
to google-visua...@googlegroups.com
You are quoting the entire object. Your code should look more like this:
$(xData.responseXML).SPFilterNode('z:row').each(function({
  //OrgName=$(this).attr("ows_OrgName");  
  var name {
    v$(this).attr("ows_Name"),

    f"<font color='red'>test</font>"
  };

  //alert("name: "+name);
  ReportTo $(this).attr("ows_Title");
  //ReportTo = $(this).attr("ows_ReportToOrg");

  ToolTip $(this).attr("ows_ToolTip");

  data.addRow([nameReportToToolTip]);
});

- Sergey


--
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-visualizati...@googlegroups.com.
To post to this group, send email to google-visua...@googlegroups.com.
Visit this group at http://groups.google.com/group/google-visualization-api.
For more options, visit https://groups.google.com/groups/opt_out.

Isaac Sogunro

unread,
Jan 24, 2014, 10:11:13 AM1/24/14
to google-visua...@googlegroups.com
That fixed the error but now the "Name" does not show.


--
You received this message because you are subscribed to a topic in the Google Groups "Google Visualization API" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-visualization-api/RxjMv-_F0Yc/unsubscribe.
To unsubscribe from this group and all its topics, send an email to google-visualizati...@googlegroups.com.

To post to this group, send email to google-visua...@googlegroups.com.
Visit this group at http://groups.google.com/group/google-visualization-api.
For more options, visit https://groups.google.com/groups/opt_out.



--
-Isaac-

http://twitter.com/#!/feedy0urmind
You are today where your thoughts have brought you; you will be tomorrow where your thoughts take you.
- James Allen

asgallant

unread,
Jan 24, 2014, 10:56:39 AM1/24/14
to google-visua...@googlegroups.com
Setting the formatted value (the "f" parameter) overrides the default value, so you have to include whatever you want displayed in the formatted value, eg:

$(xData.responseXML).SPFilterNode('z:row').each(function() {
    //OrgName=$(this).attr("ows_OrgName");
    var name = {
        v: $(this).attr("ows_Name"),
        f: "<font color='red'>" + $(this).attr("ows_Name") + "</font>"
    };

    //alert("name: "+name);
    ReportTo = $(this).attr("ows_Title");
    //ReportTo = $(this).attr("ows_ReportToOrg");

    ToolTip = $(this).attr("ows_ToolTip");

    data.addRow([name, ReportTo, ToolTip]);
});​



- Sergey


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-visua...@googlegroups.com.
Visit this group at http://groups.google.com/group/google-visualization-api.
For more options, visit https://groups.google.com/groups/opt_out.

--
You received this message because you are subscribed to a topic in the Google Groups "Google Visualization API" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-visualization-api/RxjMv-_F0Yc/unsubscribe.
To unsubscribe from this group and all its topics, send an email to google-visualization-api+unsub...@googlegroups.com.

To post to this group, send email to google-visua...@googlegroups.com.
Visit this group at http://groups.google.com/group/google-visualization-api.
For more options, visit https://groups.google.com/groups/opt_out.

Isaac Sogunro

unread,
Jan 24, 2014, 11:26:34 AM1/24/14
to google-visua...@googlegroups.com
The (f:parameter) shows but the (v:parameter) does not.

Here's the list I'm reading from and as you will see the "ReportTo" shows up but not the Name.

I changed it to "ReportTo" to make more sense.


To unsubscribe from this group and all its topics, send an email to google-visualizati...@googlegroups.com.

To post to this group, send email to google-visua...@googlegroups.com.
Visit this group at http://groups.google.com/group/google-visualization-api.
For more options, visit https://groups.google.com/groups/opt_out.

asgallant

unread,
Jan 24, 2014, 12:19:48 PM1/24/14
to google-visua...@googlegroups.com
Yes, that is correct.  The "f" parameter is for specifying the formatted value of the cell (it specifies what gets displayed to the user).  If you set "f", then "v" will not be displayed - you have to set "f" to whatever you want the user to see.

- Sergey


To unsubscribe from this group and stop receiving emails from it, send an email to google-visualization-api+unsubscr...@googlegroups.com.

To post to this group, send email to google-visua...@googlegroups.com.

--
You received this message because you are subscribed to a topic in the Google Groups "Google Visualization API" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-visualization-api/RxjMv-_F0Yc/unsubscribe.
To unsubscribe from this group and all its topics, send an email to google-visualization-api+unsubscr...@googlegroups.com.
To post to this group, send email to google-visua...@googlegroups.com.



--
-Isaac-

http://twitter.com/#!/feedy0urmind
You are today where your thoughts have brought you; you will be tomorrow where your thoughts take you.
- James Allen

--
You received this message because you are subscribed to a topic in the Google Groups "Google Visualization API" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-visualization-api/RxjMv-_F0Yc/unsubscribe.
To unsubscribe from this group and all its topics, send an email to google-visualization-api+unsub...@googlegroups.com.
To post to this group, send email to google-visua...@googlegroups.com.
Visit this group at http://groups.google.com/group/google-visualization-api.
For more options, visit https://groups.google.com/groups/opt_out.

Isaac Sogunro

unread,
Jan 24, 2014, 1:09:11 PM1/24/14
to google-visua...@googlegroups.com
Ahhh....I see now.  That makes a lot of sense.
Got it working now.

Thanks!


To unsubscribe from this group and all its topics, send an email to google-visualizati...@googlegroups.com.

To post to this group, send email to google-visua...@googlegroups.com.
Visit this group at http://groups.google.com/group/google-visualization-api.
For more options, visit https://groups.google.com/groups/opt_out.
Reply all
Reply to author
Forward
0 new messages