When we click a bar on the treemap , i want to write some code in the click event of the chart and
show a detailed pane where i can show some additional information. Iam using the
e.RowLabel property to search the datatable to get the particular elemnt row.
But in my scenario the names are not unique with in different levels. How will i get the particular row when names are not unique.
Regards
Shiju
HI,
Well you could search your table by name and then check the value column to verify that you got the correct data.
You can store additional information on each node in the tag property . You can do this int he FillSceneGraph event: then during the DataItemOver event you can retrieve this tag property.
Here is a code snippet:
private void ultraChart1_FillSceneGraph(object sender, Infragistics.UltraChart.Shared.Events.FillSceneGraphEventArgs e)
{
string s = string.Empty;
s = e.SceneGraph.ToString();
foreach (Primitive p in e.SceneGraph)
Box b = p as Box;
if (b != null && b.Chart == ChartType.TreeMapChart)
// this is a box in the treemap chart
if (b.DataPoint != null)
DataRow dr = findData(b.DataPoint.Label);
if (b.Tags == null)
b.Tags = new Hashtable();
}
b.Tags["DataRow"] = dr;
if (b.rect.Width < 20)
// b.DataPoint.Label
private DataRow findData(string symbol)
DataRow dr = ChartSource.Rows.Find(symbol);
if (dr != null)
ultraLabel2.Text = dr[0].ToString() + " finddata row found ";
else ultraLabel2.Text = "row not found";
return dr;
private void ultraChart1_DataItemOver(object sender, Infragistics.UltraChart.Shared.Events.ChartDataEventArgs e)
if (e.Primitive is Box)
Box b = e.Primitive as Box;
DataRow dr = (DataRow) b.Tags["DataRow"];
ultraLabel1.Text = "yes found tag " + dr[0].ToString();
//else ultraLabel1.Text =
Hi Matt,
Thanks for the help, I have another problem .
Currently iam getting the tooltip value only for the <ITEM_LABEL>.
I also want to show ColorValue and ColorValueLabel in the tooltip.
Please advise or send some code sniippets to modify the tooltip in design view or in run time
so that i can add the above values to it.
Regards,Shiju
http://community.infragistics.com/forums/p/23400/85653.aspx#85653
Thanks for the Reply. it helped very much. I need another help from you.
Ii want to avoid the post back when i click or double click the Treemap bars.
Instaed i would like to do some ajax call to redraw the Treemap.
Please guide me with code snippets to do the same.
Put the WebTree inside our WebAsyncRefreshPanel.
Here is a help link
http://help.infragistics.com/Help/NetAdvantage/NET/2008.3/CLR2.0/html/WebAsyncRefreshPanel.html
Thanks Matt
We are using infragistics Tree map chart in one of our pages. We have the requirement to click a particular bar in the Tree map and show some additional information of the selected bar. For this we need to first identify data row of the data table that particular bar is associated to and get the additional details.
Please give some code snippets of UltraChart1_ChartDataClicked depicting how to make use of the properties of ChartDataEventArgs e.RowLabel, e.DataColumn and e.DataRow to get the corresponding data row. Also please note the e.RowLabel is not unique in our data table. We can have two or more elements with same name in different hierarchy levels of tree map.
HI ,
Here are some code snippets:
private void ultraChart1_ChartDataClicked(object sender, Infragistics.UltraChart.Shared.Events.ChartDataEventArgs e) {
Boolean b = findTableDatax(e.RowLabel, e.DataValue);
public Boolean findTableDatax(string name, double datavalue) { string[] str = name.Split(new char[] { '\n' }); string sname = str[0]; if (table != null) { foreach (DataRow dr in table.Rows) { if (((string)dr["Name"] == sname) && ((double)dr["Sales"] == datavalue)) {
// return dr[1].ToString(); return true;
} } // return string.Empty; return false; } else return false;