Solved

drawing a chart

Posted on 2000-04-13
9
361 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
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
Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Mydac connection data base issue 3 166
Path  to current project in Delphi. 2 91
Downloading email attachments 2 79
Adoquery sql  left join does not work 25 98
The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

809 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