Turning off Item Data Labels and moving x axis labels

Thread is closed for posting
5 posts, 0 answers
  1. Glavin
    Glavin avatar
    11 posts
    Member since:
    Nov 2008

    Posted 17 Nov 2008 Link to this post

    I am having trouble finding the magic setting that disables the item data labels for a line chart, and can't seem to get the x axis label's y position to change to try and move the labels closer to the axis.
  2. Glavin
    Glavin avatar
    11 posts
    Member since:
    Nov 2008

    Posted 17 Nov 2008 Link to this post

    ok I found the problem to at least one of my issues.

    Apprently the way I am binding the grid I have to shit off show lables for both series 0 and 1.

    rdcIndividual.DataSource = (a LINQ query here ... select new { Month = g.Key, Score = g.Average(ut => ut.percent_score) };)
     rdcIndividual.Series[0].DataYColumn = "Score";
     rdcIndividual.PlotArea.XAxis.DataLabelsColumn = "Month";
     rdcIndividual.Series[1].Appearance.ShowLabels = false;
     rdcIndividual.Series[0].Appearance.ShowLabels = false;
  3. Ves
    Ves avatar
    2927 posts

    Posted 20 Nov 2008 Link to this post

    Hello Michael,

    Here is the code to move X axis item labels towards the axis:

    RadChart1.PlotArea.XAxis.Appearance.LabelAppearance.Position.Auto = false;
    RadChart1.PlotArea.XAxis.Appearance.LabelAppearance.Position.Y = -10;

    Hope this helps.

    Best wishes,
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  4. Jason
    Jason avatar
    19 posts
    Member since:
    Mar 2009

    Posted 23 Dec 2009 Link to this post

    That works for the entire series but how do you do this for just one step.  I get an error in ItemDataBound in I add Items[0] as in:

    RadChartMitigation.Series[0].Items[0].Appearance.ShowLabels =



  5. Velin
    Velin avatar
    391 posts

    Posted 28 Dec 2009 Link to this post

    Hello Adisa,

    I think you need to handle the BeforeLayout event like this:
    RadChart1.BeforeLayout += new EventHandler<EventArgs>(RadChart1_BeforeLayout);
        void RadChart1_BeforeLayout(object sender, EventArgs e)
            (RadChart1.Series[0].Items[0] as ChartSeriesItem).Label.Visible = false;

    Hope this will help.

    Kind regards,
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Back to Top