Solved

Question about TChart

Posted on 2010-09-23
4
465 Views
Last Modified: 2012-05-10
Hi,

On the y-axis I want the numbers 0 to 35.
And at number 4 and 10 and need to draw
a baseline. is it possible? Can someone help
me with this?

Greetings, Peter Kiers
0
Comment
Question by:peterkiers
[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
  • 2
4 Comments
 
LVL 37

Expert Comment

by:Geert Gruwez
ID: 33751532
is it possible ?
in short yes

tchart can dynamically set itself to dataset max and min values
you could add a second series with manually created dataset
0
 
LVL 1

Author Comment

by:peterkiers
ID: 33751599

Hi Geert,

Could you please tell me how to get the numbers 0 to 35 on the y-axis?

Be back later
0
 
LVL 25

Accepted Solution

by:
epasquier earned 500 total points
ID: 33751801
I'm not sure we have the same TChart component, I used the one in Delphi 2007 (v7.1 from Steema Software). Even if you don't have the same component the principle should remain the same.

* Add 2 series for your chart, these will be your 2 lines at 4 and 10 in the Y axis.
no data source, as the values will be created by code.
in fact I select the data source as Function y=f(x), without adding code for the calculate event.

* Set the LeftAxis properties : Minimum = 0 , Maximum = 34

* Add the following code to create the simple Y=4 & Y=10 charts
procedure TForm1.FormCreate(Sender: TObject);
Const
 MinX=0;
 MaxX=30;
begin
 With Chart.Series[0] do
  begin
   AddXY(MinX,4);
   AddXY(MaxX,4);
  end;
 With Chart.Series[1] do
  begin
   AddXY(MinX,10);
   AddXY(MaxX,10);
  end;
end;

Open in new window

TChart.gif
0
 
LVL 1

Author Comment

by:peterkiers
ID: 33752383
Thanks it works.

Greetings, Peter Kiers
0

Featured Post

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!

Question has a verified solution.

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

In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.

695 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