Hi Folks - Just wanted to know how you go about positioning the value labels of a chart in code behind.
i know you can position them in design view but i really want to position them all in code behind
i would need hem positioned in the middle of the bar if possible.
Thanks Folks
i know you can position them in design view but i really want to position them all in code behind
i would need hem positioned in the middle of the bar if possible.
Thanks Folks
5 Answers, 1 is accepted
0
Hi Brian,
I assume you are talking for the series labels. Here is a sample code:
Let me know if those are not the labels you want to position but, please, specify to which labels you refer.
Best,
Evtim
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
I assume you are talking for the series labels. Here is a sample code:
series.Appearance.LabelAppearance.LabelLocation = Telerik.Charting.Styles.StyleSeriesItemLabel.ItemLabelLocation.Inside; |
series.Appearance.LabelAppearance.Position.AlignedPosition = Telerik.Charting.Styles.AlignedPositions.Center; |
Let me know if those are not the labels you want to position but, please, specify to which labels you refer.
Best,
Evtim
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
IT
Top achievements
Rank 1
answered on 12 Jun 2009, 08:27 AM
Hi Evrim,
Thanks for the reply
that looks about right but not sure how to use it?
can you give me an example?
Thanks for the reply
that looks about right but not sure how to use it?
can you give me an example?
0
Accepted
Hello Brian,
Here is a sample usage in Page_Load:
Best,
Evtim
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Here is a sample usage in Page_Load:
protected void Page_Load(object sender, EventArgs e) |
{ |
// In this case, we use SqlDataSource to fill in the chart |
this.RadChart1.DataSource = SqlDataSource1; |
this.RadChart1.DataBind(); |
foreach(Series series in this.RadChart1.Series) |
{ |
series.Appearance.LabelAppearance.LabelLocation = Telerik.Charting.Styles.StyleSeriesItemLabel.ItemLabelLocation.Inside; |
series.Appearance.LabelAppearance.Position.AlignedPosition = Telerik.Charting.Styles.AlignedPositions.Center; |
} |
} |
Best,
Evtim
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
IT
Top achievements
Rank 1
answered on 15 Jun 2009, 01:57 PM
Hi there,
thanks for the quick reply.
what namespace is 'series' in?
Regards,
thanks for the quick reply.
what namespace is 'series' in?
Regards,
0
Hi Brian,
Here is the foreach statement again, including the namespace:
All the best,
Evtim
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Here is the foreach statement again, including the namespace:
foreach(Telerik.Charting.ChartSeries series in radChart1.Series) |
{ |
... |
} |
All the best,
Evtim
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.