Changing axes font Size

  1. #1

    Changing axes font Size

    Hello,

    Im trying to change a font size of a axes in the code behind but i cant make it work.

    Take a look to my code:

    Chart1.Axes.Clear();
    
                Ext.Net.NumericAxis axis = new Ext.Net.NumericAxis();
                Ext.Net.CategoryAxis caxis = new Ext.Net.CategoryAxis();
    
                axis.Fields = new string[] { "YField" };
                axis.Maximum = null;
                axis.Title = "teste";
                axis.Position = Ext.Net.Position.Bottom;
                axis.Grid = true;
                axis.Minimum = 0;
                
                caxis.Fields = new string[] { "XField" };
                caxis.Title = "Date";
    
                caxis.Label.FontSize = "9px Arial"; --here i get the error: Object reference not set to an instance of an object.
    Please help me!

    Thanks.
    Last edited by Daniil; Jun 18, 2012 at 11:18 PM. Reason: Please use [CODE] tags
  2. #2
    Hi,

    I guess you do not recreate that Label during DirectEvent. You should recreate it.

    Also please note if you want these changes during DirectEvent will be affected on client, you should re-render the Chart.
    Chart1.Render();

Similar Threads

  1. Font Size Change
    By megang in forum 1.x Help
    Replies: 1
    Last Post: Apr 09, 2012, 10:02 AM
  2. [CLOSED] increase font size
    By nhg_itd in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Sep 29, 2011, 7:04 AM
  3. Change font/button size
    By plykkegaard in forum 1.x Help
    Replies: 0
    Last Post: Sep 02, 2010, 3:09 PM
  4. Modify font-size in GridPanel
    By John_Writers in forum 1.x Help
    Replies: 0
    Last Post: Apr 28, 2010, 5:26 AM
  5. [CLOSED] RowEditor font size
    By sharif in forum 1.x Legacy Premium Help
    Replies: 5
    Last Post: Mar 02, 2010, 4:08 PM

Posting Permissions