Unable to change color on Line TeeChart, Version=3.5.3274.30

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
Srinivas Avancha
Newbie
Newbie
Posts: 41
Joined: Wed Jan 30, 2008 12:00 am

Unable to change color on Line TeeChart, Version=3.5.3274.30

Post by Srinivas Avancha » Tue Jan 06, 2009 3:20 pm

Hi,

Unable to change color on Steema.TeeChart.Styles.Line after it is initially set.

Used below code to change the color

Code: Select all

        private void line1_DblClick(object sender, MouseEventArgs e)
        {
            line1.Brush.Color = line1.Brush.Color == Color.Green ? Color.Blue : Color.Green;
            Text = string.Format("Line color set to {0}", line1.Brush.Color.Name);
        }
Best Regards
Srinivas Avancha.

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 Jan 07, 2009 9:25 am

Hi Srinivas,

Code below works fine for me here. Could you please try if it works fine at your end?

Code: Select all

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

		private Steema.TeeChart.Styles.Line line1;

		private void InitializeChart()
		{
			line1 = new Steema.TeeChart.Styles.Line(tChart1.Chart);
			line1.FillSampleValues();
			line1.Color = Color.Green;
			line1.DblClick += new MouseEventHandler(line1_DblClick);			
		}

		void line1_DblClick(object sender, MouseEventArgs e)
		{
			line1.Color = line1.Color == Color.Green ? Color.Blue : Color.Green;
			Text = string.Format("Line color set to {0}", line1.Color.Name);
			line1.Repaint();
		}
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

Srinivas Avancha
Newbie
Newbie
Posts: 41
Joined: Wed Jan 30, 2008 12:00 am

Post by Srinivas Avancha » Wed Jan 07, 2009 6:44 pm

Thanks for the solution, it works.

Post Reply