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.

Showing TimeSpan in dd,hh:mm:ss format on Y axis

Thread ID:

Created:

Updated:

Platform:

Replies:

54132 Jan 2,2007 03:08 PM Jan 2,2007 08:14 PM Windows Forms 2
loading
Tags: Chart
Dmitry Scherbakov
Asked On January 2, 2007 03:08 PM

I need to show time spent on a process on the Y axis. The time that I have to show on Y is in seconds. I need to reformat labels on Y to dd,hh:mm:ss format.

The sample data would be as follows:

X Y
2006-12-05 2286
2006-12-06 3550
2006-12-08 954
2006-12-11 917
2006-12-12 7031

How do I do this?
Thanks
Dmitry

Dmitry Scherbakov
Replied On January 2, 2007 03:44 PM

I got the answer to this one. I should use ChartFormatAxisLabel event.

How can I format the ToolTip though?

Thanks
Dmitry

>I need to show time spent on a process on the Y axis. The time that I have to show on Y is in seconds. I need to reformat labels on Y to dd,hh:mm:ss format.

The sample data would be as follows:

X Y
2006-12-05 2286
2006-12-06 3550
2006-12-08 954
2006-12-11 917
2006-12-12 7031

How do I do this?
Thanks
Dmitry

Suresh Babu [Syncfusion]
Replied On January 2, 2007 08:14 PM

Hi Dmitry,

We appreciate you for finding the solution by yourself.

Here are the steps to format the TimeSpan in ToolTip. Please take a look into these steps.

1) Initialize the chart with data as you found.

2) Use the 'GetValueByPoint' method to get date time value from double and then convert the time span inside Chart control's MouseMove event. For example have a look at the following code.

[C#]
ChartPoint chpt = chartControl1.ChartArea.GetValueByPoint(new Point(e.X, e.Y));
string dx = chpt.DateX.ToShortDateString();
DateTime[] d = chpt.GetYValuesAsDateTime();
string dy = d[0].ToString("d,hh:mm:ss");

Please have a look into the Time span sample attached.

Let me know if this helps.

Thanks for using Syncfusion products.

Regards,
Sureshbabu

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.

;