Guys,
I have created a stacked bar chart and I want the Series Item label to be shown besides the segment.
As of now it shows above the segment. I played around with the API and found that it can be positioned either inside or outside.
Can I somehow place the text label besides the segment?
Cheers,
Nitin
I have created a stacked bar chart and I want the Series Item label to be shown besides the segment.
As of now it shows above the segment. I played around with the API and found that it can be positioned either inside or outside.
Can I somehow place the text label besides the segment?
Cheers,
Nitin
4 Answers, 1 is accepted
0
Nitin
Top achievements
Rank 1
answered on 21 Jan 2009, 04:55 PM
Ok, I posted too soon.
Heres how i did it
put the following piece of code in the chart prerender event
Heres how i did it
put the following piece of code in the chart prerender event
For seriescount As Integer = 0 To RadChart1.Series.Count - 1
For itemcount As Integer = 0 To RadChart1.Series(seriescount).Items.Count - 1
RadChart1.Series(seriescount).Item(itemcount).Label.Appearance.LabelLocation =
Telerik.Charting.Styles.StyleSeriesItemLabel.ItemLabelLocation.Outside
RadChart1.Series(seriescount).Item(itemcount).Label.Appearance.Position.AlignedPosition =
Telerik.Charting.Styles.AlignedPositions.Right
Next
0
Hi Nitin ,
You can also do this for the entire series:
RadChart1.Series(0).Appearance.LabelAppearance.LabelLocation = Telerik.Charting.Styles.StyleSeriesItemLabel.ItemLabelLocation.Outside
Then you will not need to loop through all the items. Note, that if your chart is databound this code should come after databinding, so you are sure the series already exists.
Greetings,
Ves
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.
You can also do this for the entire series:
RadChart1.Series(0).Appearance.LabelAppearance.LabelLocation = Telerik.Charting.Styles.StyleSeriesItemLabel.ItemLabelLocation.Outside
Then you will not need to loop through all the items. Note, that if your chart is databound this code should come after databinding, so you are sure the series already exists.
Greetings,
Ves
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
antonio
Top achievements
Rank 1
answered on 17 Nov 2010, 08:03 PM
Hi Ve,
exactly in wich event, I can write my code, in order to modify this characteristic of Labels????
RadChart1.Series(0).Appearance.LabelAppearance.LabelLocation = Telerik.Charting.Styles.StyleSeriesItemLabel.ItemLabelLocation.Outside
I am programing in asp.net 4.0 with aspx and have a reportviewer displaying a report, inside a report, I have the chart. But I can´t fount the place for modify this charactetistic. I want to put labels location inside.
I tryed in Databound chart event, but the chart don´t change.
This is my code:
private void chart1_ItemDataBound(object sender, EventArgs e)
{
if (chart1.Series.Count > 0 )
{
chart1.Series[0].Appearance.LabelAppearance.LabelLocation = Telerik.Reporting.Charting.Styles.StyleSeriesItemLabel.ItemLabelLocation.Inside;
chart1.Series[0].Appearance.LabelAppearance.Position.AlignedPosition = Telerik.Reporting.Charting.Styles.AlignedPositions.Bottom;
}
}
Could you help me, please. Thanks.
exactly in wich event, I can write my code, in order to modify this characteristic of Labels????
RadChart1.Series(0).Appearance.LabelAppearance.LabelLocation = Telerik.Charting.Styles.StyleSeriesItemLabel.ItemLabelLocation.Outside
I am programing in asp.net 4.0 with aspx and have a reportviewer displaying a report, inside a report, I have the chart. But I can´t fount the place for modify this charactetistic. I want to put labels location inside.
I tryed in Databound chart event, but the chart don´t change.
This is my code:
private void chart1_ItemDataBound(object sender, EventArgs e)
{
if (chart1.Series.Count > 0 )
{
chart1.Series[0].Appearance.LabelAppearance.LabelLocation = Telerik.Reporting.Charting.Styles.StyleSeriesItemLabel.ItemLabelLocation.Inside;
chart1.Series[0].Appearance.LabelAppearance.Position.AlignedPosition = Telerik.Reporting.Charting.Styles.AlignedPositions.Bottom;
}
}
Could you help me, please. Thanks.
0
Hi Antonio,
In Telerik Reporting you need to apply these changes in the NeedDataSource event handler. If the chart is populated manually, by adding ChartSeries, you should add these lines after the actual ChartSeries are added to the chart.
Best regards,
Ves
the Telerik team
In Telerik Reporting you need to apply these changes in the NeedDataSource event handler. If the chart is populated manually, by adding ChartSeries, you should add these lines after the actual ChartSeries are added to the chart.
Best regards,
Ves
the Telerik team
Browse the vast support resources we have to jumpstart your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.