change border and color of google org chart

490 views
Skip to first unread message

Akshay Suthar

unread,
Nov 5, 2017, 11:17:51 AM11/5/17
to Google Visualization API
Hi

I Used google org chart in my asp.net family tree application, But I want to change font of every node and i want that border(line) should be thick then normal...Any Body have Idea about this....Please help me...

BACSWebMaster

unread,
Jun 24, 2020, 2:52:55 AM6/24/20
to Google Visualization API
Hi
You define css as in this example:
.mynode {
  width:120px;
  padding:50px;
  border: 1px solid black;
  font-size: 20px !important;
}

When you draw a chart, use this line:

        // Create the chart.
        var chart = new google.visualization.OrgChart(document.getElementById('chart_div'));
        // Draw the chart, setting the allowHtml option to true for the tooltips.
        chart.draw(data, {'allowHtml':true, 'allowCollapse':true, 'nodeClass': 'mynode'} );

You will lose most of the default css using this method.

BACSWebMaster

unread,
Jun 24, 2020, 2:58:23 AM6/24/20
to Google Visualization API
Just wanted to clarify that the padding works only with !important. So far margin does not work even with important. Hope that helps.


On Monday, November 6, 2017 at 3:17:51 AM UTC+11, Akshay Suthar wrote:
Reply all
Reply to author
Forward
0 new messages