Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

drawing a chart

Posted on 2000-04-13
9
Medium Priority
?
372 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
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
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 520 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: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone 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

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…
Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…
When cloud platforms entered the scene, users and companies jumped on board to take advantage of the many benefits, like the ability to work and connect with company information from various locations. What many didn't foresee was the increased risk…
Suggested Courses

783 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