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

Left aligning the labels - Horizontal Stacked Bar chart

1 Answer 132 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.
Arvind
Top achievements
Rank 1
Arvind asked on 10 Aug 2010, 09:32 AM
Hi,
   I am able to display the labels outside the horizontal stacked bar.  I have attached the sceenshot of what I have developed.  The value 9000 is for the red portion and it is center aligned to it (center aligned to the red portion).  Is it possible to align it left?

I tried the following code

cs.Appearance.LabelAppearance.LabelLocation = Telerik.Charting.Styles.

StyleSeriesItemLabel.ItemLabelLocation.Outside;

 

cs.Appearance.LabelAppearance.Position.AlignedPosition = Telerik.Charting.Styles.

AlignedPositions.Left;


If I set the Aligned position as Left after setting the LabelLocation as Outside, it has no effect.

Following is the code that I am using
radChart1.Series.Clear();
radChart1.IntelligentLabelsEnabled = true;
  
ChartSeries cs = new ChartSeries(); 
cs.Items.Add(new ChartSeriesItem(9000));
cs.Appearance.BarWidthPercent = 30;
  
cs.Appearance.FillStyle.MainColor = Color.Red;
cs.Appearance.FillStyle.SecondColor = Color.Red;
cs.Appearance.LabelAppearance.LabelLocation = Telerik.Charting.Styles.StyleSeriesItemLabel.ItemLabelLocation.Outside;
cs.Appearance.LabelAppearance.Position.AlignedPosition = Telerik.Charting.Styles.AlignedPositions.Left;
cs.Appearance.TextAppearance.TextProperties.Color = System.Drawing.Color.Green;
  
cs.Type = ChartSeriesType.StackedBar100;
radChart1.Series.Add(cs); 
ChartSeries cs1 = new ChartSeries(); 
cs1.Items.Add(new ChartSeriesItem(1000));
cs1.Appearance.LabelAppearance.Visible = false;
cs1.Appearance.FillStyle.MainColor = Color.Orange;
cs1.Appearance.FillStyle.SecondColor = Color.Orange;
cs1.Type = ChartSeriesType.StackedBar100;
radChart1.Series.Add(cs1);
radChart1.PlotArea.XAxis.Visible = Telerik.Charting.Styles.ChartAxisVisibility.False;
radChart1.PlotArea.YAxis.Visible = Telerik.Charting.Styles.ChartAxisVisibility.False;
radChart1.Legend.Visible = false;
radChart1.ChartTitle.Visible = false;
radChart1.Update();




Regards,
Arvind Robin Kumar.

1 Answer, 1 is accepted

Sort by
0
Accepted
Ves
Telerik team
answered on 12 Aug 2010, 10:36 AM
Hi Arvind,

Please use TopLeft instead:

cs.Appearance.LabelAppearance.Position.AlignedPosition = Telerik.Charting.Styles.AlignedPositions.TopLeft
;

Sincerely,
Ves
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
Chart (obsolete as of Q1 2013)
Asked by
Arvind
Top achievements
Rank 1
Answers by
Ves
Telerik team
Share this question
or