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

MaxFontSize ignored

5 Answers 52 Views
TagCloud
This is a migrated thread and some comments may be shown as answers.
Elke Kaminski
Top achievements
Rank 1
Elke Kaminski asked on 17 Dec 2013, 11:04 AM
Hi,

I have the issue that the TagCloud Items have a MaxFontSize of 34px and on the initial load it appears correct, but when resizing the browser window there are tags shown with a much bigger size than the MaxFontSize.

<telerik:RadTagCloud ID="RadTagCloud" runat="server" Width="100%" MaxFontSize="34px"
                Font-Names="Helvetica,Arial" BorderStyle="None" Sorting="NotSorted">

Thanks for advices!
Claudio

5 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 19 Dec 2013, 04:47 AM
Hi,

Unfortunately I couldn't replicate the issue at my end. Please have a look into the sample code snippet which works fine at my end.

ASPX:
<telerik:RadTagCloud ID="RadTagCloud1" runat="server" Width="100%" MaxFontSize="34px"
    Font-Names="Helvetica,Arial" BorderStyle="None" Sorting="NotSorted">
    <Items>
        <telerik:RadTagCloudItem Text="ASP.NET" Weight="2428"></telerik:RadTagCloudItem>
        <telerik:RadTagCloudItem Text="AJAX" Weight="3700"></telerik:RadTagCloudItem>
        <telerik:RadTagCloudItem Text="VB" Weight="6400"></telerik:RadTagCloudItem>
        <telerik:RadTagCloudItem Text="C#" Weight="2287"></telerik:RadTagCloudItem>
    </Items>
</telerik:RadTagCloud>

Thanks,
Shinu.
0
Elke Kaminski
Top achievements
Rank 1
answered on 19 Dec 2013, 04:00 PM
Thanks for your help, but this obviously doesn't help me. ;-)
My version is 2012.3.1205.40, maybe this info helps you.

When I try your code it works for me until I resize the browser window. Actually your sample is the same as our working code, but containing static data as the only difference.

Thanks and best
Claudio
0
Shinu
Top achievements
Rank 2
answered on 20 Dec 2013, 05:29 AM
Hi,

Unfortunately I couldn't replicate the issue at my end. I have tried this code in telerik version 2012.3.1205.40 but the code is working fine at my end. Can you please provide your full code for further help?
0
Elke Kaminski
Top achievements
Rank 1
answered on 20 Dec 2013, 08:17 AM
I can't send you the full code, but maybe it helps you to understand when I send you our JS workaround we did:

$("div[id$='RadTagCloud']").each(function () {
             
            var tagCloud = $(this);
            var maxWeight = 0;
            $(tagCloud._items).each(function(s, o) { maxWeight = Math.max(o._weight, maxWeight); });
            tagCloud._maximalWeight = maxWeight;
            tagCloud.repaint();
        });
0
Slav
Telerik team
answered on 21 Dec 2013, 12:15 PM
Hi Elke,

By default the font size of the items in the RadTagCloud should not be affected by resizing of the browser window. Please ensure that you do not have a custom client-side script or CSS styles that are changing the font size, set by the control. For example, you can try removing the custom styles and scripts temporarily or creating a new clean page and placing the tag cloud inside.

Note that just a simple, fully runnable project that isolates the problem will also be useful for inspecting it locally and suggesting a solution.

Regards,
Slav
Telerik
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
Tags
TagCloud
Asked by
Elke Kaminski
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Elke Kaminski
Top achievements
Rank 1
Slav
Telerik team
Share this question
or