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

Series with same value

3 Answers 81 Views
Chart (Obsolete)
This is a migrated thread and some comments may be shown as answers.
Paulo
Top achievements
Rank 1
Paulo asked on 08 Jun 2012, 01:34 PM
I have a chart with line series. It happens that the series starting with the same values​​, or close to, the labels are mixed not giving to differentiate from one another. How do I space the value labels of the series?

3 Answers, 1 is accepted

Sort by
0
Accepted
Evgenia
Telerik team
answered on 12 Jun 2012, 10:58 AM
Hi Paulo,

 This can be achieved with our Intelligent Labels feature.

All the best,
Evgenia
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
0
Paulo
Top achievements
Rank 1
answered on 12 Jun 2012, 12:25 PM
I could not. Below my code. Where do I put the Intelligent Labels? I tried in several places in the code and nothing.

 

RadChart criaGrafico(ComparativoEmissoresBL bl)

{

 

RadChart radChart1 = new RadChart();

radChart1.Height = 400;

radChart1.Width = 1024;

radChart1.ChartTitle.TextBlock.Text = bl.nomeTituloChart;

radChart1.ChartTitle.TextBlock.Appearance.Position.AlignedPosition = Telerik.Charting.Styles.

 

AlignedPositions.Center;

radChart1.ChartTitle.Appearance.Dimensions.AutoSize =

 

false;

radChart1.ChartTitle.Appearance.Dimensions.Height = 50;

radChart1.ChartTitle.Appearance.Dimensions.Width = 750;

radChart1.ChartTitle.Appearance.Dimensions.Margins.Left = Telerik.Charting.Styles.

 

Unit.Percentage(5);

radChart1.ChartTitle.Appearance.Dimensions.Margins.Right = Telerik.Charting.Styles.

 

Unit.Percentage(5);

radChart1.Legend.Appearance.Position.AlignedPosition = Telerik.Charting.Styles.

 

AlignedPositions.Bottom;

radChart1.Legend.Appearance.Overflow = Telerik.Charting.Styles.

 

Overflow.Row;

radChart1.Legend.Appearance.Dimensions.AutoSize =

 

false;

radChart1.Legend.Appearance.Dimensions.Height = 25;

radChart1.Legend.Appearance.Dimensions.Width = 400;

radChart1.Legend.Appearance.Border.Color = System.Drawing.

 

Color.Transparent;

radChart1.Legend.Appearance.Position.AlignedPosition = Telerik.Charting.Styles.

 

AlignedPositions.Bottom;

radChart1.Legend.TextBlock.Appearance.Position.AlignedPosition = Telerik.Charting.Styles.

 

AlignedPositions.Center;

radChart1.PlotArea.Appearance.FillStyle.FillType = Telerik.Charting.Styles.

 

FillType.Solid;

radChart1.PlotArea.Appearance.FillStyle.MainColor = System.Drawing.

 

Color.Transparent;

radChart1.PlotArea.Appearance.Border.Visible =

 

false;

radChart1.PlotArea.Appearance.Dimensions.Margins.Top = Telerik.Charting.Styles.

 

Unit.Percentage(20);

radChart1.PlotArea.Appearance.Dimensions.Margins.Bottom = Telerik.Charting.Styles.

 

Unit.Percentage(30);

radChart1.PlotArea.Appearance.Dimensions.Margins.Left = Telerik.Charting.Styles.

 

Unit.Percentage(5);

radChart1.PlotArea.Appearance.Dimensions.Margins.Right = Telerik.Charting.Styles.

 

Unit.Percentage(5);

radChart1.PlotArea.Appearance.Dimensions.Width = 800;

 

// Telerik.Charting.Styles.Unit.Pixel(400);

radChart1.PlotArea.XAxis.LayoutMode = Telerik.Charting.Styles.

 

ChartAxisLayoutMode.Inside;

radChart1.PlotArea.XAxis.AutoScale =

 

false;

radChart1.PlotArea.XAxis.IsZeroBased =

 

false;

radChart1.PlotArea.XAxis.Appearance.MajorGridLines.Visible =

 

false;

radChart1.PlotArea.XAxis.Appearance.TextAppearance.AutoTextWrap = Telerik.Charting.Styles.

 

AutoTextWrap.True;

radChart1.PlotArea.XAxis.Appearance.LabelAppearance.Position.AlignedPosition = Telerik.Charting.Styles.

 

AlignedPositions.Top;

radChart1.PlotArea.XAxis.Appearance.TextAppearance.TextProperties.Font =

 

new System.Drawing.Font("Arial", 8);

radChart1.Legend.Appearance.ItemMarkerAppearance.Dimensions.Width = 25;

radChart1.Legend.Appearance.ItemMarkerAppearance.Figure = Telerik.Charting.Styles.

 

DefaultFigures.Rectangle;

 

//ChartSeries chartSeries = new ChartSeries();

 

//Instacia as series que serão mostradas nos gráficos

 

ChartSeries chartSeries1 = radChart1.CreateSeries((DateTime.Now.Year - 3).ToString(), System.Drawing.Color.Blue, System.Drawing.Color.Blue, ChartSeriesType.Bar);

 

ChartSeries chartSeries2 = radChart1.CreateSeries((DateTime.Now.Year - 2).ToString(), System.Drawing.Color.Green, System.Drawing.Color.Green, ChartSeriesType.Bar);

 

ChartSeries chartSeries3 = radChart1.CreateSeries((DateTime.Now.Year - 1).ToString(), System.Drawing.Color.BlueViolet, System.Drawing.Color.BlueViolet, ChartSeriesType.Bar);

 

ChartSeries chartSeries4 = radChart1.CreateSeries("Variação " + (DateTime.Now.Year - 2).ToString() + "-" + (DateTime.Now.Year - 1).ToString(), System.Drawing.Color.Red, System.Drawing.Color.Red, ChartSeriesType.Line);

chartSeries1.Type =

 

ChartSeriesType.Bar;

chartSeries2.Type =

 

ChartSeriesType.Bar;

chartSeries3.Type =

 

ChartSeriesType.Bar;

chartSeries4.Type =

 

ChartSeriesType.Line;

 

//A orientação do gráfico

radChart1.SeriesOrientation =

 

ChartSeriesOrientation.Vertical;

radChart1.Legend.Appearance.Overflow = Telerik.Charting.Styles.

 

Overflow.Row;

radChart1.Legend.Appearance.Position.AlignedPosition = Telerik.Charting.Styles.

 

AlignedPositions.Bottom;

radChart1.PlotArea.XAxis.AddRange(1, bl.stringArrayEmissores.Length, 1);

 

for (int i = 0; i < bl.stringArrayEmissores.Length; i++)

{

radChart1.PlotArea.XAxis[i].TextBlock.Text = bl.stringArrayEmissores[i];

}

chartSeries1.SetValues(bl.doubleArray2008);

chartSeries2.SetValues(bl.doubleArray2009);

chartSeries3.SetValues(bl.doubleArray2010);

chartSeries4.SetValues(bl.doubleArrayVariacao);

 

return radChart1;

}

0
Paulo
Top achievements
Rank 1
answered on 12 Jun 2012, 01:11 PM
I resolved:

radChart1.IntelligentLabelsEnabled = true;

Thanks for all.
Tags
Chart (Obsolete)
Asked by
Paulo
Top achievements
Rank 1
Answers by
Evgenia
Telerik team
Paulo
Top achievements
Rank 1
Share this question
or