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

Chart FX doesn't accept my data

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 does
show a chart, but the data are random - and not mine...
The code I use is:

with Chart1 do
begin
  ...
  OpenData[COD_VALUES] := MakeLong(1, QueryWithData);

while  

 

Re:Chart FX doesn't accept my data


Geert-Jan van Moorsel <ppcn...@molyvos.net> wrote:

Quote
>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 does
>show a chart, but the data are random - and not mine...
>The code I use is:

>with Chart1 do
>begin
>  ...
>  OpenData[COD_VALUES] := MakeLong(1, QueryWithData);

>while  

You may want to check the name of the control.  I had to make sure Delphi
called it TChartFX which gave me ChartFX1 when I placed the control.

What exactly is "QueryWithData?"  It should be an integer specify the
number of points.  The exact format of OpenData is

Chart1.OpenData[COD_VALUES] := MakeLong(Series,Points);

All OpenData does is tell ChartFX that you're going to send it data.  You
do that like this:

for Counter = 0 to Series - 1 do
begin
  Chart1.ThisSerie := Counter;
  for Counter1 := 0 to Points - 1 do
  begin
    Chart1.Value[Counter1] := Value_From_Query;
  end;
end;
Chart1.CloseData[COD_VALUES] := 0;

Be sure to include the CloseData call or the chart will not show anything
except the random data you already see.

With the OpenData call you can also pass the COD_RESETMINMAX ($80)
constant to make the chart re-calibrate itself.  It would like this:

Chart1.OpenData[COD_VALUES or COD_RESETMINMAX] := MakeLong(Series,Points)

The company I work for (Tri-Star Duplicators, Inc.) is getting ready to
release a graphing package based on ChartFX (upgrade version) and I had
to get know the control.  If you need if anymore help just let me know.

Dale Merrick
tris...@vci.net

Other Threads