Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Question about TChart

Posted on 2010-09-23
4
Medium Priority
?
467 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 38

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 2000 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

Enroll in October's Free Course of the Month

Do you work with and analyze data? Enroll in October's Course of the Month for 7+ hours of SQL training, allowing you to quickly and efficiently store or retrieve data. It's free for Premium Members, Team Accounts, and Qualified Experts!

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…
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…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…
Suggested Courses

609 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