Steema Issues Database

Note: This database is for bugs and wishes only. For technical support help, if you are a customer please visit our online forums;
otherwise you can use StackOverflow.
Before using this bug-tracker we recommend a look at this document, Steema Bug Fixing Policy.



Bug 2086

Summary: Custom legend text disappears when the Chart Margins are changed
Product: .NET TeeChart Reporter: sandra pazos <sandra>
Component: LegendAssignee: Steema Issue Manager <issuemanager>
Status: RESOLVED NOTABUG    
Severity: normal CC: chris
Priority: Normal    
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows   
URL: http://teechart.net/directline/viewtopic.php?f=6&t=1276
Chart Series: --- Delphi / C++ Builder RAD IDE Version:
Attachments: Show Legend problem

Description sandra pazos 2018-09-14 11:56:55 EDT
Created attachment 855 [details]
Show Legend problem

Custom legend text disappears when the Chart Margins are changed. The code below reproduce the problem:
public Form1()
	{
		InitializeComponent();

		//Add a fast line series
		FastLine fastline1 = new FastLine(tChart1.Chart);
			//Set some random values

			fastline1.FillSampleValues(10);
			tChart1.Legend.Transparent = false;
			tChart1.Legend.Pen.Visible = true;
			tChart1.DoubleClick += TChart1_DoubleClick;
	}

	private void TChart1_DoubleClick(object sender, EventArgs e)
	{
			tChart1.ShowEditor();
	}

	private void button1_Click(object sender, EventArgs e)
	{
			tChart1.Panel.MarginRight = 6;
			tChart1.Legend.CustomPosition = true;
			tChart1.Legend.Left = tChart1.Legend.Left;
		  tChart1.Legend.Top = tChart1.Legend.Top;
		}

Also, I have done a video to show exactly the problem.
Comment 1 christopher ireland 2018-09-24 03:49:33 EDT
This is by design and so not a bug. To change the behaviour of the chart please set the ClipText property to false, e.g.

		private void button1_Click(object sender, EventArgs e)
		{
			tChart1.Panel.MarginRight = 20;

			tChart1.Legend.ClipText = false;
			tChart1.Legend.CustomPosition = true;
			tChart1.Legend.Left = tChart1.Legend.Left;
			tChart1.Legend.Top = tChart1.Legend.Top;
		}