Legend values appear too close to legend colors

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
incadea
Newbie
Newbie
Posts: 20
Joined: Thu Jul 05, 2012 12:00 am

Legend values appear too close to legend colors

Post by incadea » Tue Jul 24, 2012 12:38 pm

Hello

I am creating a simple bar chart using Teechart.
I need to plot very big values on y axes. The problem with big values is that legend values
appear too close to legend colors. Following is my code:

Code: Select all

TChart chart= new Steema.TeeChart.TChart();
			System.Drawing.RectangleF r = new System.Drawing.RectangleF(0,0,this.View.Bounds.Width,this.View.Bounds.Height-42);						
			chart.Frame = r;

			Steema.TeeChart.Styles.Bar seriesBar = new Steema.TeeChart.Styles.Bar(chart.Chart);

			seriesBar.Add (20000000,"Aa");
			seriesBar.Add (32000000,"Bb");
			seriesBar.Add (90000000,"Cc");
			seriesBar.Add (6000000,"Dd");
			seriesBar.Add (40000000,"Ee");
			seriesBar.Add (85600000,"Ff");

			chart.Legend.Alignment = LegendAlignments.Bottom;
			chart.Legend.LegendStyle = LegendStyles.Values;
			chart.Legend.AutoSize = true;
			chart.Legend.Width = 950;
			chart.Legend.Transparent = true;
Increasing the Legend.Width does not make any difference.
Please let me know how can i add space between legend color and their values.

Thanks

incadea
Newbie
Newbie
Posts: 20
Joined: Thu Jul 05, 2012 12:00 am

Re: Legend values appear too close to legend colors

Post by incadea » Wed Jul 25, 2012 11:10 am

Hello,

After further analysis i have found the solution to my problem. Following is the source code:

Code: Select all

chart.Legend.Symbol.WidthUnits = LegendSymbolSize.Pixels;
            chart.Legend.Symbol.Width = 10;
            chart.Legend.TextSymbolGap = 6;
Thanks

Post Reply