TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
-
Srinivas Avancha
- Newbie
- Posts: 41
- Joined: Wed Jan 30, 2008 12:00 am
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
- 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.