Org Charts Connection Lines

532 views
Skip to first unread message

John Huang

unread,
Aug 29, 2013, 12:03:40 AM8/29/13
to google-visua...@googlegroups.com
Hi All,

I am new to Google Visualization API. I am using Org Charts right now. I would like to make the connection lines (lines connect parent/son nodes) shorter. How can I do it?

Many Thanks if you can help!

Best,
John

asgallant

unread,
Aug 29, 2013, 12:22:20 AM8/29/13
to google-visua...@googlegroups.com
Do you want to make them shorter vertically or horizontally?

asgallant

unread,
Aug 29, 2013, 11:54:13 AM8/29/13
to google-visua...@googlegroups.com
To make the connection lines vertically shorter, apply styles to the class "google-visualization-orgchart-connrow-medium" (replace "medium with "small" or "large" if you set the "size" option to something other than "medium"), setting the height and font-size of that class:

.google-visualization-orgchart-connrow-medium {
height: 0px;
font-size: 2px;
}

The height of the row will always be large enough to accommodate the specified font-size, plus the margins/padding.  The margins and padding are set by the selector ".google-visualization-orgchart-table *", so you can either change them at that level, or the row/td level as necessary.

To make them horizontally shorter, your only option is to decrease the width of the chart, which you can do by setting the width of the container div in CSS.

John Huang

unread,
Aug 29, 2013, 9:05:45 PM8/29/13
to google-visua...@googlegroups.com
Dear Asgallant,

Thank you!

I tried, But the connection lines between nodes doesn't change any thing. Is there any documentation that I can follow? Thanks!

Best,
John

All the best,
John (Junwei) Huang


--
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/dUP1sYUnEjE/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.

asgallant

unread,
Aug 29, 2013, 10:45:14 PM8/29/13
to google-visua...@googlegroups.com
It's not documented - this is a hack to get around the preset values.

It looks like just using the class results in the OrgChart's css declarations taking precedence, so try using this for the selector: "tr.google-visualization-orgchart-connrow-medium" - the arcane rules of CSS say the more factors you have in the selector, the higher its precedence, so when CSS that should work, isn't working, try adding more factors to the selector.  Ugh.
To unsubscribe from this group and all its topics, send an email to google-visualization-api+unsub...@googlegroups.com.

John Huang

unread,
Aug 29, 2013, 10:50:47 PM8/29/13
to google-visua...@googlegroups.com
Hello Asgallant,

It doesn't work either. But thank you so much for your quick reply.

What do you mean the factors? How do I get those information? (how can I add more factors to the selector? sorry that I am very new to this area).

Best,
John

asgallant

unread,
Aug 29, 2013, 11:04:47 PM8/29/13
to google-visua...@googlegroups.com
That example should be working.  Compare with: http://jsfiddle.net/asgallant/UNehg/1/ and http://jsfiddle.net/asgallant/UNehg/2/

John Huang

unread,
Aug 29, 2013, 11:31:55 PM8/29/13
to google-visua...@googlegroups.com
Hello Asgallant,
I see. It doesn't work either. But I know what's the problem. I run this code on TWiki platform, which doesn't support a lot of things. So thank you! I won't try anything about it. Thank you!
Best,
John
Reply all
Reply to author
Forward
0 new messages