简体   繁体   中英

TagCloud snippet confused how to use Asp.Net 2.0

I found this piece of code and it only had two lines of code my problem is the minFontSize and maxFonSite variables they seem to me that they wiill never change as opposed to minOccurs and maxOccurs. here is the code. from this site http://blogs.dekoh.com/dev/2007/10/29/choosing-a-good-font-size-variation-algorithm-for-your-tag-cloud/

weight = (occurencesOfCurrentTag-minOccurs)/(maxOccurs-minOccurs);
fontSizeOfCurrentTag = minFontSize + Math.round((maxFontSize-minFontSize)*weight)

can someone expand on this for me please make the picture easier Im using C# 2.0 asp.net 2.0

It seems to me that minFontSize and maxFontSize are constants which describe font sizes for tags with lowest and highest tag occurences respectively.

If the tag is the one with maximum occurences, the weight of that tag becomes 1, and font size maxFontSize.

If the tag is the one with minimum occurences, the weight of that tag becomes 0, and font size minFontSize.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM