Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 8 of 8
  1. #1
    Regular Coder
    Join Date
    May 2002
    Location
    Helsinki, Finland
    Posts
    231
    Thanks
    0
    Thanked 1 Time in 1 Post

    Drawing charts with ASP

    I need to build up an application, which will draw stock value charts dynamically, based on resultset from db.

    There are already many applications which would do the job, but their price is a bit salty. Besides I like doing everything by myself, allowing endless possibilities to customize charts.

    Is there any functions I could use for drawing lines between points? I mean I can bring the offset points for stock values, but I need something for connecting the points.

    All kind of suggestions are well heard, so bring 'em on.
    Zvona
    First Aid for
    Web Design

  • #2
    Regular Coder
    Join Date
    Jun 2002
    Posts
    344
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Zvona,

    you have a cool idea, and I wish I could help you out.

    My guess is that they're using a server component to do this.

    I don't know of a way to accomplish this manualy.. I wish I did.

    ~Quack

  • #3
    Senior Coder
    Join Date
    Jun 2002
    Location
    Zwolle, The Netherlands
    Posts
    1,120
    Thanks
    2
    Thanked 31 Times in 31 Posts
    Hi, if you have Excel installed, it should be easy, you can create an excel activeXobject in a web page, using javascript. then you have access to all functionality of excel, you can create a chart (do you need more options then excel gives you) then save the chart as a file (save for web or something like that) this can all be done serverside, return the filename to the client an voila, your graph is there

  • #4
    Regular Coder
    Join Date
    May 2002
    Location
    Helsinki, Finland
    Posts
    231
    Thanks
    0
    Thanked 1 Time in 1 Post
    Originally posted by Roelf
    Hi, if you have Excel installed, it should be easy, you can create an excel activeXobject in a web page, using javascript. then you have access to all functionality of excel, you can create a chart (do you need more options then excel gives you) then save the chart as a file (save for web or something like that) this can all be done serverside, return the filename to the client an voila, your graph is there
    Hmm..sounds handy. But I'm not very familiar with activeX objects. Are there any tutorials (besides at MSDN) that would help me on my "quest"?
    Zvona
    First Aid for
    Web Design

  • #5
    New Coder
    Join Date
    Jun 2002
    Location
    Paris, France
    Posts
    47
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I think you should be able to do it with javascript like that :
    http://www.javascriptkit.com/script/.../graphit.shtml
    But I don't think this is exactly the kind of graph you wanted.

    You could probably those lines in Flash since it is vector based but I don't know how...
    I don't suffer from insanity, I enjoy every single minute of it!

  • #6
    Regular Coder
    Join Date
    May 2002
    Location
    Helsinki, Finland
    Posts
    231
    Thanks
    0
    Thanked 1 Time in 1 Post
    Originally posted by Flamerule
    I think you should be able to do it with javascript like that :
    http://www.javascriptkit.com/script/.../graphit.shtml
    But I don't think this is exactly the kind of graph you wanted.

    You could probably those lines in Flash since it is vector based but I don't know how...
    Currently I'm doing more efficient graph, where the details (date & value) are displayed in status bar when mouse is moved over graph (every day and dot is unique table cell). However, I'm more after a graph like on http://www.eqonline.fi

    Thanks for your effort Flamerule, though.
    Zvona
    First Aid for
    Web Design

  • #7
    New Coder
    Join Date
    Jun 2002
    Location
    London & Oxford
    Posts
    97
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Here's some code I wrote a while ago to draw a bar chart. It's not exactly what you want but it might give you some inspiration. You'll need a 1x1 pixel gif in the same directory called "red.gif" to give the bars some colour.


    <html>

    <head>
    <title>Bar Chart</title>
    </head>

    <body>

    <table width="500" border="0" cellspacing="0" cellpadding="1">

    <%
    call makeBar (10, "chose this option")
    call makeBar (24, "did this")
    call makeBar (31, "like yoghurt")
    call makeBar (43, "are aliens")
    call makeBar (88, "think this code is good")
    %>

    </table>

    </body>
    </html>

    <%
    Function makeBar (percentage, description)

    Response.Write("<tr>" &vbcrlf)
    Response.Write("<td width=""5"" height=""10"">&nbsp;</td>" &vbcrlf)
    Response.Write("<td width=""200"" height=""10""><img src=""red.gif"" height=""10"" width=""" & (percentage*2) & """></td>" &vbcrlf)
    Response.Write("<td width=""295"" height=""10""><font face=""arial"" size=""1"">" &percentage& "% " &description& "</font></td>" &vbcrlf)
    Response.Write("</tr>" &vbcrlf &vbcrlf)

    End function
    %>
    As easy as 3.1415926535897932384626433832795028841

  • #8
    Senior Coder
    Join Date
    Jun 2002
    Location
    41 8' 52" N -95 53' 31" W
    Posts
    3,660
    Thanks
    0
    Thanked 0 Times in 0 Posts
    The only decent things graphwise I've been able to come up with in ASP are horizontal or vertical bar charts (using different colors, and printable regardless of browser)...

    Anything else is a real pain, especially when you don't really have the time to research it... but there are some tools (third-party software you can use for pie charts and stuff like that, that I've seen)... I believe I saw some references to those on http://www.haneng.com - disregarding the guy's english, he seems to know his stuff
    Last edited by whammy; 07-08-2002 at 03:47 AM.
    Former ASP Forum Moderator - I'm back!

    If you can teach yourself how to learn, you can learn anything. ;)


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •