How to set custom tool tip fot a column chart? If I use this.UltraChart1.Tooltips.FormatString = "tooltip"; it sets the tool tip value to "tooltip" for all the bars/column. Each bar/column in the chart should have a different custom value for the tool tip. How to acheive this?
Check out the example at the bottom of this post:http://forums.infragistics.com/forums/p/8472/33827.aspx#33827Implementing IRenderLabel gives you the flexibility to specify any string as the tooltip based on the information in the label hashtable.
I have a column chart and I want to show custom tool tips.. can you please explain this with an example?
Have you tried using the code in the link that i posted?It's rather difficult to give you a specific example, since I don't know what exactly you mean by 'custom tooltips'. Can you explain what custom functionality you're looking for?
Ok, I have a datatable, TABLE1, which I can bind to a column chart and the chart gets generated and it looks great. Now I have another data table, TABLE2 where I have a set of values which I have to show as tool tips for each of the columns/bars in the chart. Ex: Tool tip for the first column/bar in the chart should be 'Apple'. Tool Tip for second column/bar in the chart should be'bat' etc. TABLE2 has these values, 'Apple', 'bat' etc.
Now can you give me a sample code to set the tooltip values from TABLE2?
private void Form1_Load(object sender, EventArgs e){ DataTable table1 = new DataTable(); table1.Columns.Add("Value", typeof(int)); table1.Rows.Add(6); table1.Rows.Add(3); DataTable table2 = new DataTable(); table2.Columns.Add("Tooltip", typeof(string)); table2.Rows.Add("Apple"); table2.Rows.Add("Bat"); ultraChart1.Data.DataSource = table1; ultraChart1.Data.ZeroAligned = true; Hashtable labelHash = new Hashtable(); labelHash.Add("CUSTOM", new MyLabelRenderer(table2)); ultraChart1.LabelHash = labelHash; ultraChart1.Tooltips.FormatString = "<CUSTOM>";}
public string ToString(Hashtable context) { int row = (int)context["DATA_ROW"]; int col = (int)context["DATA_COLUMN"]; string customLabel = _table.Rows[row][col].ToString(); return customLabel; }}
Thanks a lot for your help! ... I was able to get what I want.