Keith Stephens
Top achievements
Rank 1
Keith Stephens
asked on 17 May 2011, 06:38 PM
Hello,
I followed the example here: http://demos.telerik.com/aspnet-ajax/controls/examples/integration/chartandtooltip/defaultcs.aspx?product=chart which uses a line chart. works fine in my bar chart for one series, but my chart has 2 series (Sold, and Proposed)
Is it possible to have the tooltip hover to show both series for the one employee.
My chart is that I have employee names along the x axis and amounts on the y axix and each employee has 2 series (Sold and Proposed) I want to hover my mouse over the bars but show both series values.
Thanks,
Keith.
I followed the example here: http://demos.telerik.com/aspnet-ajax/controls/examples/integration/chartandtooltip/defaultcs.aspx?product=chart which uses a line chart. works fine in my bar chart for one series, but my chart has 2 series (Sold, and Proposed)
Is it possible to have the tooltip hover to show both series for the one employee.
My chart is that I have employee names along the x axis and amounts on the y axix and each employee has 2 series (Sold and Proposed) I want to hover my mouse over the bars but show both series values.
Thanks,
Keith.
4 Answers, 1 is accepted
0
Hi Keith,
The main part of the logic is handled in the following code:
this can be done for more than one series as well. Give this approach a try and let me know how it goes and if any other questions arise.
All the best,
Yavor
the Telerik team
The main part of the logic is handled in the following code:
protected void RadChart1_ItemDataBound(object sender, Telerik.Charting.ChartItemDataBoundEventArgs e)
{
if (e.SeriesItem.YValue > 30)
{
e.SeriesItem.ActiveRegion.Tooltip = "Attention! Temperature too high! " + '\n';
}
else if (e.SeriesItem.YValue < 10)
{
e.SeriesItem.ActiveRegion.Tooltip = "Attention! Temperature too low! " + '\n';
}
e.SeriesItem.ActiveRegion.Tooltip += ((DataRowView)e.DataItem)["Measurement"].ToString() + ": Temperature: " + e.SeriesItem.YValue;
}
this can be done for more than one series as well. Give this approach a try and let me know how it goes and if any other questions arise.
All the best,
Yavor
the Telerik team
Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
0
Sampath
Top achievements
Rank 1
answered on 20 Jun 2013, 07:01 AM
how do u handle it for both series ?
because i have the same question. i need to show details of two series for one data point.
currently im using the following
protected void RadChart1_ItemDataBound(object sender, ChartItemDataBoundEventArgs e)
{
if (RadChart1.PlotArea.XAxis.DataLabelsColumn == "bel")
{
string selectionTemp = Session["selection"].ToString();
string selection = selectionTemp.Substring(1);
string[] arry = selection.Split('/');
string belContact = ((DataRowView)e.DataItem)["bel"].ToString();
string querry = "SELECT [taskType],[buyerContact],Week " +
"FROM [customerRelationshipIndexDB].[dbo].[V_Dashboard] " +
"where Week between " + db.GetWeekNumber(RadDatePicker1.SelectedDate.Value) + " and " + db.GetWeekNumber(RadDatePicker2.SelectedDate.Value) + " and CBU = '" + arry[0] + "' and brand = '" + arry[1] + "' and account='" + arry[2] + "' and [BEL Contact] = '" + belContact + "' " +
"order by Week,[taskType],[buyerContact]";
e.SeriesItem.ActiveRegion.Tooltip += db.GetDrillDownDetail(querry);
}
}
I need to run two querries for the two series. how can i differentiate between the two series?
Please help :)
because i have the same question. i need to show details of two series for one data point.
currently im using the following
protected void RadChart1_ItemDataBound(object sender, ChartItemDataBoundEventArgs e)
{
if (RadChart1.PlotArea.XAxis.DataLabelsColumn == "bel")
{
string selectionTemp = Session["selection"].ToString();
string selection = selectionTemp.Substring(1);
string[] arry = selection.Split('/');
string belContact = ((DataRowView)e.DataItem)["bel"].ToString();
string querry = "SELECT [taskType],[buyerContact],Week " +
"FROM [customerRelationshipIndexDB].[dbo].[V_Dashboard] " +
"where Week between " + db.GetWeekNumber(RadDatePicker1.SelectedDate.Value) + " and " + db.GetWeekNumber(RadDatePicker2.SelectedDate.Value) + " and CBU = '" + arry[0] + "' and brand = '" + arry[1] + "' and account='" + arry[2] + "' and [BEL Contact] = '" + belContact + "' " +
"order by Week,[taskType],[buyerContact]";
e.SeriesItem.ActiveRegion.Tooltip += db.GetDrillDownDetail(querry);
}
}
I need to run two querries for the two series. how can i differentiate between the two series?
Please help :)
0
Hi Sampath,
The ChartItemDataBoundEventArgs provides a reference to the currently created series item, the data item from which it was created, and the series to which it belongs. You can use the ChartSseries.Name property to differentiate between different series. Here's an example:
Petar Kirov
Telerik
The ChartItemDataBoundEventArgs provides a reference to the currently created series item, the data item from which it was created, and the series to which it belongs. You can use the ChartSseries.Name property to differentiate between different series. Here's an example:
void
RadChart1_ItemDataBound(
object
sender, ChartItemDataBoundEventArgs e)
{
DataRow dataItem = ((DataRowView)e.DataItem).Row;
ChartSeriesItem seriesItem = e.SeriesItem;
ChartSeries series = e.ChartSeries;
var seriesName = series.Name;
if
(seriesName ==
"Series A"
)
//...
}
I hope this helps.
Petar Kirov
Telerik
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
0
Sampath
Top achievements
Rank 1
answered on 02 Jul 2013, 05:00 AM
sorry for the delay in replying. yes this helps. it solved my issue, thank you very much.