I have a simple column chart.
The datasource has a list of objects which have a few fields.
By default, the Tooltip shows the data field.
I want it to show another field.
Also the objects labels are string which are long.
The strings of the labels which are shown are being cut and they show only 1-3 characters.
I want to show more - at least 20 characters.
You can customize displaying of the tooltips with:
“UltraChart.Tooltips.FormatString” property.
More about this you can find:
http://help.infragistics.com/NetAdvantage/WinForms/2010.2/CLR2.0/?page=Chart_Label_Formatting.html
Sorry, I couldnt find the answer in this link.
I have a list of objects. the name of the data field of an object, is Num and is int, the name of the label is Text, and is a string type.
I want the label to show the field Text.
It should be just one line of code. Could you please write it?
Did you try this:
this.ultraChart1.Tooltips.FormatString = "<ITEM_LABEL>";
I tried.
It just gives when you point on the column, it shows: "Num"
With adding:
this.ultraChart1.Tooltips.FormatString = "<SERIES_LABEL>";
The chart will show “label1”, “label2” … as tooltips.
Sorry, I havent managed to do it.
Here is my code.
Could you show me how to do it.
Just to explain my need. The thing is I have long labels, which cannot be shown fully under the x axis.
So the tooltip is a way for the user to see the label.
If there is another way to enable the user to see the labels, that is fine.
using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Text; using System.Windows.Forms; namespace WindowsApplication9 { public partial class Form1 : Form { public Form1() { InitializeComponent(); } private void button1_Click(object sender, EventArgs e) { List<Item> itemList = new List<Item>(); itemList.Add(new Item(50, "label1")); itemList.Add(new Item(100, "label2")); itemList.Add(new Item(80, "label3")); itemList.Add(new Item(70, "label4")); this.ultraChart1.DataSource = itemList; this.ultraChart1.DataBind(); } } public class Item { public Item(int num, string text) { Text = text; Num = num; } private string mText; private int mNum; public int Num { get { return mNum; } set { mNum = value; } } public string Text { get { return mText; } set { mText = value; } } } }
Yes, this is right.
The column chart can have axis labels – row and column labels and data values. You can choose which of them to be displayed in the tooltip.
If you want to display some different texts you can use IRenderLabel interface for this:
http://help.infragistics.com/Help/NetAdvantage/WinForms/2010.2/CLR2.0/html/Chart_Customize_Labels_Using_the_IRenderLabel_Interface.html
This sets the labels , not the tooltip column.
You can specify which column to get the labels from with:
http://help.infragistics.com/NetAdvantage/WinForms/2010.2/CLR2.0/?page=Chart_Specify_Row_Labels.html
If this also is not helping you, can you send me your code so I can get better look at it?