Panel color in TChart

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
RKetcham
Newbie
Newbie
Posts: 1
Joined: Mon Feb 07, 2011 12:00 am

Panel color in TChart

Post by RKetcham » Tue Feb 08, 2011 4:38 am

I just upgraded from TeeChart v8 to 2010 in C++Builder 2010, running under Windows 7 64-bit. After I did so, all of the charts in my application turned white; the panel color setting is no longer paid attenation to. I found I can get the colors back by using the gradient function. So, I guess I can use this for all of my charts, but I'm wondering if this change was intentional, or if this behavior indicates that there is something wrong with my installation?

Thanks.

Yeray
Site Admin
Site Admin
Posts: 9540
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: Panel color in TChart

Post by Yeray » Wed Feb 09, 2011 4:23 pm

Hi RKetcham,

Could you please try to arrange a simple example project we can run as-is to reproduce the problem here? Step-by-step instruction explaining how to proceed with that simple example application to see the problem would also be helpful.
Thanks in advance.
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

Sam F
Newbie
Newbie
Posts: 45
Joined: Wed Sep 10, 2008 12:00 am

Re: Panel color in TChart

Post by Sam F » Thu Feb 24, 2011 2:04 am

I have exactly the same issue.

I recently upgraded to from C++ builder 2007 to XE, and upgraded to TChart2011.

As mentioned above, the tchart backgrounds in existing projects have turned to white, rather than their normal clBtnFace. The behaviour of what a chart defaults to is different compared to a chart made in design time vs a dynamically created chart.

Dynamically created chart:
Will have a tchart with a white background and a white back wall. The back wall transparent propert defaults to true. Changing it to false produces a dark grey back wall.

Design time created chart:
If I make a new TChart in design time, it now defaults to a gradient background.
The back wall transparent property defaults to false.
The back wall gradient defaults to true.
Turning Panel->Gradient->Visible = false, products a white background.

Setting the Panel color has no effect. As near as I can tell, keeping the gradient visible, and setting the start and end colors is now the way to set the background color. Attach is a screen capture of what charts default to at design time (left) and dynamically created at run time. To return my dynamically created charts to what they were before, I'm now adding the following code:

Code: Select all

 Chart2->Gradient->Visible = true;
  Chart2->Gradient->StartColor = clBtnFace;
  Chart2->Gradient->EndColor = clBtnFace;
Attachments
TChartDesignVsDynamic.png
Design vs Dynamic created charts
TChartDesignVsDynamic.png (50.42 KiB) Viewed 18691 times

Yeray
Site Admin
Site Admin
Posts: 9540
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: Panel color in TChart

Post by Yeray » Fri Feb 25, 2011 11:37 am

Hi Sam,

You are right. I've added it to the wish list to be studied asap (TV52015419).
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

ulibru
Newbie
Newbie
Posts: 53
Joined: Tue Jul 21, 2009 12:00 am

Re: Panel color in TChart

Post by ulibru » Fri Mar 04, 2011 12:08 pm

Same problem here with the white panel (Win7, TeeChart 2011). Any idea about a maintenance release date?

Best, Uli

Sandra
Site Admin
Site Admin
Posts: 3132
Joined: Fri Nov 07, 2008 12:00 am

Re: Panel color in TChart

Post by Sandra » Fri Mar 04, 2011 12:46 pm

Hello Uli,

I can't still provide an estimate date.I recommend you to be aware at this forums board, our RSS news feed, twitter or facebook accounts for new release announcements and what's implemented on them.

Thanks,
Best Regards,
Sandra Pazos / 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

Yeray
Site Admin
Site Admin
Posts: 9540
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: Panel color in TChart

Post by Yeray » Mon Mar 28, 2011 1:08 pm

Hello Uli and Sam,

After investigating this we've concluded that it's not a bug.
In v2010 we wanted to give a better look to the new charts adding a gradient to the charts created at design time. However, we didn't want to change the aspect of the charts created at runtime to ensure backwards compatibility.
On the other hand in v2010.02 we found a related problem (TV52015430: "The back color (color of the panel) seems not to respond to the Chart.Color property"). This problem in v2010.02 has been recently solved

With v2010.02:
2010.02.png
2010.02.png (8.42 KiB) Viewed 18569 times
With the TV52015430 fix:
TV52015430.png
TV52015430.png (8.4 KiB) Viewed 18551 times
The fix will be available with the next maintenance release.

To create a "designtime looking" chart at runtime, you should set some properties manually:

Code: Select all

uses TeeThemes;

