Page 1 of 1

Panel color in TChart

Posted: Tue Feb 08, 2011 4:38 am
by 16458507
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.

Re: Panel color in TChart

Posted: Wed Feb 09, 2011 4:23 pm
by yeray
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.

Re: Panel color in TChart

Posted: Thu Feb 24, 2011 2:04 am
by 10550286
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;

Re: Panel color in TChart

Posted: Fri Feb 25, 2011 11:37 am
by yeray
Hi Sam,

You are right. I've added it to the wish list to be studied asap (TV52015419).

Re: Panel color in TChart

Posted: Fri Mar 04, 2011 12:08 pm
by 10553945
Same problem here with the white panel (Win7, TeeChart 2011). Any idea about a maintenance release date?

Best, Uli

Re: Panel color in TChart

Posted: Fri Mar 04, 2011 12:46 pm
by 10050769
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,

Re: Panel color in TChart

Posted: Mon Mar 28, 2011 1:08 pm
by yeray
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 19372 times
With the TV52015430 fix:
TV52015430.png
TV52015430.png (8.4 KiB) Viewed 19354 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;

Re: Panel color in TChart

Posted: Mon Apr 04, 2011 9:02 am
by 10553945
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

Re: Panel color in TChart

Posted: Mon Apr 04, 2011 9:32 am
by narcis
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!

Re: Panel color in TChart

Posted: Mon Apr 04, 2011 1:27 pm
by 10553945
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

Re: Panel color in TChart

Posted: Mon Apr 04, 2011 1:47 pm
by narcis
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;

Re: Panel color in TChart

Posted: Thu Apr 28, 2011 2:08 pm
by 10553945
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

Re: Panel color in TChart

Posted: Fri Apr 29, 2011 1:51 pm
by narcis
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.