Board index » delphi » Chart FX doesn't accept my data - part 2

Chart FX doesn't accept my data - part 2

{My first attemp was partly flushed, therefore another try}

I am trying to create a chart that uses data from a query. But I simply
do not manage to get the chart accept the data I provide it with: it doe
show a chart, but the data are random - and not mine...
The code I use is:

procedure TForm1.XXX;
var i : integer;
begin
  ...
  with Chart1 do
  begin
    ...
    OpenData[COD_VALUES] := MakeLong(1, QueryWithData);
    i := 0;
    QueryWithData.First;
    while not QueryWithData do
    begin
      Value[i] := QueryWithData.FieldByName('Y_VALUE').AsInteger        
      inc(i);
      QueryWithData.Next;
    end;
    CloseData[] := 0;
    ...
  end;
..
end;

On using Delphi's watch function, it shows that the "Chart1.Value[i]"
doesn't get a value!!!

What am I doing wrong? (Or is Chart FX indeed a demo, and does not accept
real data...)

Thanks in advance,

Geert-Jan van Moorsel

 

Re:Chart FX doesn't accept my data - part 2


In article <49kni2$...@ns.molyvos.net> Geert-Jan van Moorsel <ppcn...@molyvos.net> writes:

Quote
>From: Geert-Jan van Moorsel <ppcn...@molyvos.net>
>Subject: Chart FX doesn't accept my data - part 2
>Date: 30 Nov 1995 16:53:22 GMT
>{My first attemp was partly flushed, therefore another try}
>I am trying to create a chart that uses data from a query. But I simply
>do not manage to get the chart accept the data I provide it with: it doe
>show a chart, but the data are random - and not mine...
>The code I use is:
>procedure TForm1.XXX;
>var i : integer;
>begin
>  ...
>  with Chart1 do
>  begin
>    ...
>    OpenData[COD_VALUES] := MakeLong(1, QueryWithData);

                                         ^^^^^^^^^^^^^^
This ought to be the number of data points in your series.

Quote
>    i := 0;
>    QueryWithData.First;
>    while not QueryWithData do
>    begin
>      Value[i] := QueryWithData.FieldByName('Y_VALUE').AsInteger        
>      inc(i);
>      QueryWithData.Next;
>    end;
>    CloseData[] := 0;

CloseData[COD_Values] := 0;

Quote
>    ...
>  end;
>..
>end;

>On using Delphi's watch function, it shows that the "Chart1.Value[i]"
>doesn't get a value!!!
>What am I doing wrong? (Or is Chart FX indeed a demo, and does not accept
>real data...)

ChartFX (version 2) coming with Delphi works alright.
There is a version 3.0 demo which does everything but accept data. Check the
version numbers.

Quote
>Thanks in advance,
>Geert-Jan van Moorsel

With the above modifications your routine should work

Hope that helps

Stefan
Stefan.Hoffmeis...@Uni-Passau.de

Other Threads