Hi,
I have created a bar chart using TeeChart.
I am able to change the bar color using the following code:
series.Color = Color.Red
However, the bar color cannot be changed using the above code when the bar value is changing at the same time.
The above code is working fine in TeeChart v2005, but fail to work in TeeChart v2010.
Please help.
Thanks.
Unable to change the bar color
Re: Unable to change the bar color
Hi mcpang,
I'm not sure about what do you mean with "at the same time". Are you using threads? Could you please send us a simple example project we can run as-is to reproduce the problem here?
Thanks in advance.
I'm not sure about what do you mean with "at the same time". Are you using threads? Could you please send us a simple example project we can run as-is to reproduce the problem here?
Thanks in advance.
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
Re: Unable to change the bar color
Yes, there is a thread to update the bar value.
I have done more debugging, and noticed the following:
The thread updates the bar value in 100ms interval.
For testing purpose, I changed the code to update the bar value at a longer interval (such as 5 secs), and I am able to change the bar color.
I didn't encounter this problem in TeeChartv2.
I have done more debugging, and noticed the following:
The thread updates the bar value in 100ms interval.
For testing purpose, I changed the code to update the bar value at a longer interval (such as 5 secs), and I am able to change the bar color.
I didn't encounter this problem in TeeChartv2.
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Re: Unable to change the bar color
Hi mcpang,
Can you please attach a simple example project we can run "as-is" to reproduce the problem here?
Thanks in advance.
Can you please attach a simple example project we can run "as-is" to reproduce the problem 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 |
Instructions - How to post in this forum |
Re: Unable to change the bar color
Hi,
Attached is simple test application to illustrate the problem.
I also noticed that if I commented off this line of code, it works.
series.Colors.Add(series.Color);
Thanks.
Attached is simple test application to illustrate the problem.
I also noticed that if I commented off this line of code, it works.
series.Colors.Add(series.Color);
Thanks.
- Attachments
-
- TestBarChart.zip
- (36.26 KiB) Downloaded 608 times
Re: Unable to change the bar color
Hi mcpang,
As you can see here,
As you can see here,
What you could do is to clear the Colors list to use the series' color again:Narcis wrote:if you populate a Pie series with a specific color for each slice it will prevail over series' color
Code: Select all
series1.Colors.Clear();
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
Re: Unable to change the bar color
Sorry, can you elaborate on what you have mentioned in the previous post regarding on the solution?
Thanks.
Thanks.
Re: Unable to change the bar color
Hello mcpang,
I think Yeray suggested you do is that you clean series list colors before change series color to red in click_button event:
So if you use previous code, you solve your problem and you don't need remove or comment next line of code:
I hope will helps.
Thanks,
I think Yeray suggested you do is that you clean series list colors before change series color to red in click_button event:
Code: Select all
private void button1_Click(object sender, EventArgs e)
{
series1.Colors.Clear();
series1.Color = Color.Red;
}
Code: Select all
series.Colors.Add(series.Color);
Thanks,
Best Regards,
Sandra Pazos / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |