Solved

drawing a chart

Posted on 2000-04-13
9
363 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
Industry Leaders: 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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say 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

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…
Finding and deleting duplicate (picture) files can be a time consuming task. My wife and I, our three kids and their families all share one dilemma: Managing our pictures. Between desktops, laptops, phones, tablets, and cameras; over the last decade…

726 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