This is a migrated thread and some comments may be shown as answers.

Turning off Item Data Labels and moving x axis labels

4 Answers 94 Views
Chart (Obsolete)
This is a migrated thread and some comments may be shown as answers.
Glavin
Top achievements
Rank 1
Glavin asked on 17 Nov 2008, 08:11 PM
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.

4 Answers, 1 is accepted

Sort by
0
Glavin
Top achievements
Rank 1
answered on 17 Nov 2008, 09:24 PM
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.DataBind();
 rdcIndividual.Series[0].DataYColumn = "Score";
 rdcIndividual.PlotArea.XAxis.DataLabelsColumn = "Month";
 rdcIndividual.Series[1].Appearance.ShowLabels = false;
 rdcIndividual.Series[0].Appearance.ShowLabels = false;
0
Ves
Telerik team
answered on 20 Nov 2008, 07:30 AM
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,
Ves
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Jason
Top achievements
Rank 2
answered on 24 Dec 2009, 01:32 AM
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 =

false;

 

0
Velin
Telerik team
answered on 28 Dec 2009, 03:35 PM
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,
Velin
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.
Tags
Chart (Obsolete)
Asked by
Glavin
Top achievements
Rank 1
Answers by
Glavin
Top achievements
Rank 1
Ves
Telerik team
Jason
Top achievements
Rank 2
Velin
Telerik team
Share this question
or