OK, so it looks like you'll mainly need to modify your Graph.aspx.cs file.
Here are the things you'll need to change:

   1. Line 41: This is the part that tells it which package(s) to load. You
   need to load the "orgchart" package, as per the documentation
   <https://developers.google.com/chart/interactive/docs/gallery/orgchart>
   page I linked to in my last post. Change "corechart" to "orgchart" to load
   the orgchart package instead of the corechart package.
   2. Line 46: These are the headers of your columns. Effectively, these
   are just the titles. I don't know if you're planning on using tooltips, but
   you'd have either two or three columns here. Look at the Data Format
   
<https://developers.google.com/chart/interactive/docs/gallery/orgchart#Data_Format>
   section of the documentation for that. Play around with the jsfiddle
   example linked from the documentation page to help you decide.
   3. Lines 50-51: This is where you're reading the actual data from the
   SQL response. You'll need to replace "Month", "Bolivia", etc. with whatever
   your column names are. *Make sure to only have as many items here as you
   have headers*. Otherwise, you'll get an error. Pay special attention to
   the quotes (the single ones—"[*'*"), since those will be surrounding
   your strings in the generated JavaScript, and if they're not there or are
   unmatched, that will cause errors. Note that there are no single quotes are
   row["Bolivia"]. This is because in this example, that datum is a
number. *You
   will need to put quotes there, since OrgChart only takes strings*. So,
   for example, "[*'*" + row["Month"] + "*'*,*'*" + row["Bolivia"] + "*'*,
   *'*" + ...
   4. Line 56: Most of the pie chart options don't apply to the org chart.
   You would clear this object and put your options (i.e. collapsible: true)
   here. Make sure to close all the braces.
   5. Line 57: Instead of "ComboChart", you will need to write "OrgChart",
   since you want to construct an OrgChart, and not a ComboChart.

All of that should get you started. I hope you have enough coding knowledge
to not miss quotes and close all the braces, since computers are very picky
about that.

In my opinion, this code is poorly structured. Your chart logic should be
in a JavaScript file, instead of being generated by an ASPX file. The ASPX
file should only return JSON, which should be fetched by a query. You could
also insert the JSON directly into the file, though I would personally
discourage that.

On Fri Nov 14 2014 at 3:17:44 PM Edward Sokolove <[email protected]>
wrote:

> Here are the code files that I got to work with their examples for a graph
> but as you know I'd like it changed slightly to output to an orgchart.
> Thanks for all of your help.
>
> On Fri, Nov 14, 2014 at 10:32 AM, Edward Sokolove <[email protected]>
> wrote:
>
>> I'm really trying to find an example of how to connect a SQL Server DB to
>> populate the orgChart.  I've looked and have not found a good working
>> example.  I found a really good one for a pie chart but not exactly sure
>> how to convert it to an orgchart.  Any help would be greatly appreciated.
>>
>> On Monday, November 10, 2014 7:47:43 AM UTC-7, Edward Sokolove wrote:
>>>
>>> I wanted to know how I would integrate a recordset from a sql server
>>> database?  I'm creating an org chart.  Also, how do I set options like
>>> collapsible =true?
>>>
>>  --
>> 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/7R83Swnufm0/unsubscribe
>> .
>> To unsubscribe from this group and all its topics, send an email to
>> [email protected].
>>
>
>> To post to this group, send email to
>> [email protected].
>> Visit this group at
>> http://groups.google.com/group/google-visualization-api.
>> For more options, visit https://groups.google.com/d/optout.
>>
>  --
> 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 [email protected].
> To post to this group, send email to
> [email protected].
> Visit this group at
> http://groups.google.com/group/google-visualization-api.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/google-visualization-api.
For more options, visit https://groups.google.com/d/optout.

Reply via email to