views:

1230

answers:

4

I'm venturing into web programming for the first time and would like a nice way to display a frequency indicator of some data, in the form of a tag cloud.

For example, pretend I have some simple data of three types of pets: Dog, Cat, Monkey.

There are 5 Dogs, 27 Cats and 101 Monkeys.

Given this data, what's the best way to make a tag cloud to visually indicate that I have way too many monkeys, not as many cats, and that I definitely need obtain a few more dogs?

Update: It would be great if the solution was actually discussed and answered on stackoverflow. Linking externally is good to help support the answer, but leaving the links as an answer is not necessarily what stackoverflow is about. Anyone can google to find what has been linked. The hope is that stackoverflow will be the place to find the answer. This is just a request to help make stackoverflow better. :)

+2  A: 

I don't believe this is the answer you're looking for, but there is a Cloud Control for ASP.NET available at CodeProject:

http://www.codeproject.com/KB/aspnet/cloud.aspx

It's looks fairly easy to use.

--

Edit: I should probably credit my source. The link above was found on the following web page:

http://www.technacular.com/2007/04/22/how-to-create-a-tag-cloud/

This page contains some additional general information related to building a Tag Cloud. Best of luck!

Gabe
The codeproject link is broken
Chocol8
A: 

I hope this would help.

http://aspnet.4guysfromrolla.com/articles/102506-1.aspx

Syed Sajid Nizami
+1  A: 

You need to first decide your metric (i.e. what you want to measure, in this case number of pets per type), and second how you map that metric onto a set of classes. These classes are equivalent to the styles you attach to the tags.

A quite simple mapping would be x[i] / sum(x) giving a ratio between 0 and 1. Define subranges on the range [0, 1], for example 4 ranges from 0..0.25, 0.25..0.50 and so on. Find the index of the subrange (0,1,2,3) and assign the tag a CSS class "tagX".

devio
+1  A: 

There are many approaches and techniques...

Clustering Algorithms for Tag Clouds

Design Tips for Building Tag Clouds

CMS