Inter-connected charts - Click on any pie slice to see detailed chart below
<%
Dim oRs, strQuery
'strXML will be used to store the entire XML document generated
'Generate the chart element
strXML = ""
'Create the recordset to retrieve data
Set oRs = Server.CreateObject("ADODB.Recordset")
' Fetch all factory records
strQuery = "select fm.FactoryId, fm.FactoryName, sum(fo.Quantity) as TotOutput from Factory_Master fm, Factory_Output fo where fm.FactoryId=fo.FactoryID group by fm.FactoryId, fm.FactoryName"
Set oRs = oConn.Execute(strQuery)
'Iterate through each factory
If Not oRs Is Nothing Then
While Not oRs.Eof
'Generate
'Note that we're setting link as updateChart(factoryIndex) - JS Function
strXML = strXML & ""
'free the resultset
oRs.MoveNext
Wend
End If
'Finally, close element
strXML = strXML & ""
'Create the chart - Pie 3D Chart with data from strXML
Call renderChart("../../FusionCharts/Pie3D.swf", "", strXML, "FactorySum", 500, 250, false, false)
%>
The charts in this page have been dynamically generated using data contained in a database.
The detailed charts along with the dynamic data are received using AJAX.