This is a migrated thread and some comments may be shown as answers.

Chart tooltip

2 Answers 64 Views
Chart
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Tyler
Top achievements
Rank 1
Tyler asked on 03 Mar 2012, 04:02 PM

Please bear with me as I am new to programming –

I am having a difficult time with getting additional information into the chart tooltip. I am pulling data from isostore:/data.sdf to populate the graph (that part is fine) however what I am trying to do is add additional data from the data.sdf context into the tooltip that is not in the mySeries.ValueBinding & mySeries.CategoryBinding. I want to add property ‘Note’ and ‘DataPoint2’ to the tooltip.  

Here is the c#

 mySeries.CategoryBinding = new PropertyNameDataPointBinding() { PropertyName = "DateCreated" };

 mySeries.ValueBinding = new PropertyNameDataPointBinding() { PropertyName = "DataPoint1" };

 Here is the xaml

 <chart:BarSeries ShowLabels="True" CombineMode="Stack" ValueBinding="DataPoint1" ItemsSource="{Binding}">

 <chart:BarSeries.PointTemplate>

 <DataTemplate>

 <Rectangle Fill="{StaticResource PhoneForegroundBrush}" />

 </DataTemplate>

 </chart:BarSeries.PointTemplate>

 </chart:BarSeries >

2 Answers, 1 is accepted

Sort by
0
Victor
Telerik team
answered on 07 Mar 2012, 10:23 AM
Hi Tyler,

Thank you for writing.
Are you familiar with the tooltip help article? It contains a great example of how to create a custom object that is used as the tooltip data context. Basically you can put any information that you deem appropriate.

Please write again if you need further assistance.

Greetings,
Victor
the Telerik team
Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
0
Tyler
Top achievements
Rank 1
answered on 07 Mar 2012, 03:49 PM

Thank you for the replay – yes I have seen and was able to reproduce the example. But I was missing something when I try to get it to work the DataPoints index. I was able to make it work with a little help from a friend.

 CategoricalDataPoint pData = series.DataPoints[pointIndex];

 var data = from c in dbBP.Itmes where c.Id == (int)pData.Category select c;

Tags
Chart
Asked by
Tyler
Top achievements
Rank 1
Answers by
Victor
Telerik team
Tyler
Top achievements
Rank 1
Share this question
or