Created by Richard Eigenmann / richard.eigenmann@gmail.com
Java Web Start: http://richardeigenmann.github.io/TagCloud/TagCloud.jnlp
Or, if that didn't work, the next two slides show screenshots.
Here the font size correlates the the height of the person and the color reflects the Body Mass Index of the person.
Disclaimer: Data sourced from untrustworthy sites on the Internet.
Here is an example where the font size and font color correlate to the population size of big cities.
(Data sourced from Wikipedia)
// create a List of WeightedWord objects
List<WeightedWordInterface> weightedWordList = new ArrayList<>();
weightedWordList.add( new WeightedWord( "Word1", 10, 50 ) );
weightedWordList.add( new WeightedWord( "Word2", 60, 20 ) );
// create the TagCloud
TagCloud tagCloud = new TagCloud();
tagCloud.setWordsList( weightedWordList );
tagCloud.addTagClickListener( new TagClickListener() {
@Override
public void tagClicked( WeightedWordInterface weightedWord ) {
doTagClicked( weightedWord );
}
} );
public void doTagClicked( WeightedWordInterface weightedWord ) {
System.out.println( String.format( "The word: %s was clicked",
weightedWord.getWord() ) );
}
tagCloud.setColorProvider( new BMIColorProvider() );
tagCloud.setFontProvider( new SansSerifFontProvider() );