2833Lesson 18: Turning numbers into graphs with ASPhttp://haneng.com/Lessons_18.aspOk 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.ASP > Tips and Tutorials > Graphs and ChartsOct 10, 2006
Charting is most common task you will need in data presentation. This article shows simple method to create charts without external client or server objects, without .gif, jpg or png - the chart is created as HTML, directly in page. The simpliest task is to create bar charts. HTML gives you many formatting possibilities to show bars in graph.
The bar chart sample in asp101.com served as the basis for building this stack bar chart. A strong feature of the sample is the ability to read the values of the bars through the tool tip text. Each bar is an image inside a table data (
To begin with, we need to create an HTML page or you could use any extension you would like. This is going to be the page the content is displayed on. Later in the article we will build a ASP page that generates the chart and is called using AJAX from the main page. I will not go into all of the details of creating a page and the entire layout, but rather focus on the items related to the chart.
Charts are very useful for internet applications. Imagine an online stock brokerage, or perhaps you have a scientific site that tracks population patterns. You can use charts virtually anywhere. The problem is that most people believe to create a chart, you must use a separate program and create a GIF or JPG to insert into your web page, not to mention the fact that there are not many resources out there to show you how. Here, we'll show you how to do it dynamically and through ASP, so no more chart GIFs!
Joining mailing list will entitle you
to receive occasional emails informing you of news and
updates to the site and any special offers that may be
of interest to you.