Page 1 of 1

Series Gradient problem

Posted: Thu Feb 04, 2010 9:37 am
by 10552894
Hello.
I have a problem using Gradient object.
I create a bar series from code and edit it setting gradient using ChartEditor.
Then I want to change my gradient color from code, and there appears exception.
Debugger says, that bsMySeries->Gradient for some reason is NULL.

Code: Select all

   
TBarSeries* bsMySeries = (TBarSeries*) Chart1->Series[0];
bsMySeries->Gradient->Visible = true;
bsMySeries->Gradient->StartColor = clGreen;
I'm using version 8.06.
Please help.
Bart.

Re: Series Gradient problem

Posted: Thu Feb 04, 2010 4:19 pm
by narcis
Hi Bart,

Code below works fine for me here:

Code: Select all

  Series1->BarStyle=bsRectGradient;
  Series1->Gradient->Visible=True;
  Series1->Gradient->StartColor=clGreen;
Does it work fine at your end? Does the problem occurs in a Delphi project? This could be a known C++ Builder subproperties alignment issue. We suspect that it could happen only with updated projects from earlier C++Builder versions. We are aware that there are some problems with code aligning when generating *.hpp and *.objc files for C++ Builder using dcc32 (Delphi compiler). Those problems usually are totally random but most visible with some subproperties which don't return a valid pointer. Hence some random Access Violation errors. This is a known C++ Builder error as you can see in the Quality Central entries below. This issue was supposed to be fixed in C++ Builder 2009 but it is not working perfectly yet.

http://qc.embarcadero.com/wc/qcmain.aspx?d=47943
http://qc.embarcadero.com/wc/qcmain.aspx?d=46158
http://qc.embarcadero.com/wc/qcmain.aspx?d=27917
http://qc.embarcadero.com/wc/qcmain.aspx?d=653

In some cases we found that the solution was creating a new project and adding your existing unit to it.

Hope this helps!