Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / ASP.NET AJAX > Chart > RadChart ChartTitle set font size?

Not answered RadChart ChartTitle set font size?

Feed from this thread
  • Tim Romano Intermediate avatar

    Posted on Mar 16, 2009 (permalink)

    Using version 2.0.2.0 of the Rad Ajax Chart. 
    I cannot figure out how to change the font size for the title of a chart created via the API.
    The title is being truncated (it looks like part of a left parenthesis followed by "Enrollmen" and then a few extra pixels of something).
    AutoTextWrap is True. 

    I'd expect to find the font-size property somewhere in the Appearance.TextProperties hierarchy, but don't see it.

     

     

    Dim CTitle As New Telerik.Charting.ChartTitle

      

    With CTitle.TextBlock

     

     

        .Text =

    "Enrollment Blah Blah"

     

     

     

     

       .Appearance.AutoTextWrap = Telerik.Charting.Styles.AutoTextWrap.True

     

     

        .Appearance.TextProperties.Color = System.Drawing.Color.Maroon

     

    End With

     

     

     

     

    RadChart1.ChartTitle.Add(CTitle)

     

     

     

     

     

     

     

     

     

     

    Reply

  • Dessy Dessy admin's avatar

    Posted on Mar 17, 2009 (permalink)

    Hi Tim Romano,

    In order to change the font-size of the Chart Title you can use CharTitle element
    (Text Block->Appearance->TextProperties->Font) from the property grid.
    Here is an example:

    <ChartTitle> 
         
       <TextBlock Text=" Chart">  
                          
                <Appearance TextProperties-Font="Verdana, 10pt">  
                          
                </Appearance> 
     
       </TextBlock> 
     
    </ChartTitle> 

    I hope this information helps. I will be glad to assist you further

    Regards,
    Dessy
    the Telerik team


    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.

    Reply

  • Say Hello to Telerik's PivotGrid for ASP.NET AJAX, Silverlight, WPF and WinForms. Now packed with OLAP support.
  • Tim Romano Intermediate avatar

    Posted on Mar 17, 2009 (permalink)

    Does the API support the following approaches? (I'm not on-site to test it).  Or must the font-name be specified (i.e. not font-family and not the CSS "inherit" directive) and does the size have to be specified in pt units?

    ChartTitle.Appearance.TextProperties.Font = "medium"

    ChartTitle.Appearance.TextProperties.Font = "sans-serif, small"

    ChartTitle.Appearance.TextProperties.Font = "inherit, small"


    Thanks

    Reply

  • Dessy Dessy admin's avatar

    Posted on Mar 18, 2009 (permalink)

    Hello Tim Romano,

    RadChart is just an image, rendered on the server, so CSS-like approach will not be applicable as there is no actual text in the browser. You will need to supply the desired font using a System.Drawing.Font object. Here is an example:
     
            RadChart1.ChartTitle.TextBlock.Appearance.TextProperties.Font = New System.Drawing.Font(FontFamily.GenericSansSerif, 26) 


    Regards,
    Dessy
    the Telerik team


    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.

    Reply

  • Mohammed avatar

    Posted on Feb 14, 2011 (permalink)

    I'm facing the same problem, I have tried every single line of code, it is not working. The font remains" Verdana, 15Pt"

    any help please.

    Reply

  • Evgenia Evgenia admin's avatar

    Posted on Feb 17, 2011 (permalink)

    Hi Mohammed,

    To be able to change the Font Style and Size of the RadChart's Title you can set it by using the Properties window of the Visual Studio or manually in the markup:
    <ChartTitle>
                <TextBlock>
                    <Appearance TextProperties-Font="Monotype Corsiva, 18pt, style=Italic">
                    </Appearance>
                </TextBlock>
            </ChartTitle>

    Regards,
    Evgenia
    the Telerik team

    Reply

  • Abhishek avatar

    Posted on Oct 18, 2011 (permalink)

    Hi,
    Can you please provide a tested sample of code to change the Font size of the chart title from code behind.
     I have tested all the solutions provided above but nothing is working.


    Thanks in advance
    Abhi 

    Reply

  • Evgenia Evgenia admin's avatar

    Posted on Oct 21, 2011 (permalink)

    Hello Abhishek,

    Just add these code lines in your Page_Load body:
    MilestoneChart.ChartTitle.TextBlock.Text = "My Chart Title";
    MilestoneChart.ChartTitle.TextBlock.Appearance.TextProperties.Font = new Font(new FontFamily("Monotype Corsiva"),18f, FontStyle.Italic);

    Kind regards,
    Evgenia
    the Telerik team
    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 their blog feed now

    Reply

  • Say Hello to Telerik's PivotGrid for ASP.NET AJAX, Silverlight, WPF and WinForms. Now packed with OLAP support.

Back to Top

Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / ASP.NET AJAX > Chart > RadChart ChartTitle set font size?
Related resources for "RadChart ChartTitle set font size?"

ASP.NET Chart Features  |  Documentation  |  DemosStep-by-step Tutorial  ]