MaxFontSize ignored

6 posts, 0 answers
  1. Elke Kaminski
    Elke Kaminski avatar
    6 posts
    Member since:
    Mar 2009

    Posted 17 Dec 2013 Link to this post

    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
  2. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 18 Dec 2013 Link to this post

    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.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Elke Kaminski
    Elke Kaminski avatar
    6 posts
    Member since:
    Mar 2009

    Posted 19 Dec 2013 Link to this post

    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
  5. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 19 Dec 2013 Link to this post

    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?
  6. Elke Kaminski
    Elke Kaminski avatar
    6 posts
    Member since:
    Mar 2009

    Posted 20 Dec 2013 Link to this post

    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();
            });
  7. Slav
    Admin
    Slav avatar
    1355 posts

    Posted 21 Dec 2013 Link to this post

    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.
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017