Link to home
Start Free TrialLog in
Avatar of Oli2
Oli2

asked on

drawing a chart

Hi,
this question will be hard to explain, but I'll give it a shot

I want to draw a chart,
using SetPixel, to show the performance of some program.

I set the "top" of the pixel regarding to the performance and increase the "left" of the (next) pixel by one every second.

Get it?

okay. Here's my problem: I don't want to use 1024 pixels in width, so I should somehow "scroll" the chart.

Anyone got a clue, idea, etc.?

Regards, Oli
Avatar of PeterLarsen
PeterLarsen

Have you tried :

Chart1.BottomAxis.Scroll(1, false);
...
Chart1.BottomAxis.Scroll(-1, false);
...
Chart1.LeftAxis.Automatic:=true;
Chart1.BottomAxis.Automatic:=true;

Peter
Draw in a ScrollBox...
Is what you are after a moving graph that looks like the performance monitor graph in NT Task monitor?

If so, post your e-mail address, I have a component that does that...
Avatar of Oli2

ASKER

Peter -> sorry, I don't want to use a TChart Component.
Epsylon -> drawing on a TScrollBox was my first idea also, but if you set Pixels on a ScrollBox and minimize the window... they're gone!
mullet -> yep, something like that NT performance monitor is in my mind. email is oscheit@quoka.com.
Maybe the source of that component will help me... In that case you'll get the points

regards, Oli
ASKER CERTIFIED SOLUTION
Avatar of Epsylon
Epsylon

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
You can also manipulate the bitmap directly:

procedure TForm1.Button2Click(Sender: TObject);
const DELTA = 25;
begin
  with Image1.Picture.Bitmap do
  begin
    Canvas.CopyRect(Bounds(0,0, 500 - DELTA, 500), Canvas, Bounds(DELTA, 0, 500 - DELTA, 500));
    Canvas.FillRect(Bounds(500 - DELTA, 0, DELTA, 500));
  end;
end;
Avatar of Oli2

ASKER

Hi, Epsylon!
This sounds good to me.
I'll check it out.

Regards, Oli
Hello,
what about using a component like this one :
http://www.fi.muni.cz/~xkovalc/zip/loggraph.zip
It's doing the job for you...
Avatar of Oli2

ASKER

Hi, Epsylon.
I tried it out and it works fine for me.
Thanx.

Thanx also to all others trying to help.

Regards, Oli