All Products
Demos
Pricing
Services
Blogs
Docs & Support
Search
Shopping cart
Login
Contact Us
Get A Free Trial
close mobile menu
Telerik Forums
/
UI for Silverlight Forum
/
Chart
/
StackedBar100SeriesDefinition tooltip
Cancel
Telerik UI for Silverlight
Resources
Buy
Try
Feed for this thread
2 posts, 0 answers
Jingying Wu
22 posts
Member since:
Jul 2009
Posted 29 Jul 2009
Link to this post
I'm using 2 StackedBar100SeriesDefinition, one for pass, one for fail.
How do i show on the tooltip that the percentage of pass and fail?
Dwight
Admin
475 posts
Posted 31 Jul 2009
Link to this post
Hi Jingying Wu,
Currently, the chart does not support such formatting. Here is a work-around you can use:
public
Page()
{
InitializeComponent();
this
.RadChart1.DefaultView.ChartArea.ItemToolTipOpening +=
new
ItemToolTipEventHandler(ChartArea_ItemToolTipOpening);
}
private
void
ChartArea_ItemToolTipOpening(ItemToolTip2D tooltip, ItemToolTipEventArgs e)
{
DataSeriesCollection series =
this
.RadChart1.DefaultView.ChartArea.DataSeries;
double
sum = 0;
for
(
int
i = 0; i < series.Count; i++)
{
if
(series[i].Count > e.ItemIndex)
sum += series[i][e.ItemIndex].YValue;
}
tooltip.Content =
string
.Format(
"{0:p2}"
,e.DataPoint.YValue / sum);
}
Let me know if you need further assistance.
Kind regards,
Evtim
the Telerik team
Instantly find answers to your questions on the new
Telerik Support Portal
.
Check out the tips
for optimizing your support resource searches.
Back to Top
Close