ShiboBrady / flot

Automatically exported from code.google.com/p/flot
MIT License
0 stars 0 forks source link

Pie data won't display when pulling asp data from access db #646

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Problem is for the pie graph, if I change the $.plot
to categories it displays the data correctly.  However as a pie it displays as 
undefined.

here is the javascript

<script type="text/javascript">
$(function () {
<%                                      OpenDatabase()
        call startit()                              closeDatabase()

%>    

$.plot($("#placeholder2"), [ data ], {
        series: {
            pie: { 
                show: true
            }
        }
});
});
</script>

here is the asp

<%

'-----------------------------------------------------------
'Connect to the database
'-----------------------------------------------------------
Function startit()
path="/performance/db/asseta.mdb"
set conn = Server.CreateObject("ADODB.Connection")
ConnStr = "Provider=Microsoft.Jet.OLEDB.4.0;Data 
Source="&Server.MapPath(""&path&"")
'ConnStr = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source="example source"   
    'response.write("Server.MapPath="&Server.MapPath(""&path&""))
    'response.write("ConnStr="&ConnStr)
    'response.end

    conn.open ConnStr

            DIM Squery  
            DIM output

            if strData = "highGrowth" then                                  
            Squery = "SELECT * FROM highg ORDER BY ID"
            elseif strData = "balancedgrowth" then
            Squery = "SELECT * FROM balg ORDER BY ID"   
            elseif strData = "balanced" then
            Squery = "SELECT * FROM bal ORDER BY ID"        
            elseif strData = "growth" then
            Squery = "SELECT * FROM grow ORDER BY ID"   
            elseif strData = "conservative" then
            Squery = "SELECT * FROM consrv ORDER BY ID"             end if  

        Set output = Server.CreateObject("ADODB.Recordset")
                output.Open Squery, ConnStr     
Response.Write("var data = [[ ""Australian Equities"", " & output("AE") & "], ")
Response.Write("[ ""International Equities"", " & output("IE") & "], ") 
Response.Write("[ ""International Listed Property"", " & output("ILP") & "], ")
Response.Write("[ ""Australian Direct Property "", " & output("ADP") & "], ")
Response.Write("[ ""Private Equity  "", " & output("PE") & "], ")
Response.Write("[ ""Semi Liquids  "", " & output("SL") & "], ")
Response.Write("[ ""Australian Inflation Linked Bonds   "", " & output("AILB") 
& "], ")
Response.Write("[ ""International Fixed Income   "", " & output("IFI") & "], ")
Response.Write("[ ""Absolute Return Funds   "", " & output("ARF") & "], ")
Response.Write("[ ""Defensive Illiquids    "", " & output("DI") & "], ")
Response.Write("[ ""Cash    "", " & output("CSH") & "], ]") 

End Function
%>

Original issue reported on code.google.com by dkweight...@gmail.com on 2 Dec 2011 at 5:48

GoogleCodeExporter commented 8 years ago
Try posting on http://groups.google.com/group/flot-graphs

I doubt the issue is a bug in flot, more likely with how you've provided your 
data to it.

Original comment by ryl...@gmail.com on 20 Jan 2012 at 8:51

GoogleCodeExporter commented 8 years ago
yep great, you helped a lot there !
such wisdom and a great solution, awsome your excellent !

Original comment by dkweight...@gmail.com on 21 Jan 2012 at 3:37

GoogleCodeExporter commented 8 years ago
The description of the problem is unclear.  Where the data comes from is 
unrelated to Flot; can you explain what you mean by 'displays as undefined', 
and provide a simple JS-only example of cases where it does & doesn't work?

Original comment by dnsch...@gmail.com on 30 Apr 2012 at 2:29

GoogleCodeExporter commented 8 years ago
No follow-up; marking as invalid.

Original comment by dnsch...@gmail.com on 4 Jun 2012 at 2:35