procedure TForm1.FormCreate(Sender: TObject);
var Chart2: TChart;
begin
  Chart2:=TChart.Create(Self);
  Chart2.Parent:=Self;
  Chart2.Left:=Chart1.Left + Chart1.Width;
  Chart2.Top:=Chart1.Top;
  Chart2.Width:=Chart1.Width;
  Chart2.Height:=Chart1.Height;
  // les dues linees a afegir.
  Chart2.Title.Text.Add(Chart2.ClassName);
  ApplyChartTheme(TOperaTheme,chart2);
end;
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

ulibru
Newbie
Newbie
Posts: 53
Joined: Tue Jul 21, 2009 12:00 am

Re: Panel color in TChart

Post by ulibru » Mon Apr 04, 2011 9:02 am

Hello Yeray,

as the next maintenance release is still not published I use the gradient solution for my designtime charts.
Now I also use the GridBand Tool with my charts. It is working fine on the screen but when I try to export a chart by the chart editor the gridband now turns into black and while stripes.
So it seems that with maintenance release V2011.02 something more has changed. The charts do not behave as before.

I hope the next release will come up soon and work as intended.

Best regards
Uli

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

Re: Panel color in TChart

Post by Narcís » Mon Apr 04, 2011 9:32 am

Hi Uli,
Now I also use the GridBand Tool with my charts. It is working fine on the screen but when I try to export a chart by the chart editor the gridband now turns into black and while stripes.
This works fine for me here using code snippet below with our current sources. Does this work fine for you?

Code: Select all

uses Series, TeeTools, TeeStore, TeeEditPro;

procedure TForm1.FormCreate(Sender: TObject);
var GridBand1: TGridBandTool;
    Stream: TMemoryStream;
begin
  Chart1.AddSeries(TLineSeries.Create(Self)).FillSampleValues;

  GridBand1:=TGridBandTool.Create(Self);
  GridBand1.Axis:=Chart1.Axes.Bottom;
  GridBand1.Band1.Color:=clBlue;
  GridBand1.Band2.Color:=clRed;

  Stream:=TMemoryStream.Create;
  SaveChartToStream(Chart1, Stream);

  Chart1.ClearChart;
  Stream.Position:=0;
  LoadChartFromStream(TCustomChart(Chart1), Stream);
end;
I hope the next release will come up soon and work as intended.
We expect this to be out very soon, stay tuned!
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

ulibru
Newbie
Newbie
Posts: 53
Joined: Tue Jul 21, 2009 12:00 am

Re: Panel color in TChart

Post by ulibru » Mon Apr 04, 2011 1:27 pm

Hi,

the gridband works fine in the designtime chart.
It looks like

Image

But the chart editor shows

Image

Also a print is wrong.

I guess it is also important to know that the transparancy for the grid bands is set to 98%

Best regards
Uli

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

Re: Panel color in TChart

Post by Narcís » Mon Apr 04, 2011 1:47 pm

Hi Uli,

Thanks for the information. I could reproduce the issue using code snippet below and added it (TV52015471) to the defect list to be investigated. At the example code below you'll find there's a way of exporting which preserves transparency and one not.

Code: Select all

uses Series, TeeTools, TeeStore, TeeBmpOptions;

procedure TForm1.FormCreate(Sender: TObject);
var GridBand1: TGridBandTool;
    Bitmap: TBitmap;
begin
  Chart1.AddSeries(TLineSeries.Create(Self)).FillSampleValues;

  GridBand1:=TGridBandTool.Create(Self);
  GridBand1.Axis:=Chart1.Axes.Bottom;
  GridBand1.Band1.Color:=clBlue;
  GridBand1.Band2.Color:=clRed;
  GridBand1.Band1.Transparency:=50;
  GridBand1.Band2.Transparency:=50;

  //Bitmap with transparency
  Bitmap:=Chart1.TeeCreateBitmap;
  Bitmap.SaveToFile('C:\temp\GridBandTest1.bmp');

  //Bitmap without transparency
  TeeSaveToBitmap(Chart1, 'C:\temp\GridBandTest2.bmp', Chart1.ChartBounds);
end;
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

ulibru
Newbie
Newbie
Posts: 53
Joined: Tue Jul 21, 2009 12:00 am

Re: Panel color in TChart

Post by ulibru » Thu Apr 28, 2011 2:08 pm

Hi Narcís,

the latest maintenance release has not solved the described problem.
Unfortunately I cannot use your proposed workaround. As the users shall still be able to save or print the bitmap by the chart editor.

Best regards
Uli

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

Re: Panel color in TChart

Post by Narcís » Fri Apr 29, 2011 1:51 pm

Hi Uli,

Yes, last maintenance release was built the very same day you reported the issue so we didn't have time to investigate it before it was released. I recommend you to be aware at this forum, our RSS news feed, twitter and facebook accounts for new release announcements and what's implemented on them.

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

Post Reply