I would like to customize the visualization of the UltraChart tooltips because I need to show on the tooltip of the chart other information from the DataTable that is linked to the information on the graph.
In my example, I use CompositeChart with multiple chartlayer, and each layer has some numeric series on it.
I tried to use the IRenderLabel in a custom class, in a code similar to this (VB.NET):
Public Sub SetCustomTooltipLabelRender(ByVal dt As DataTable, ByVal lstColMapping As List(Of Integer)) Dim clTooltip As CustomToolTipLabelRender = New CustomToolTipLabelRender(Me.coChart) clTooltip.ReferenceDataTable = dt clTooltip.ColumnMappingForToolTips = lstColMapping Me.coChart.Tooltips.Format = TooltipStyle.Custom Me.coChart.Tooltips.FormatString = "<MY_TOOLTIP>" Me.coChart.LabelHash.Add("MY_TOOLTIP", clTooltip) End Sub
However, on the IRenderLabel.ToString(ByVal context As Hashtable) implementation, on the context I cannot receive any information on the chart layer that refers to the data where the mouse is over. The values:
context("[DATA_ROW]") context("[DATA_COLUMN]")
Are not enough in composite and multiple chartlayer context. The value:
context("[ITEM_SERIES]")
can be linked in some complicated way (looking at the Serie LabelColumn property of the series linked to chartLayers) only if the series have different labels (in my example, this is not the case, I need to use the same LabelColumn value for more series, I use different legend boxes in different positions to identify the difference among the series).
I need a way to obtain the chartLayer in the IRenderLabel.ToString() implementation, because I must identify which serie I'm over with the mouse in order to link the correct information in the DataTable.
Is there any other way to customize tooltip for Composite Charts with multiple Chart Layers without having those kind of limitations?
Andrea Lazzarini
this is a bit tricky. try the following:
1: handle the MouseMove event.
2: in the event handler, call the chart's HitTest method. evaluate the Layer property of the returned primitive.
3: store that layer or perhaps its LayerID in a private field somewhere, ideally your IRenderLabel class.
4: in IRenderLabel.ToString, check that field.
if you'd like to see this implemented as a feature in the chart control, please visit http://devcenter.infragistics.com/protected/requestfeature.aspx
Hi,
Sorry ... it's too tricky for me, and I saw that HitTest-like methods are used for Infragistic testing purposes. I can expect that in different version of Infragistics product there are different implementation of HitTest and if I use this functionality for my production environment and already deliver something based on this, if you change something in the implementation I should change my delivered products and this for me is not acceptable.
I've done what you suggest (request new feature): for now, it's no important to have this functionality (could be good from user perspectives, but if not technically possible at a good level, I don't put this functionality).
thank you in advance for your support
Andrea