ItemToolTip Problem with DataFormat

6 posts, 0 answers
  1. marcos
    marcos avatar
    11 posts
    Member since:
    Dec 2010

    Posted 10 Mar 2011 Link to this post

    Hey,

    I can't display the correct x-axis date value in the itemtooltip.
    Here are the interesting facts for you...

    I have a chart with thousands of points so i use:
    <telerik:AxisX AutoRange="True"...


    That's why in my ItemToolTip the first value works and the last not (because of this link this link):
    <telerik:LineSeriesDefinition ItemToolTipFormat="#X --> #DATAITEM.Date or #DATAITEM.Date{MM/dd/yyyy}"...


    But I can't use #X because it's from double type and the result is something like "42k" - but not a date!

    What kind of solution you can offer for my problem? Is there a posibility to convert the double to string inside xaml?
    (i can't use codebehind...)

    P.S. Sorry but I realized to late that I've posted this thread in WPF - its for Silverlight!!!
  2. Vladimir Milev
    Admin
    Vladimir Milev avatar
    1061 posts

    Posted 15 Mar 2011 Link to this post

    Hi marcos,

    This usually gets handled by RadChart out of the box. Its weird it didn't work in your case. Can you please try setting the IsDateTime property of the data point and see if this helps?

    Kind regards,
    Vladimir Milev
    the Telerik team
    Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
  3. marcos
    marcos avatar
    11 posts
    Member since:
    Dec 2010

    Posted 15 Mar 2011 Link to this post

    Okay, so the solution might be easy... Where I have to set the isDateTime property? You can have a look at my xaml-code:

    <telerik:RadChart ItemsSource="{Binding DetailData}" >
        <!-- define series -->
        <telerik:RadChart.SeriesMappings>
            <telerik:SeriesMapping LegendLabel="special Value">
                <telerik:SeriesMapping.SeriesDefinition>
                    <telerik:LineSeriesDefinition ShowPointMarks="False" ShowItemLabels="False" ShowItemToolTips="True" 
                                                  ItemToolTipFormat="Values #Y - #X - #X{dd.MM.yyyy} " />
                </telerik:SeriesMapping.SeriesDefinition>
                <telerik:SeriesMapping.ItemMappings>
                    <telerik:ItemMapping DataPointMember="XValue" FieldName="DATE_DOUBLE" />
                    <telerik:ItemMapping DataPointMember="YValue" FieldName="VALUE_NUMBER" />
                </telerik:SeriesMapping.ItemMappings>
            </telerik:SeriesMapping>
              
        </telerik:RadChart.SeriesMappings>
        <!-- legend stuff -->
        <telerik:RadChart.DefaultView>
            <telerik:ChartDefaultView>
                <telerik:ChartDefaultView.ChartLegend>
                    <telerik:ChartLegend x:Name="myLegend" LegendItemMarkerShape="Hexagon" Header=" "/>
                </telerik:ChartDefaultView.ChartLegend>
                  
                <telerik:ChartDefaultView.ChartArea>
                    <telerik:ChartArea LegendName="myLegend">
                        <telerik:ChartArea.AxisX>
                            <telerik:AxisX IsDateTime="True" DefaultLabelFormat="dd.MM.yyyy" LabelRotationAngle="270" />
                        </telerik:ChartArea.AxisX>
                    </telerik:ChartArea>
                </telerik:ChartDefaultView.ChartArea>
            </telerik:ChartDefaultView>
        </telerik:RadChart.DefaultView>
    </telerik:RadChart>

    Any Idea???

    Thanks,
    marcos
  4. marcos
    marcos avatar
    11 posts
    Member since:
    Dec 2010

    Posted 16 Mar 2011 Link to this post

    Here you can see a screenshot of my itemtooltip:
    ItemToolTipFormat="Values #Y - #X - #X{dd.MM.yyyy} "

  5. Evgenia
    Admin
    Evgenia avatar
    1437 posts

    Posted 18 Mar 2011 Link to this post

    Hi marcos,

    Your question was answered in this forum thread started by you.

    Best wishes,
    Evgenia
    the Telerik team
  6. Evgenia
    Admin
    Evgenia avatar
    1437 posts

    Posted 18 Mar 2011 Link to this post

    Hi marcos,

    Your question was answered in this forum thread started by you. 

    Best wishes,
    Evgenia
    the Telerik team
Back to Top