Solved

drawing a chart

Posted on 2000-04-13
9
355 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
 
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
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
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

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

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 Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
This video discusses moving either the default database or any database to a new volume.
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

708 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now