Page 1 of 1

Legend values appear too close to legend colors

Posted: Tue Jul 24, 2012 12:38 pm
by 17262900
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

Re: Legend values appear too close to legend colors

Posted: Wed Jul 25, 2012 11:10 am
by 17262900
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