954,577 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

how to make a pie or bar chart in asp.net?

Hi, i wondered if any1 knew how to create a simple bar or pie chart in asp.net. I would like to show how much space users have used e.g. 25/100mb represented graphically and showing percentages

Thanks for help

julseypart
Light Poster
42 posts since Oct 2008
Reputation Points: 10
Solved Threads: 0
 

Hi,

There are many ways to achieve this:
1. You can use third party dlls to create charts, many are available in market, if you are lucky u will get something free.
2. You can use System.Drawing.Graphics in .net to create your own charts (I assume your requirement is very basic). Its should not take long.
3. You can use CSS, simple bar chart can be created purely using CSS, for pie chart you can use different images and show them based on calcuation. for example you can have 20 odd images(pie01.gif, pie02.gif...) and based on calculation set Style Image to relevant image. for 20% useabge set image = pie02.gif
Its the cheapest and fastest way to achieve this.

I think you must have got the idea.

P.K.Chaudhary
Light Poster
30 posts since Mar 2009
Reputation Points: 10
Solved Threads: 5
 
greeny_1984
Posting Whiz
372 posts since Apr 2007
Reputation Points: 25
Solved Threads: 29
 

You can draw this using a simple System.Drawing.Graphics bitmap canvas. Use mathematics to calculate the layout of the the charts.

consultsarath
Newbie Poster
1 post since Apr 2009
Reputation Points: 10
Solved Threads: 0
 

thanks, i might just use the css method as im not great at mathematics! Do you know where i could get 20 pie images - one for 5%, 10% ..etc or should i make my own as they would have to be similar?

julseypart
Light Poster
42 posts since Oct 2008
Reputation Points: 10
Solved Threads: 0
 

Hi,

Sorry you have to search this.

P.K.Chaudhary
Light Poster
30 posts since Mar 2009
Reputation Points: 10
Solved Threads: 5
 

HI,
The best way is to generate a bar/pie animated chart is fusion chart. Its completely free & easy to use as well as niceeee.

First download the documents from
http://www.fusioncharts.com/Download.asp

READ DOCUMENT CAREFULLY. TOO EASY.

mail2saion
Posting Whiz in Training
247 posts since Apr 2009
Reputation Points: 26
Solved Threads: 44
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You