I have created a a bar chart having 2 Y axis
I need to assign a different toolTip to each series
when using :
e.SeriesItem.ActiveRegion.Tooltip = toolTip.ToString();
it assign the toolTip to the two seriesI found solution to assign tooltip to the first series
chart.Series[0].Items[e.SeriesItem.Index].ActiveRegion.Tooltip = toolTip.ToString();
but when using the same for the second series as follow:
chart.Series[1][e.SeriesItem.Index].ActiveRegion.Tooltip =
"Hi Series 2";
I get exception:
Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Source Error:
Line 459: RadChart chart = (RadChart) sender;
Line 460: chart.Series[0].Items[e.SeriesItem.Index].ActiveRegion.Tooltip = toolTip.ToString();
Line 461: chart.Series[1][e.SeriesItem.Index].ActiveRegion.Tooltip = "Hi Series 2";
|
The following is the complete code:
void
ChartFinancialImpact_ItemDataBound(object sender, ChartItemDataBoundEventArgs e)
{
DataRowView physicianDeviation = (DataRowView)e.DataItem;
StringBuilder toolTip = new StringBuilder();
toolTip.Append("Load:" + physicianDeviation["PhysicianLoad"].ToString() );
//e.SeriesItem.ActiveRegion.Tooltip = toolTip.ToString();
RadChart chart = (RadChart) sender;
chart.Series[0].Items[e.SeriesItem.Index].ActiveRegion.Tooltip = toolTip.ToString();
//chart.Series[1][e.SeriesItem.Index].ActiveRegion.Tooltip = "Hi Series 1"; ==> ERROR
}