Chart Colors Differ after Upgrade

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
Kris C
Newbie
Newbie
Posts: 59
Joined: Fri Jan 13, 2023 12:00 am

Chart Colors Differ after Upgrade

Post by Kris C » Fri Jan 20, 2023 12:43 pm

For the last several months I’ve been using the evaluation version of TeeChart v2022 waiting for the red tape to be cut and an upgrade made. Bentley finally purchased the upgrade. Due to an issue with installing the license, I compiled the source locally since we also purchased the source code. This removed the watermark.

The problem I’m running into is that our graphs do not look the same between the old version and the new version. The *only* thing that has changed is the upgrade with minor adjustments due to changes in API (how a Legend is set to Visible, etc.). How we construct and setup series in a graph has *not* changed. I was really hoping the change in colors was part of the evaluation version but I was apparently wrong.

Here is an example.

The first image is from our current release that uses v2009:
graph-preupgrade.png
Graph before upgrading to v2022
graph-preupgrade.png (32.79 KiB) Viewed 8301 times
This is the same graph after upgrading to TeeChart v2022:
graph-postupgrade.png
Graph after upgrading to v2022
graph-postupgrade.png (28.43 KiB) Viewed 8301 times
If the colors were simply a variation on the shade of grey, that would be one thing. But to go from grey to orange is something completely different. I checked our code and we are using Color.LightGrey. How does that translate into orange by anyone’s imagination?

Here are the graph options. Left is pre-upgrade and right is post-upgrade:
chartoptions-preandpost.png
Graph Options - Pre and Post Upgrade
chartoptions-preandpost.png (156.96 KiB) Viewed 8301 times
In the options on the right there is a series missing (HGL (Area)) and the colors are wrong.

This is a serious issue and not something I expected from upgrading.

What can I do to fix this on our end or is this something that needs to be fixed on your end?

Thanks,

Kris

Christopher
Guru
Posts: 1603
Joined: Fri Nov 15, 2002 12:00 am

Re: Chart Colors Differ after Upgrade

Post by Christopher » Fri Jan 20, 2023 1:00 pm

Hello Kris,

I would imagine that if you didn't specify series colours in your code, e.g.

Code: Select all

tChart1[0].Color = Color.Red;
then the colours are being read from the default theme, which has been changed over the years. Are you specifying series colours in your code?
Best Regards,
Christopher Ireland / 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

Kris C
Newbie
Newbie
Posts: 59
Joined: Fri Jan 13, 2023 12:00 am

Re: Chart Colors Differ after Upgrade

Post by Kris C » Fri Jan 20, 2023 6:50 pm

Yes. I have verified and debugged the code that assigns the colors for the series. They are 100% definitely being set.

I too have determined that the theme is at play here. I just don't know how to override it. At some point the theme overrides the colors assigned to the series.

The new theme I believe is Lookout. The old them seems to be Opera. I've tried setting the default theme in the TeeChart source to be Opera but that doesn't seem to make a difference (though I'm hoping for a solution that doesn't require modifying the source).

My next attempt is to make sure the Theme is set to Opera, or maybe none, in the InitializeComponent method when TChart is instantiated and see if that works.

Kris

Kris C
Newbie
Newbie
Posts: 59
Joined: Fri Jan 13, 2023 12:00 am

Re: Chart Colors Differ after Upgrade

Post by Kris C » Fri Jan 20, 2023 8:34 pm

Hi Christopher,

I dug into this some more and found several series where we were not assigning the Color property of the series but only the color of the brush or pen. This worked in v2009 so it must have been a bug that we inadvertently took advantage of. Once i assigned colors to these series in the graph, then the theme colors no longer got applied.

There is one last issue that needs to be fixed. If you look at the "Before upgrade" image in my original post, the area up and to the right above the [green] series is a grey color. For the life of me, I cannot figure out what this property is. I can't seem to find it in the chart options dialog, either.

I plan to give a demo showing the use of the upgraded TeeChart next week and if I leave that area white, I am going to be asked about it (that's how detailed my team is). So, is there a way to get that white to turn back to grey? If there is not, then that is what I will report but I need to ask the question.

Thanks,

Kris

Christopher
Guru
Posts: 1603
Joined: Fri Nov 15, 2002 12:00 am

Re: Chart Colors Differ after Upgrade

Post by Christopher » Mon Jan 23, 2023 7:53 am

Hello Kris,
I plan to give a demo showing the use of the upgraded TeeChart next week and if I leave that area white, I am going to be asked about it (that's how detailed my team is). So, is there a way to get that white to turn back to grey? If there is not, then that is what I will report but I need to ask the question.
As I'm sure you're aware, it is difficult for us to answer such questions without being able to reproduce the problem here. Is there any way you can create a new TeeChart project and using your production code attempt to reproduce this issue in it?
Best Regards,
Christopher Ireland / 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

Post Reply