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

Chart Tooltips

2 Answers 102 Views
Chart (obsolete as of Q1 2013)
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
ASG
Top achievements
Rank 1
ASG asked on 27 Feb 2011, 08:11 PM
I'd like to add a tooltip while making the chart series item and then concatenate onto that tooltip the percent of the pie chart it is ("#%").  Is this possible?

So my tooltip is created as so:
csi.ActiveRegion.Tooltip = datarow["table_name"].ToString();

I would like to add on to the above the percent of the pie chart the item utilizes.  I imagine this would have to happen after all the items have been added (so that it can calculate the percent), but I don't see any method for adding to a tooltip at that point...

Thanks for your time

2 Answers, 1 is accepted

Sort by
0
ASG
Top achievements
Rank 1
answered on 28 Feb 2011, 03:09 AM
Ahh... So if you give your series item a name, you can then set ActiveRegionToolTip to #ITEM, #% and get the item's name with the percent it takes up in the pie chart.  As so:
ChartSeries tableRowsSeries = new ChartSeries();
tableRowsSeries.Name = "Table Rows";
tableRowsSeries.Type = ChartSeriesType.Pie;
tableRowsSeries.Appearance.LabelAppearance.Visible = false;
tableRowsSeries.ActiveRegionToolTip = "#ITEM : #%";
 
foreach (DataRow dr in dt.Rows)
{
  dataRows = Convert.ToInt32(dr["Rows"]);
 
  ChartSeriesItem csi = new ChartSeriesItem();
  csi.YValue = dataRows;
  csi.Name = dr["Table Name"].ToString();
   
  tableRowsSeries.AddItem(csi);
}
 
radChart1.Series.Add(tableRowsSeries);
0
Evgenia
Telerik team
answered on 02 Mar 2011, 04:46 PM
Hello,

We are glad that the issue you were facing is now resolved. Let us know if anything else arises.
 
All the best,
Evgenia
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!
Tags
Chart (obsolete as of Q1 2013)
Asked by
ASG
Top achievements
Rank 1
Answers by
ASG
Top achievements
Rank 1
Evgenia
Telerik team
Share this question
or