text disappearing from annotation/rectangle tool

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
DieterDHoker
Newbie
Newbie
Posts: 7
Joined: Fri Sep 07, 2007 12:00 am

text disappearing from annotation/rectangle tool

Post by DieterDHoker » Tue May 05, 2009 8:37 am

Hi,

I have a chart with multiple fastline series. I display a rectangle tool on the chart and update the text dynamically when a user clicks a series. Everything works fine until I deselect all but one serie in the ChartListBox,
then the text disappears from the rectangle tool. Though when doubleclicking the tool to edit the text, the text is there in the editbox. Also when changing the text in the tool by clicking another point on the remaining serie you see it resizing. Only no text can be seen. When reselecting a second serie in the ChartListBox the text is there again.


The code I use to create the rectangel tool:

Code: Select all

            this.m_resultAnnotation = new Steema.TeeChart.Tools.RectangleTool();
            this.m_resultAnnotation.AllowDrag = true;
            this.m_resultAnnotation.AllowEdit = true;
            this.m_resultAnnotation.AutoSize = true;
            this.m_resultAnnotation.Shape.Transparency = 50;
            this.m_resultAnnotation.Text = text;
            this.m_resultAnnotation.Position = Steema.TeeChart.Tools.AnnotationPositions.RightTop;
            this.m_resultAnnotation.Shape.Shadow.Visible = true;
            this.m_resultAnnotation.Cursor = Cursors.Hand;
            this.tChart1.Tools.Add(this.m_resultAnnotation);
(I use to use the annotation tool first, same problem there.)

I'm using Teechart version 3.5.3371.26405

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Wed May 06, 2009 10:38 am

Hi DieterDHoker,

I'm not able to reproduce the issue here using code below. Using a ChartListBox instead of legend checkboxes makes no difference. Could you please modify the code snippet below and let us know the exact steps we should follow so that we can reproduce the issue here?

Code: Select all

		public Form1()
		{
			InitializeComponent();
			InitializeChart();
		}

		private Steema.TeeChart.Tools.RectangleTool rectangle1;

		private void InitializeChart()
		{
			for (int i = 0; i < 5; i++)
			{
				tChart1.Series.Add(new Steema.TeeChart.Styles.FastLine());
				tChart1[i].FillSampleValues();
			}

			rectangle1 = new Steema.TeeChart.Tools.RectangleTool(tChart1.Chart);
			rectangle1.Text = "No series selected";
			rectangle1.AutoSize = true;

			tChart1.ClickSeries += new Steema.TeeChart.TChart.SeriesEventHandler(tChart1_ClickSeries);
			tChart1.Legend.CheckBoxes = true;
		}

		void tChart1_ClickSeries(object sender, Steema.TeeChart.Styles.Series s, int valueIndex, MouseEventArgs e)
		{
			rectangle1.Text = s.Title;
		}
Thanks in advance.
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

DieterDHoker
Newbie
Newbie
Posts: 7
Joined: Fri Sep 07, 2007 12:00 am

Post by DieterDHoker » Wed May 06, 2009 1:25 pm

Hi,

I took me a while to reproduce it using the testprogramm, but here the clue was using the ChartListBox while NOT using the legend checkboxes. (if you use both everything works ok)

so your code would become:

Code: Select all

        public Form1()
        {
            InitializeComponent();
            InitializeChart();
        }

        private Steema.TeeChart.Tools.RectangleTool rectangle1;

        private void InitializeChart()
        {
            for (int i = 0; i < 5; i++)
            {
                tChart1.Series.Add(new Steema.TeeChart.Styles.FastLine());
                tChart1[i].FillSampleValues();
            }

            rectangle1 = new Steema.TeeChart.Tools.RectangleTool(tChart1.Chart);
            rectangle1.Text = "No series selected";
            rectangle1.AutoSize = true;

            tChart1.ClickSeries += new Steema.TeeChart.TChart.SeriesEventHandler(tChart1_ClickSeries);
            //tChart1.Legend.CheckBoxes = true;
        }

        void tChart1_ClickSeries(object sender, Steema.TeeChart.Styles.Series s, int valueIndex, MouseEventArgs e)
        {
            rectangle1.Text = s.Title;
        }
(+ CharListBox added in the designer)

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Wed May 06, 2009 1:45 pm

Hi DieterDHoker,

Thanks for the information but I'm still unable to reproduce it. Could you please let me know the exact steps I should follow to reproduce the issue here?

Thanks in advance.
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

DieterDHoker
Newbie
Newbie
Posts: 7
Joined: Fri Sep 07, 2007 12:00 am

Post by DieterDHoker » Wed May 06, 2009 3:06 pm

Hi, I uploaded a visual studio project of a test app where i could reproduce the problem with to:

http://dieterdhoker.free.fr/temp/TestTchart.zip

this also includes my debug build.

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Thu May 07, 2009 9:10 am

Hi DieterDHoker,

Thanks for the example project. Finally found the difference between it and my code. What makes the difference is this line:

Code: Select all

			tChart1.Legend.Alignment = Steema.TeeChart.LegendAlignments.Bottom;
Aligning the legend to the right of the chart solves the problem. Anyway, I've added the issue (TF02014135) to the defect list to be investigated for future releases.
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Post Reply