Solved

drawing a chart

Posted on 2000-04-13
9
365 Views
Last Modified: 2010-05-18
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
0
Comment
Question by:Oli2
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
9 Comments
 
LVL 2

Expert Comment

by:PeterLarsen
ID: 2711410
Have you tried :

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

Peter
0
 
LVL 13

Expert Comment

by:Epsylon
ID: 2711553
Draw in a ScrollBox...
0
 
LVL 2

Expert Comment

by:mullet_attack
ID: 2711954
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...
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 1

Author Comment

by:Oli2
ID: 2712052
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
0
 
LVL 13

Accepted Solution

by:
Epsylon earned 130 total points
ID: 2712534
Then draw on the canvas of a Timage bitmap.

Drop a TImage in a Scrollbox (e.g. 250x250 in size) and try this code:

procedure TForm1.Button1Click(Sender: TObject);
var pl: array[0..9] of TPoint;
    i: Integer;
begin
  Image1.AutoSize := true;
  with Image1.Picture.Bitmap do
  begin
    Width := 500;
    Height := 500;
    Randomize;
    for i := 0 to 9 do
    begin
      pl[i].x := i * 50;
      pl[i].y := Random(200) + 100;
    end;
    Canvas.PolyBezier(pl);
  end;
end;
0
 
LVL 13

Expert Comment

by:Epsylon
ID: 2712588
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;
0
 
LVL 1

Author Comment

by:Oli2
ID: 2712871
Hi, Epsylon!
This sounds good to me.
I'll check it out.

Regards, Oli
0
 
LVL 4

Expert Comment

by:jeurk
ID: 2715406
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...
0
 
LVL 1

Author Comment

by:Oli2
ID: 2715499
Hi, Epsylon.
I tried it out and it works fine for me.
Thanx.

Thanx also to all others trying to help.

Regards, Oli
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…

734 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question