Hi,
below I have attached the datasource of the column chart...
LEVELNAME OWNER LEVEL TGT ACH ATG
In X axis I will use Level Name for series label and use TGT, ACH, ATG in data fileds.... so each series contains 3 data filed. bydefault it will shows the datavalue in tooltip..
But I want to show the tooltips like this.. SeriesName: itemLabel: datavalue
EG:
Instrumetns: ATG: 4970.98
Instrumetns: ACH: 0
Instrumetns: TGT: 0
.. etc..
How can I do this?.. I have been breaking my head for more tha two days...
UltraChart1.Tooltips.FormatString = "<SERIES_LABEL>: <ITEM_LABEL>: <DATA_VALUE:0.##>";
hi,
my requirement has been changed... Below is the data in mydataset..
In my chart I will show ACH, TGT, and ATG in X axis as data items and Instruments, Pumps, etc as Serires label. I have not used owner column in the chart.
But my tool tip should show the details as LEVELNAME: OWNER:ITEMLABEL:DATAVALUE
eg:
etc...
How can I achieve this...
If you need to display a value that is not used in the chart, you have to implement custom label rendering. This is done by creating a class that implements IRenderLabel. You need to override ToString method and return any text you want to be used as a label (or tooltip). You can find more information here:http://help.infragistics.com/Help/NetAdvantage/NET/2007.3/CLR2.0/html/Chart_Customize_Labels_Using_the_IRenderLabel_Interface.htmlYou can also search the forums for "IRenderLabel" as there are many examples on how to use it.
thanks for the help... But my requirement is to show tooltip data...
i.e my chart tool tip also contains the value from non visible fields....
Please help!!!!!!!!!
Your only option is to use IRenderLabel to implement this.
private void Form1_Load(object sender, EventArgs e){ Hashtable labelHash = new Hashtable(); labelHash.Add("CUSTOM", new MyLabelRenderer()); myChart.LabelHash = labelHash; myChart.Tooltips.FormatString = "<CUSTOM>";}
public class MyLabelRenderer : IRenderLabel{ public string ToString(Hashtable context) { int row = (int)context["DATA_ROW"]; int col = (int)context["DATA_COLUMN"]; string customLabel = ""; //use row and col to fetch an item from your dataset //customLabel = GetMyValueFromDataSet; return customLabel; }}
Max this does not work with composite charts. Can you help?
This does indeed work with composite charts. If you're experiencing problems, please provide sample code to help us reproduce the problem. Here's a sample that does work with a custom tooltip renderer:ultraChart1.ChartType = ChartType.Composite;ChartArea area = new ChartArea();ultraChart1.CompositeChart.ChartAreas.Add(area);
NumericSeries series = new NumericSeries();series.Points.Add(new NumericDataPoint(0, "item1", false));series.Points.Add(new NumericDataPoint(5, "item2", false));series.Points.Add(new NumericDataPoint(2, "item3", false));series.Points.Add(new NumericDataPoint(7, "item4", false));series.Points.Add(new NumericDataPoint(4, "item5", false));ultraChart1.CompositeChart.Series.Add(series);
AxisItem xAxis = new AxisItem(ultraChart1, AxisNumber.X_Axis);xAxis.SetLabelAxisType = SetLabelAxisType.ContinuousData;xAxis.DataType = AxisDataType.String;
AxisItem yAxis = new AxisItem(ultraChart1, AxisNumber.Y_Axis);yAxis.DataType = AxisDataType.Numeric;
area.Axes.Add(xAxis);area.Axes.Add(yAxis);
ChartLayerAppearance layer = new ChartLayerAppearance();layer.ChartType = ChartType.LineChart;layer.Series.Add(series);layer.ChartArea = area;layer.AxisX = xAxis;layer.AxisY = yAxis;ultraChart1.CompositeChart.ChartLayers.Add(layer);
Hashtable labelHash = new Hashtable();labelHash.Add("CUSTOM", new MyLabelRenderer());ultraChart1.LabelHash = labelHash;ultraChart1.Tooltips.FormatString = "<CUSTOM>";
public class MyLabelRenderer : IRenderLabel{ public string ToString(Hashtable context) { int row = (int)context["DATA_ROW"]; int col = (int)context["DATA_COLUMN"]; string customLabel = "i am a tooltip"; //use row and col to fetch an item from your dataset //customLabel = GetMyValueFromDataSet; return customLabel; }}