Hi,
I'm using Infragistics 8.1 ultrawinchart.
In my chart I set a multilined text (simply a text containing \n ) to a tooltip label , and it's rendered with center-aligned text. Is it possible to change the text alignment ?
Thx in advance
PS
sorry for my bad english
I believe you can use html elemets with an existing string you use for the Tooltip such as:
stringValue.Append("<h1 align='center'>");stringValue.Append("Name: ");
stringValue.Append(DR["Name"]);stringValue.Append("</h1>");
Sorry but it does not work for me.
When I set for exaple a string like "<h1 align='left'>AAA</h1>", my label show exactly that string, with html tags visible.
Have I forget to set a property specifing that the string contains html elements ?
My misstake... Using the html tags was meant for WebChart. For a moment I didn't realize I was dealing with WinChart. You can use our Tooltip control to customize the string you have, and then set to the tooltip of the chart.
I looked for a way to set the ultra tooltip manager to the ultrachart but I couldn't find it.
How can I do that ?
Thx
I managed to show my tooltip control instead of the ultrachart default one (with the DataItemOver DataItemOut events) but I still have a problem.
With the default tooltip, the dataitems in the chart were highlighted automatically on mouse over.
I've seen there's a method Highlight in the datapoint, but I wasn't able to use it.
Could you help me ?
The customized string for the Tooltip doesn't have to be done in the DataItemOver / DataItemOut, it can be done in the page load, and the data points should be highlighted by default.
Given that in infragistics 9.2 there's a bug that occurrs by setting tooltips Format to None (for an ultrachart docked under a ribbon, as shown here ), I can't use a custom tooltipmanager to change tooltip text alignment anymore .
Thus, I want to report a way I have found (actually very tricky), to change ultrachart tooltip text alignment.
Here's the code (you have to handle mouseMove ultraChart event)
private void ultraChart_MouseMove(object sender, MouseEventArgs e){ var innerTooltip = this.ultraChart.Tooltips.TooltipControl as Infragistics.Win.UltraWinChart.IGWinTooltip; if (innerTooltip != null) { if (innerTooltip.Scene != null) { foreach (var primitive in innerTooltip.Scene) { var txt = primitive as Infragistics.UltraChart.Core.Primitives.Text; if (txt != null) { txt.labelStyle.HorizontalAlign = StringAlignment.Near; } } } }}
I think it's very tricky because if you hide TooltipControl property to intellisense, probably the use of it can be dangerous...
So please, tell me whether it is a reasonable way or not.
Thanks in advance.
Marco
Sorry my mistake.
I set tooltip Display to Never instead of Format to None.
Now it works fine.
Thx for the help
Are you by any chance setting the Tooltip.Disapy to 'never'? If yes, then that affects on getting the datapoint highlighted.
Ok,
this is exactly what I'm doing now, but I still cannot show highlighting when mouse hover dataItems...
The tooltip on the chart does not have detail formatting capability for the text; however; as I mentioned before, you could use our UltraToolTipManager to cutomize the formatting of the text that needs to be on the tooltip. You can add ultraToolTipManger component on the form, set the formatted text on ultraTooltipManager, and add the following code to show and hide in DataItemOver/Hide events:
ultraChart1.Tooltips.Format = Infragistics.UltraChart.Shared.Styles.TooltipStyle.None; ultraChart1.DataItemOver += new Infragistics.UltraChart.Shared.Events.DataItemOverEventHandler(ultraChart1_DataItemOver); ultraChart1.DataItemOut += new Infragistics.UltraChart.Shared.Events.DataItemOutEventHandler(ultraChart1_DataItemOut);
void ultraChart1_DataItemOut(object sender, Infragistics.UltraChart.Shared.Events.ChartDataEventArgs e) { ultraToolTipManager1.HideToolTip(); }
void ultraChart1_DataItemOver(object sender, Infragistics.UltraChart.Shared.Events.ChartDataEventArgs e) { ultraToolTipManager1.ShowToolTip(ultraChart1); }