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. Image for the cookie policy date
close icon

Date in tooltip

Hello,

We have to display in a tooltip the date and the value of our column.

Our chart use a class as datasource with "Date" as datetime and "Value" as double. There is no problem to display the chart.

Even if we have no problem to display the value, we can't display the Date, we use the Binding currSegment.DataPoint.X but it display something like 62235,12546.

Is it possible to use somethink like a converter of something ?


Thank in advance.



Have a nie day.



1 Reply

KK Krishna Kumar Syncfusion Team January 18, 2011 07:27 AM UTC

Hi Pallini,

Thanks for choosing Syncfusion products.

We have prepared the samples based on your query. The date time in tool tip can be displayed by converting the value displayed in that actual tool tip. The following code snippet shows how to display tool tip as date time format.

C#:

public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
{
double tempdate;
tempdate = Double.Parse(value.ToString());
DateTime datetime1 = DateTime.FromOADate(tempdate);
return datetime1.ToString();
}

XAML:

Create Instance:


Binding:


The below sample explains in detail, in that sample we created a class named DateTimeValueConverter which is inherited from IValueConverter interface. By using that we convert the actual tool tip value to date time value and by using binding we bind the object of DateTimeValueConverter class to Convert attribute of Textblock text attribute

Please find the sample from the following location.
http://www.syncfusion.com/uploads/redirect.aspx?&team=support&file=SampleSilverlightToolTipDemo1163829401.zip

Let me know if you have any questions.

Thanks,
Krishnakumar




Loader.
Live Chat Icon For mobile
Up arrow icon