x axis y axis label

Thread is closed for posting
4 posts, 1 answers
  1. Karthik Kantharaj
    Karthik Kantharaj avatar
    101 posts
    Member since:
    Mar 2010

    Posted 13 Jan 2012 Link to this post

    Hi guys
    I am working in chart

    http://demos.telerik.com/aspnet-ajax/chart/examples/functionality/yaxis2/defaultcs.aspx

    In this chart i need to add label for x axis and y axis

                               |
       expense         |
                               |
                               |
                               |
                               ------------------------------------
                                          no of items

    Like above

    please guide me

    Karthik.K
  2. jumpstart
    jumpstart avatar
    479 posts
    Member since:
    Nov 2011

    Posted 16 Jan 2012 Link to this post

    Karthik:

    If I understand your requirement, it seems that you are trying to set the AXIS TITLE property for the x-axis and the y-axis.

    See the The Wizard Axis Tab documentation for design time settings.

    If you're trying to define the titles server-side, then take a look at the Creating RadChart Programmatically - more complex example.
    // Set text and line for X axis
    radChart.PlotArea.XAxis.AxisLabel.TextBlock.Text = "Years";
    radChart.PlotArea.XAxis.AxisLabel.TextBlock.Appearance.TextProperties.Color =
    System.Drawing.Color.Red;
    radChart.PlotArea.XAxis.Appearance.Width = 3;
    radChart.PlotArea.XAxis.Appearance.Color = System.Drawing.Color.Red;
    // Set text and line for Y axis
    radChart.PlotArea.YAxis.AxisLabel.TextBlock.Text = "%";
    radChart.PlotArea.YAxis.AxisLabel.TextBlock.Appearance.TextProperties.Color =
    System.Drawing.Color.Red;
    radChart.PlotArea.YAxis.Appearance.Width = 3;
    radChart.PlotArea.YAxis.Appearance.Color = System.Drawing.Color.Red;

    Hope this helps!
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Answer
    Petar Marchev
    Admin
    Petar Marchev avatar
    968 posts

    Posted 17 Jan 2012 Link to this post

    Hi,

    You also need to set the label's Visible property to true. The below code should help.

    radChart1.PlotArea.XAxis.AxisLabel.TextBlock.Text = "# of items";           
    radChart1.PlotArea.XAxis.AxisLabel.Visible = true;
                 
    radChart1.PlotArea.YAxis.AxisLabel.TextBlock.Text = "Expense";
    radChart1.PlotArea.YAxis.AxisLabel.Visible = true;


    Regards,
    Petar Marchev
    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
  5. Karthik Kantharaj
    Karthik Kantharaj avatar
    101 posts
    Member since:
    Mar 2010

    Posted 18 Jan 2012 Link to this post

    Hi Guys

    Thank you

    Karthik.K
Back to Top