ItemToolTipFormat Date

2 posts, 0 answers
  1. Dinko
    Dinko avatar
    1 posts
    Member since:
    Jul 2010

    Posted 16 Jul 2010 Link to this post

    Hello,

    I seem to not be able to display date in the tool tip. Here is a snippet of the code that I have:

     

     

    DataSeries ds = new DataSeries();

     

    ds.Definition =

     

    new SplineSeriesDefinition();

     

     

     

    ds.Definition.ShowItemToolTips = true;

     

    ds.Definition.ItemToolTipFormat =

     

    "Date: #X{D}\r\nValue: #Y{F2}";

     

    ds.Add(

     

    new DataPoint(DateTime.Parse("07/01/2010")) { YValue = 3.134 });

     

    ds.Add(

     

    new DataPoint(DateTime.Parse("07/02/2010")) { YValue = 2.828 });

     

    ds.Add(

     

    new DataPoint(DateTime.Parse("07/03/2010")) { YValue = 2.827 });

     

    ds.Add(

     

    new DataPoint(DateTime.Parse("07/04/2010")) { YValue = 2.752 });

     

    ds.Add(

     

    new DataPoint(DateTime.Parse("07/05/2010")) { YValue = 2.696 });

     

    ds.Add(

     

    new DataPoint(DateTime.Parse("07/06/2010")) { YValue = 2.718 });

     

    ds.Add(

     

    new DataPoint(DateTime.Parse("07/07/2010")) { YValue = 2.976 });

     

    TimeSeriesChartArea.DataSeries.Add(ds);


    When the chart is generated, I see the following when hovering over a data point

    Date:
    Value: 3.13

    As you can see, the Date is blank, while the value is displaying the correct data. I have tried several other formats (MM, yyyy, dd, etc), and all of them displayed blank.

    Please help,
    Dinko
  2. Nikolay
    Admin
    Nikolay avatar
    397 posts

    Posted 21 Jul 2010 Link to this post

    Hi Dinko,

    Please, find attached a sample application, which demonstrates how to achieve this.

    Hope this helps.

    Sincerely yours,
    Nikolay
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Back to Top