How AnyGantt Gets Data

Overview

AnyGantt gets data from ANY sources (1), process it on ANY platform (2), creates ANY types of chart (3), and shows it in ANY client’s environment (4).

  1. You can use any data source, AnyGantt doesn't depend on any. Your data can be stored anywhere: relational or object databases (Oracle, MS SQL Server, MySQL, etc.), Excel or CSV files, or anything else you can imagine. There is no need to change them or prepare to use.
  2. Data can be retrieved and processed by any engine or platform, capable to output XML file. PHP, ASP, ASP.NET, Ruby, PERL, .NET, etc.
  3. AnyGantt configuration XML is easy to create, modify and use. Powerful styles and templates allow you to show what you want. You can configure visualization of any task bar, marker, datagrid, timeline. AnyGantt allows creating 2 generally different types of gantt charts and an endless variety of charts.
  4. AnyGantt gets data in XML format and processes it on client side, lowering server load. Flash player ubiquity allows showing your charts almost everywhere.

Data XML Settings differ depending on the chart type (Project Gantt Chart or Resources Gantt Chart), but these differences are quite insignificant, you will find description of data xml section in the beginning of each chart type tutorial.

In this tutorial we will describe the general idea of preparing data for AnyGantt Flash Gantt Charts and show an example.

to top

General Idea

AnyGantt gets only XML data to configure the charts. You can provide physical XML files or dynamically create XML data using server-side or client-side scripts to AnyGantt Component.

So, let's see how all thing work on the diagrams below:

Get XML Data Files from Server

This way of getting data works best when you have some parameters that come to the script page, that define what data should be displayed, this is most common way of using Flash Charts and it can be easily organized using any script language.

This method is shown in Your First Chart and Simple HTML Chart Tutorials.

to top

Get XML Data Files Content from Server Using Javascript

This AJAX-style method works best when you accept some user actions/values from the page and want to show new chart without reloading page. You should use AnyGantt External functions to create such page, the description of this can be found in the samples listed below.

This method is demonstrated in AJAX Sample.

to top

Get XML Data Files URLs from Server Using Javascript

This Javascript method works almost the same way as previous one, but you get set XML Data URL instead of setting all XML as String. You should use AnyGantt External functions to create such page, the description of this can be found in the samples listed below.

This method is shown in Set XML As File sample.

to top

XML Sample Described

In this section we will demonstrate how table data should be converted into AnyGantt XML, for more information on data section please see certain chart type tutorial.

Let's see Project Gantt Chart created using the following data - the periods of some tasks' completing:

id name actual_start actual_end
1 Task 1 2008.07.10 2008.07.15
2 Task 2 2008.07.10 2008.07.13
3 Task 3 2008.07.11 2008.07.12
4 Task 4 2008.07.08 2008.07.15
5 Task 5 2008.07.15 2008.07.22

This table can be returned from database by some simple query, like:
SELECT task_id, task_name, task_start, task_end FROM tbl_orders GROUP BY task_id

Now we need to convert this data table into XML, this format will be accepted by AnyChart. In terms of AnyChart data model we have one series of data (Sales) with categories that hold managers names. Each point in series represents one manager and his/her sales. Converted XML Data looks like:

<project_chart>
  
<tasks>
    
<task id="1" name="Task 1" actual_start="2008.07.10" actual_end="2008.07.15" />
    
<task id="2" name="Task 2" actual_start="2008.07.10" actual_end="2008.07.13" />
    
<task id="3" name="Task 3" actual_start="2008.07.11" actual_end="2008.07.12" />
    
<task id="4" name="Task 4" actual_start="2008.07.08" actual_end="2008.07.15" />
    
<task id="5" name="Task 5" actual_start="2008.07.15" actual_end="2008.07.22" />
  
</tasks>
</project_chart>

As you can see, we have specified our gannt chart type - Project Gantt Chart - <project_chart>, created a node that will holds all of tasks - <tasks> and have adjusted every single task using <task> node.

You can organize such conversion using any script/programming language, iterating through the results of the query and formatting the output string.

Here it is - AnyGantt can now visualize your data. Look at the chart sample below and click on XML button if you want to see full configured XML.

Getting-Using-Data Gantt Chart - Click to see Live Chart Preview
Getting-Using-Data Gantt Chart - Click to see Live Chart Preview

to top