Web Analytics Made Easy -
StatCounter Drawing charts with ASP - CodingForum

Announcement

Collapse
No announcement yet.

Drawing charts with ASP

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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
    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

    Comment


    • #3
      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
      I am the luckiest man in the world

      Comment


      • #4
        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

        Comment


        • #5
          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!

          Comment


          • #6
            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

            Comment


            • #7
              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

              Comment


              • #8
                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; Jul 7, 2002, 10:47 PM.
                Former ASP Forum Moderator - I'm back!

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

                Comment

                Working...
                X