• home
  • forum
  • my
  • kt
  • download
  • Turning numbers into graphs with ASP

    Author: 2007-07-02 11:53:11 From:

    Learn to display your data in a graphical way by using ASP driven charts.

    Intro:
    Ok so now you probably know how to get data from databases, text files, forms etc. But when it comes to displaying that data people mostly use tables or listings. The fact is that pure text is bit boring and often you'll get your points across allot better with a simple graph than with a whole page of text. There are several ways to do this, and if you can afford it server components is probably the best way to do it. This is because such components can generate images serverside, giving you both a high grade of browser compatibility (no need for Java or plugins) as well as high grade of design freedom. But what if you can't pay up several hundred or thousands of dollars to buy such a component? There are alternatives. Our first approach is using images that we resize with ASP to display bar graphs. Our second approach is a Java applet that can display a more advanced graph, but depends on a Java capable browser.

    VBScript & image resize bar chart:
    I use this approach to display some of the things I log at haneng.com, such as page views per day, and it works good. The major disadvantages are:
    a) Little design freedom, limiting your graphs to bar charts
    b) Problems when you try to print them (at least with Netscape).
    The pros are:
    a) High compatibility
    b) Easy to make, no components etc. needed
    c) Free
    So how does such a bar chart look like? Under is an example:

    345
    437
    210
    336
    359



    This is a screenshot so all of you that don't have a Java enabled browser can see it also. The chart displays the percentage of different browsers used by visitors on one site.
    Try inserting data into this pie chart via a form (Java needed).

    You can download the pie applet and all the code used in this lesson.

    The same goes for this applet as for the bar chart. You can fill the chart with data with VBScript from any data source. And you must admit that charts bring more life to your data. If you got other ways to make graphs with ASP and/or got a nice and free chart applet of some kind, let me know!

    discuss this topic to forum

    relation tutorial

    No relevant information

    New

    Hot