Graphs in ASP? ASP newb here

Discussion in 'ASP General' started by Jose M Hernandez, Jan 6, 2006.

  1. Does anybody know of techniques (or websites) where a graph is generated
    based on data of an array?

    Any advice on graphs and ASP is greatly appreciated...
    Jose M Hernandez, Jan 6, 2006
    #1
    1. Advertising

  2. www.aspin.com search
    plenty of stuff there


    "Jose M Hernandez" <Jose M > wrote in
    message news:...
    > Does anybody know of techniques (or websites) where a graph is generated
    > based on data of an array?
    >
    > Any advice on graphs and ASP is greatly appreciated...
    >
    Kyle Peterson, Jan 6, 2006
    #2
    1. Advertising

  3. Jose M Hernandez

    Evertjan. Guest

    =?Utf-8?B?Sm9zZSBNIEhlcm5hbmRleg==?= wrote on 06 jan 2006 in
    microsoft.public.inetserver.asp.general:

    > Does anybody know of techniques (or websites) where a graph is generated
    > based on data of an array?
    >
    > Any advice on graphs and ASP is greatly appreciated...


    Any:

    <hr style="height:10px;width:<%=x(1)%>px;text-align:left;color:red;">
    <hr style="height:10px;width:<%=x(2)%>px;text-align:left;color:navy;">
    <hr style="height:10px;width:<%=x(3)%>px;text-align:left;color:green;">


    --
    Evertjan.
    The Netherlands.
    (Please change the x'es to dots in my emailaddress)
    Evertjan., Jan 6, 2006
    #3
  4. Jose M Hernandez

    Slim Guest

    "Jose M Hernandez" <Jose M > wrote in
    message news:...
    > Does anybody know of techniques (or websites) where a graph is generated
    > based on data of an array?
    >
    > Any advice on graphs and ASP is greatly appreciated...
    >


    yes I made a scripting component to make charts, it works on a record set
    being passed to it and has some percific code to my needs in it, but you
    could alter it to use a array for your own needs

    here is a example
    http://wanews.org/economic/unemployment.asp

    copy code into notepad

    save as chart.wsc

    then call like this
    set chart = Server.CreateObject("chart.WSC")
    chart.chartLine("Australian Interest
    Rates","InterestRates",300,200,rs1("minx"),rs1("maxx"),rs2,0,7,"%","right","")


    and here is the code

    <?xml version="1.0"?>
    <component>

    <registration
    description="Chart"
    progid="Chart.WSC"
    version="1.00"
    classid="{bf770420-5a73-4e1b-b5ce-f4f8a5448ee5}"
    >

    </registration>

    <public>
    <method name="chartLine">
    <PARAMETER name="heada"/>
    <PARAMETER name="table"/>
    <PARAMETER name="widthx"/>
    <PARAMETER name="heightx"/>
    <PARAMETER name="rangeLow"/>
    <PARAMETER name="rangeHigh"/>
    <PARAMETER name="recordSet"/>
    <PARAMETER name="xCol"/>
    <PARAMETER name="dCol"/>
    <PARAMETER name="symbol"/>
    <PARAMETER name="alignent"/>
    </method>
    </public>

    <implements type="ASP" id="ASP"/>

    <script language="VBScript">
    <![CDATA[


    function
    chartLine(heada,table,widthx,heightx,rangeLow,rangeHigh,recordSet,xCol,dCol,symbol,alignent,bgColor)

    Session.LCID = 3081


    set bttt = server.CreateObject("MSWC.BrowserType")

    dim ratio, rCount ,points ,counta ,leftx ,lefty ,spacex ,range ,line1
    ,line2 ,line3 ,test ,datex,color,ditString,datString
    test = true
    color = "Blue"
    line1 = ""
    line2 = ""
    line3 = ""
    counta = 0
    leftx = 50
    lefty = 50
    dateWhitlam = "December 2, 1972"
    dateFraser = "november 11, 1975"
    dateHawk = "march 11, 1983"
    dateHoward = "march 2, 1996"

    rCount = recordSet.RecordCount
    points = rCount / (widthx/25)
    spacex = widthx / rCount
    range = rangeHigh-rangeLow
    ratio = heightx / range
    line1 = "<TABLE style=""margin:5"" BORDER=0 CELLSPACING=0 CELLPADDING=5
    align=" & alignent & " height=" & heightx + 40 & " width=" & widthx + 80 & "
    bgcolor=" & bgColor & ">"
    line1 = line1 & "<TR><TD><SPAN
    style=""font-family:arial;font-weight:900"">" & heada & "</SPAN><DIV
    STYLE=""position:relative;height:" & heightx +85 & ";margin-top:20"">"
    do until recordSet.EOF
    'response.write recordSet(xCol)
    if DateValue( recordSet(xCol)) > DateValue(dateWhitlam) then
    if DateValue( recordSet(xCol)) > DateValue(dateFraser) then
    if DateValue( recordSet(xCol)) > DateValue(dateHawk) then
    if DateValue( recordSet(xCol)) > DateValue(dateHoward) then
    color = "Blue"
    else
    color = "Red"
    end if
    else
    color = "Blue"
    end if
    else
    color = "Red"
    end if
    end if
    line22 = "<v:line strokecolor=""" & color & """ from=""" & leftx & "," &
    heightx - ((recordSet(dCol) - rangeLow) * ratio) & """"
    if bttt.browser = "IE" AND bttt.version => 6 then
    line33 = "<DIV
    style=""font-size:10;writing-mode:tb-rl;position:absolute;top:" & heightx +
    20 & ";left:" & leftx-5 & """>" & getAUSDate(recordSet(xCol)) & "</DIV>"
    else
    line33 = "<DIV
    style=""font-size:9;writing-mode:tb-rl;position:absolute;top:" & heightx +
    20 & ";left:" & leftx-5 & """>" & Year(recordSet(xCol)) & "</DIV>"
    end if
    recordSet.MoveNext
    if not recordSet.EOF then
    line22 = line22 & " to=""" & leftx + spacex & "," & heightx -
    ((recordSet(dCol) - rangeLow) * ratio) & """ TITLE="""& recordSet(dCol)
    &"""></v:line>"
    else
    line22 = ""
    line3 = line3 & line33
    end if
    line2 = line2 & line22
    leftx = leftx + spacex
    if counta => pointsx and pointsx < (rCount - (points / 2)) then
    pointsx = pointsx + points
    if bttt.browser = "IE" AND bttt.version => 6 then
    line3 = line3 & "<DIV
    style=""font-size:10;writing-mode:tb-rl;position:absolute;top:" & heightx +
    20 & ";left:" & leftx-5 & """>" & getAUSDate(recordSet(xCol)) & "</DIV>"
    else
    datString = Year( recordSet(xCol))


    line3 = line3 & "<DIV
    style=""font-size:9;writing-mode:tb-rl;position:absolute;top:" & heightx +
    20 & ";left:" & leftx-5 & """>" & datString & "</DIV>"
    datString = ""
    end if
    end if


    counta = counta + 1
    loop
    line3 = line3 & "<DIV style=""font-size:12;position:relative;top:-5"">" &
    FormatNumber( rangeHigh,2) & symbol & "</DIV><v:line strokecolor=""black""
    from=""" & lefty+10 & "," & -15 & """ to=""" & lefty + widthx & "," & -15 &
    """></v:line>"
    line3 = line3 & "<DIV style=""font-size:12;position:relative;top:" &
    heightx/2-25 & """>" & FormatNumber(((rangeHigh-rangeLow)/2)+rangeLow,2) &
    symbol & "</DIV><v:line strokecolor=""black"" from=""" & lefty+10 & "," &
    heightx/2-32 & """ to=""" & lefty + widthx & "," & heightx/2-32 &
    """></v:line>"
    line3 = line3 & "<DIV style=""font-size:12;position:relative;top:" &
    heightx-50 & """>" & FormatNumber( rangeLow,2) & symbol & "</DIV><v:line
    strokecolor=""black"" from=""" & lefty & "," & heightx - 45 & """ to=""" &
    lefty + widthx & "," & heightx - 45 & """></v:line>"
    line3 = line3 & "</DIV><A HREF=""/pub/economic/xl/data.asp?tab=" & table &
    """>Chart Data</A></TD></TR></TABLE>"
    line = line1 & line2 & line3
    chartLine = line

    end function


    function getAUSDate(dDate)
    dim d,m,y
    d = Day(dDate)
    m = Month(dDate)
    y = Year(dDate)
    getAUSDate = d &"/"& m &"/"& y
    end function

    ]]>
    </script>

    </component>
    Slim, Jan 6, 2006
    #4
  5. Jose M Hernandez

    t Guest

    Slim wrote:
    > "Jose M Hernandez" <Jose M > wrote in
    > message news:...
    >
    >>Does anybody know of techniques (or websites) where a graph is generated
    >>based on data of an array?
    >>
    >>Any advice on graphs and ASP is greatly appreciated...


    Here's one example not using any component, just pure asp and html:
    http://www.u229.no/stuff/HTMLGraph/

    t
    t, Jan 6, 2006
    #5
  6. Jose M Hernandez

    Slim Guest

    "t" <> wrote in message news:...
    > Slim wrote:
    >> "Jose M Hernandez" <Jose M > wrote in
    >> message news:...
    >>
    >>>Does anybody know of techniques (or websites) where a graph is generated
    >>>based on data of an array?
    >>>
    >>>Any advice on graphs and ASP is greatly appreciated...

    >
    > Here's one example not using any component, just pure asp and html:
    > http://www.u229.no/stuff/HTMLGraph/
    >
    > t


    you can use my code in a ASP page, but its more useful in a component
    Slim, Jan 6, 2006
    #6
  7. I appreciate all the information, i will take time and learn...
    Jose M Hernandez, Jan 7, 2006
    #7
  8. color does make a difference in graphs
    Jose M Hernandez, Jan 7, 2006
    #8
  9. Jose M Hernandez

    Slim Guest

    "t" <> wrote in message news:...
    > Slim wrote:
    >> "Jose M Hernandez" <Jose M > wrote in
    >> message news:...
    >>
    >>>Does anybody know of techniques (or websites) where a graph is generated
    >>>based on data of an array?
    >>>
    >>>Any advice on graphs and ASP is greatly appreciated...

    >
    > Here's one example not using any component, just pure asp and html:
    > http://www.u229.no/stuff/HTMLGraph/
    >
    > t


    actually its a component
    "Set oChart1 = New cSingleVerticalChart"
    Slim, Jan 7, 2006
    #9
  10. Jose M Hernandez

    t Guest

    Slim wrote:

    >>Here's one example not using any component, just pure asp and html:
    >>http://www.u229.no/stuff/HTMLGraph/
    >>
    >>t

    >
    >
    > actually its a component
    > "Set oChart1 = New cSingleVerticalChart"


    No, it isn't. This is a reference to a vbscript class.

    t
    t, Jan 7, 2006
    #10
  11. Jose M Hernandez

    Slim Guest

    "t" <> wrote in message news:...
    > Slim wrote:
    >
    >>>Here's one example not using any component, just pure asp and html:
    >>>http://www.u229.no/stuff/HTMLGraph/
    >>>
    >>>t

    >>
    >>
    >> actually its a component
    >> "Set oChart1 = New cSingleVerticalChart"

    >
    > No, it isn't. This is a reference to a vbscript class.
    >
    > t



    A VB class is not pure asp

    Mine is a reference to a VBscript class
    reference to a VB class is another way of saying component
    Slim, Jan 7, 2006
    #11
  12. Jose M Hernandez

    Guest

    I've got a free barchart ASP class (no components) downloadable from my
    Web site at http://www.Bullschmidt.com/Barchart.asp to help turn data
    stored in a table (or SQL statement) into a barchart.

    Best regards,
    J. Paul Schmidt, Freelance Web and Database Developer
    http://www.Bullschmidt.com
    Access Database Sample, Web Database Sample, ASP Design Tips
    , Jan 9, 2006
    #12
  13. Jose M Hernandez

    Slim Guest

    <> wrote in message
    news:...
    > I've got a free barchart ASP class (no components) downloadable from my
    > Web site at http://www.Bullschmidt.com/Barchart.asp to help turn data
    > stored in a table (or SQL statement) into a barchart.



    you mean VBScript class?




    >
    > Best regards,
    > J. Paul Schmidt, Freelance Web and Database Developer
    > http://www.Bullschmidt.com
    > Access Database Sample, Web Database Sample, ASP Design Tips
    >
    Slim, Jan 10, 2006
    #13
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Evan

    Re: Complete Newb Here

    Evan, Jun 27, 2003, in forum: C++
    Replies:
    0
    Views:
    737
  2. gerg

    total newb here

    gerg, Jan 8, 2006, in forum: Python
    Replies:
    1
    Views:
    277
  3. samyouel

    Hey newb problem here need help

    samyouel, Feb 16, 2009, in forum: Java
    Replies:
    1
    Views:
    333
    code learner
    Jan 9, 2011
  4. George Hester

    Try over here likely more to the point here

    George Hester, Sep 30, 2004, in forum: Javascript
    Replies:
    0
    Views:
    110
    George Hester
    Sep 30, 2004
  5. FAQ server
    Replies:
    0
    Views:
    154
    FAQ server
    Aug 10, 2006
Loading...

Share This Page