Solved

Position on TChart

Posted on 2009-04-10
4
1,324 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

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
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…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…

757 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

17 Experts available now in Live!

Get 1:1 Help Now