I have a tag cloud and I need to know how can I change the font-size for the most used tags.
I need to set a min-font-size and a max-font-size.
I have a tag cloud and I need to know how can I change the font-size for the most used tags.
I need to set a min-font-size and a max-font-size.
here you can check how it's done in WordPress:
fontStep = (maxSize - minSize) / (maxCount - minCount);
fontSize = smallestFont + ( tagCount - minCount ) * fontStep;
I came up with this:
max_word_count = 412 # should count from list
min_word_count = 44 # should count from list
difference = max_word_count - min_word_count
min_weight = 99 / difference * min_word_count
for each tag
weight = 99 / difference * this_word_count - min_weight + 1
Which gave me weighed words between 1 and 100. It works perfectly for me at znaci.net/arhiv.
DISCLAIMER: I am not good at math.