Solved

Position on TChart

Posted on 2009-04-10
4
1,329 Views
Last Modified: 2013-11-23
hi there,

    I searched for a timeline component as in attachment (please find an attachment screenshot.jpg). Such timeline component is best suitable for my application. But unfortunately I did not get like timeline component. Could you please tell me where can I find such timeline component. If you also don't find such component, could you please tell me using what basic delphi components we can create the timeline component as in attachment.
                  Right now I am using TChart to create timeline component. I made marginleft, margintop, marginbottom, marginright to 0, hence chart1.width is equivalent to actual chart displaying area width. Here whatever the lines you are seeing in the timeline (please find an attachment screenshot1.jpg) are the series and I am able to draw the basic lines. In this timeline I want to provide "If user clicks on the chart I want to draw a vertical line on the clicked position of TChart showing that timeline has moved to user clicked position.  ChartMouseDown is giving X,Y of the Chart in pixels. Now I want to know at which position (not in pixels but in time line position number) I have to draw the line. Is there any direct function of the Chart to get the timeline position just by passing X,Y in pixels.
                   I did some calcuations (please find the code in the code section of this question) to find the timeline position depending on X,Y of chart in pixels, most of the times it is working correct, but not all the time.

                       Please help me.

               
X is the mouse down event parameter. p,q are extended type variables.
 

  p := (Chart1.BottomAxis.Maximum);

  q := Chart1.Width / p;

  x := Round((x / q));
 

  MySeries7.AddXY(x,Chart1.LeftAxis.Minimum);

  MySeries7.AddXY(x,Chart1.LeftAxis.Maximum);

Open in new window

screenshot.JPG
screenshot1.JPG
0
Comment
Question by:inampudi1
  • 3
4 Comments
 
LVL 11

Expert Comment

by:calinutz
ID: 24126790
0
 
LVL 11

Expert Comment

by:calinutz
ID: 24126795
0
 
LVL 11

Accepted Solution

by:
calinutz earned 500 total points
ID: 24180640
Well?
What do you think about my comments?
Were they helpfull?
0
 

Author Comment

by:inampudi1
ID: 24201898
                   Yes, It is helpful and has given me good information how to take processes information, but before your reply I solved my issue.
                                                                  Thank you.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

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…
This is a video describing the growing solar energy use in Utah. This is a topic that greatly interests me and so I decided to produce a video about it.
Need to grow your business through quality cloud solutions? With everything required to build a cloud platform and solution, you may feel like the distance between you and the cloud is quite long. Help is here. Spend some time learning about the Con…

932 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

13 Experts available now in Live!

Get 1:1 Help Now