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

Placing a bel with a no in line chart

3 Answers 53 Views
Chart (obsolete as of Q1 2013)
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
harini
Top achievements
Rank 1
harini asked on 07 Oct 2008, 08:10 AM
Hi,

I am using a line chart. I need to place a label at the right or the left of the points in the lines of the chart. I need the label to carry some numeric values like 10, 20 etc. I wrote the foll lines of code for it.

painChart.Series[0].Appearance.LabelAppearance.Position.AlignedPosition =

AlignedPositions.Right;

 

painChart.Series[0].Appearance.LabelAppearance.LabelLocation =

StyleSeriesItemLabel.ItemLabelLocation.Inside;

But no labels appear and I dont know how to set the numeric value to the label.

Kindly let me know the code as to how to place the labels with the numeric values at the right or left of the points in a line chart.



Thanks in advance,
Harini

 

3 Answers, 1 is accepted

Sort by
0
Dwight
Telerik team
answered on 08 Oct 2008, 06:45 AM
Hi Harini,

Here is a sample code, that customizes the labels and places them using the code provided in your post.
I've created a new project and added a single RadChart to the form, that is why I'm providing only the necessary code (from the Form1.cs file):
Evtim
0
harini
Top achievements
Rank 1
answered on 10 Oct 2008, 06:59 AM
thanks.

But I am unable to see ur sample code. hv u attached them somewhere? kindly guide me as to how I can view ur sample code coz i dont seem to be able to see them.

Thanks,
Harini
0
Dwight
Telerik team
answered on 13 Oct 2008, 06:11 AM
Hi harini,

Sorry for the inconvinience, there seems to be some issues with our supporting system. Here is the code:

public Form3() 
    InitializeComponent(); 
 
    this.radChart1.Series.Add(new ChartSeries()); 
    this.radChart1.Series[0].Type = Telerik.Charting.ChartSeriesType.Line; 
    this.radChart1.Series[0].Appearance.LabelAppearance.Position.AlignedPosition = Telerik.Charting.Styles.AlignedPositions.Right; 
    this.radChart1.Series[0].Appearance.LabelAppearance.LabelLocation = Telerik.Charting.Styles.StyleSeriesItemLabel.ItemLabelLocation.Inside; 
 
    Random r = new Random(); 
 
    for (int i = 0; i < 20; i++) 
    { 
        ChartSeriesItem item = new ChartSeriesItem(); 
        item.YValue = r.Next(0, 100); 
 
        this.radChart1.Series[0].Items.Add(item); 
    } 
 

Best regards,
Evtim
Tags
Chart (obsolete as of Q1 2013)
Asked by
harini
Top achievements
Rank 1
Answers by
Dwight
Telerik team
harini
Top achievements
Rank 1
Share this question
or