Stretchwickster
Programmer
Hi,
I'm experiencing a strange problem when adding y values that are less than 1 to a bar series.
This is the code I use to create and initialise the series:
This is the code I use to populate my series with data:
If I have fAmplitudeSpectrum.LeftAxis.Automatic set to True then the program freezes at runtime and the panel containing fAmplitudeSpectrum simply shows whatever is behind it i.e. it looks like it hasn't painted the TChart at all.
If I precede the population of the values above by the following line:
then it works fine, except that the y axis maximum is now 1 and consequently the small values I added are barely visible because of the scaling.
Therefore, I tried setting fAmplitudeSpectrum.LeftAxis.Automatic to False and I manually set the LeftAxis maximum to the highest value entered multiplied by 10%.
However, this also caused a freeze as above.
Has anyone experience any problems like this before?
Does anyone know of a fix/solution/workaround?
This has been giving me a headache for a while now so your help would be VERY MUCH appreciated!!!
Clive![[infinity] [infinity] [infinity]](/data/assets/smilies/infinity.gif)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
"To err is human, but to really foul things up you need a computer."
Paul Ehrlich
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
To get the best answers from this forum see: faq102-5096
I'm experiencing a strange problem when adding y values that are less than 1 to a bar series.
This is the code I use to create and initialise the series:
Code:
fSpectrumSeries := TBarSeries.Create(Self);
with fSpectrumSeries do
begin
BarPen.Visible := False;
CustomBarWidth := 6;
Marks.Visible := False;
Multibar := mbNone;
ParentChart := fAmplitudeSpectrum;
SideMargins := False;
end;
Code:
fAmplitudeSpectrum.Series[0].AddXY(1, 0.0158);
fAmplitudeSpectrum.Series[0].AddXY(2, 0.0024);
fAmplitudeSpectrum.Series[0].AddXY(3, 0.00078);
If I precede the population of the values above by the following line:
Code:
fAmplitudeSpectrum.Series[0].AddNullXY(1, 1, '');
Therefore, I tried setting fAmplitudeSpectrum.LeftAxis.Automatic to False and I manually set the LeftAxis maximum to the highest value entered multiplied by 10%.
Code:
fAmplitudeSpectrum.LeftAxis.Maximum := highestMagnitude * 1.1;
Has anyone experience any problems like this before?
Does anyone know of a fix/solution/workaround?
This has been giving me a headache for a while now so your help would be VERY MUCH appreciated!!!
Clive
![[infinity] [infinity] [infinity]](/data/assets/smilies/infinity.gif)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
"To err is human, but to really foul things up you need a computer."
Paul Ehrlich
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
To get the best answers from this forum see: faq102-5096