Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 925419
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T19:31:03+00:00 2026-05-15T19:31:03+00:00

I would like to create an organisational chart as shown here: http://code.google.com/apis/visualization/documentation/gallery/orgchart.html I can

  • 0

I would like to create an organisational chart as shown here:
http://code.google.com/apis/visualization/documentation/gallery/orgchart.html

I can create the JSON google.visualization.DataTable string using the .NET Visualization helper library from here:
http://code.google.com/p/bortosky-google-visualization/

Unfortunately with this helper library it is not possible to display a custom format message like President or Vice President for each organisational chart member as the f: key is not generated by the helper library.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T19:31:03+00:00Added an answer on May 15, 2026 at 7:31 pm

    I was able to solve this question by writing a method that creates the organisational chart JSON from a C# DataTable:

    public string GoogleOrgChartJson(DataTable dt)
            {
                if ((dt == null) || (dt.Columns.Count == 0)) return "";
                var sb = new StringBuilder();
                sb.Append("{cols: [");
                foreach (DataColumn dc in dt.Columns.Cast<DataColumn>().Where(dc => dc.Caption != "Format"))
                {
                    sb.Append("{id: '");
                    sb.Append(dc.Caption);
                    sb.Append("', label: '");
                    sb.Append(dc.Caption);
                    sb.Append("', type: '");
                    sb.Append(dc.DataType.Name.ToLower());
                    sb.Append("'}, ");
                }
                sb.Remove(sb.Length - 2, 2);
                sb.Append("], rows: [");
                foreach (DataRow dr in dt.Rows)
                {
                    sb.Append("{c: [");
                    for (int i = 0; i < dt.Columns.Count; i++)
                    {
                        if (dt.Columns[i].ToString() == "Format")
                        {
                            sb.Remove(sb.Length - 3, 3);
                            sb.Append(", f: '");
                        }
                        else
                            sb.Append("{v: '");
    
                        if ((dr[i] != DBNull.Value) && (string)dr[i] != "")
                            sb.Append(dr[i] + "'}, ");
                        else
                            sb.Append("'}, ");
    
                    }
                    sb.Remove(sb.Length - 2, 2);
                    sb.Append("]}, ");
                }
                sb.Remove(sb.Length - 2, 2);
                sb.Append("]};");
                return sb.ToString();
            }
    

    As you see from the code above we need to have a DataTable with a column called Format in order to generate the f key in the JSON.
    Please find below an example of a C# DataTable and the call to create the JSON for the google chart API:

    var dt = new DataTable();
    dt.Columns.Add("Name", typeof (String)).Caption = "Name";
    dt.Columns.Add("Format", typeof (String)).Caption = "Format";
    dt.Columns.Add("Manager", typeof (String)).Caption = "Manager";
    dt.Rows.Add("Mathias Florin","Mathias Florin<div style=color:red; font-style:italic><p style=font-size:0.7em>Technical Leader</p></div>","Christian Florin");
    dt.Rows.Add("Christian Florin","Christian Florin<div style=color:red; font-style:italic><p style=font-size:0.7em>CEO</p></div>","Christian Florin");
    Page.ClientScript.RegisterStartupScript(GetType(), "vis", string.Format("var fundata = {0}", GoogleOrgChartJson(dt)), true);
    

    Additional columns can be added after the Manager column and can be accessed in JavaScript in the select event of the google chart api.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 514k
  • Answers 514k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer You already thought about multiple solutions. You could also stream… May 16, 2026 at 6:17 pm
  • Editorial Team
    Editorial Team added an answer Here's an alternative approach. str = "ABCDE" (0...str.length).collect { |i|… May 16, 2026 at 6:17 pm
  • Editorial Team
    Editorial Team added an answer 22/03/2014 - Update: Got rid of my overly excited post… May 16, 2026 at 6:17 pm

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Related Questions

I would like to create class diagram from existing source code using rational rose.
I would like to create a game in wireframe mode however without the glPolygoneMode
I would like to create a link that pass a parameter, so I don't
I would like to create a button that records date and time in the
I would like to create a listbox, with a details pop-up/tooltip kind of window.
I would like to create a new unix command to automatically list the contents
I would like to create compositions of workflows in WF (3.5). Is it possible
I would like to create a kind of master report, with 2 sections. The
I'm working on a project and I would like to be able to place
I'd like to create a folder under a package in Eclipse... The purpose of

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.