We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

Regarding Mouse point in "X" axis equal to DateTime in "X" axis

Thread ID:

Created:

Updated:

Platform:

Replies:

58035 Mar 16,2007 05:12 AM Apr 5,2007 08:47 PM Windows Forms 4
loading
Tags: Chart
Sathishkumar Kaliavaradhan
Asked On March 16, 2007 05:12 AM

Hi All,

I need to very urgent help

I configured the my chart control with datetime in "X" axis interval fromdate and todate.

when i click on the chart control i want know equal datetime in "X" axis.

Please any help me very very urgent for me.

Thanks and Regards
K.Sathishkumar

Administrator [Syncfusion]
Replied On March 16, 2007 11:47 PM

Hi Sathishkumar,

Thank you for using Syncfusion products.

You can get the equal DateTime value of X-axis by mouse click on the chart control. Please refer to the following code snippet.

[ C# ]

private void chartControl1_MouseDown(object sender, MouseEventArgs e)
{

if (e.Button == MouseButtons.Left)
{
Point clickPoint = new Point(e.X, e.Y);
MessageBox.Show (this.chartControl1.ChartArea.GetValueByPoint(clickPoint).DateX.ToString(),"X-axis Date Time");
}
}

Please have a look at this sample and let me know if this helps you.

http://www.syncfusion.com/Support/user/uploads/DateTimeSample_6746ad12.zip



Regards,
Rajesh

k.sathishkumar
Replied On March 20, 2007 02:38 AM

Hi Rajesh,

Thanks so much for your answer...

Thanks and Regards
K.Sathishkumar

Andrew Mihalik
Replied On April 5, 2007 12:46 PM

Hi Rajesh,
You answered the question I attached below. Thank you for answering it. Do you know what the code snippet you posted would be in the Visual Basic .NET language? Like the user who originally posted the question, I, too, would like to get the DateTime on a chart's X-axis corresponding to a mouse click.
Thank you very much,
Andrew




Hi All,

I need to very urgent help

I configured the my chart control with datetime in "X" axis interval fromdate and todate.

when i click on the chart control i want know equal datetime in "X" axis.

Please any help me very very urgent for me.

Rajesh C [Syncfusion]
Replied On April 5, 2007 08:47 PM

Hi Andrew,

Thank you for using Syncfusion products.

Get the DateTime on a chart's X-axis corresponding to a mouse click. Please refer to the following VB.Net code snippet and attached samples.

[ VB.Net ]

Private Sub ChartControl1_ChartRegionMouseDown(ByVal sender As System.Object, ByVal e As Syncfusion.Windows.Forms.Chart.ChartRegionMouseEventArgs) Handles ChartControl1.ChartRegionMouseDown
Dim text As String
text = "X = " + Me.ChartControl1.ChartArea.GetValueByPoint(e.Point()).DateX.ToString() + Environment.NewLine
text = text + "Y = " + Me.ChartControl1.ChartArea.GetValueByPoint(e.Point()).YValues(0).ToString()
Me.ToolTip1.SetToolTip(Me.ChartControl1, text)
End Sub

Download a sample from following link :
http://websamples.syncfusion.com/samples/Chart.Windows/F58035/main.htm

Regards,
Rajesh

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;