This is a migrated thread and some comments may be shown as answers.

Same font size for same weight in 2 clouds

1 Answer 45 Views
TagCloud
This is a migrated thread and some comments may be shown as answers.
Benny
Top achievements
Rank 1
Benny asked on 28 Mar 2014, 01:16 PM
Is there any possibility to get the same font size for the same weight in 2 clouds? (Both clouds have the same height and with)

example
GIVEN Cloud 1:
bacons - weight 100
ribs - weight 10

GIVEN Cloud 2:
ribs - weight 10
doner - weight 5

THEN
ribs in both clouds should have the same font size

1 Answer, 1 is accepted

Sort by
0
Marin Bratanov
Telerik team
answered on 02 Apr 2014, 10:31 AM
Hello Benny,

The behavior RadTagCloud offers is to have items vary their font size between the min and max font size available, according to their weight. Thus, items with different weight cannot have the same font-size. If you can make the difference proportional (i.e., the weight of the ribs item in the second control to be 10 times lower than the weight of the heaviest item, as it is in the first control), then you could get the same appearance. Note that items would need to match - the heaviest and the lightest should have the same weight in both controls, so the item with the same weight can have the same size. The idea is to make sure the calculation will be the same for both controls. You could do this with dummy items with no text so they will take as little space as possible:
<telerik:RadTagCloud runat="server"  ID="rtc1" Width="300px" Height="200px">
    <Items>
        <telerik:RadTagCloudItem text="bacon" Weight="100" />
        <telerik:RadTagCloudItem text="ribs" Weight="10" />
        <telerik:RadTagCloudItem Text="" Weight="5" />
    </Items>
</telerik:RadTagCloud>
<telerik:RadTagCloud runat="server"  ID="rtc2" Width="300px" Height="200px">
    <Items>
        <telerik:RadTagCloudItem Text="" Weight="100" />
        <telerik:RadTagCloudItem text="ribs" Weight="10" />
        <telerik:RadTagCloudItem text="doner" Weight="5" />
    </Items>
</telerik:RadTagCloud>
Note that we cannot guarantee if/how this is possible in your actual case. The original requirement that in different contexts an item should have the same size in all cases does not fit the concept of the control and is, generally, not possible.

Regards,
Marin Bratanov
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
TagCloud
Asked by
Benny
Top achievements
Rank 1
Answers by
Marin Bratanov
Telerik team
Share this question
or