Hi
I need to display the text as tooltip that what is displayed in legend while mouse over. How can I do this?
For Eg. In Progress on tooltip
Thanks in advance.
assuming your setting for Tooltips.FormatString is "<ITEM_LABEL>", you can achieve this by handling the ChartDrawItem event:
private void ultraChart1_ChartDrawItem(object sender, ChartDrawItemEventArgs e) { if (e.Primitive.Path != null && e.Primitive.Path.Contains("Legend")) { e.Primitive.Caps |= PCaps.HitTest | PCaps.Tooltip; } }
Hai
I got a inner exception "Object reference not set to instance of an object" during loading and it track me to disassembly due to no source code available in the current location. It dint display graph also. I dint get what is null in that code? I could not catch the exception in try-catch block. The exception details is as given below and I attached aspx code. Please let me know the solution. I will use tooltip format as
FormatString
="<ITEM_LABEL:> (<DATA_VALUE:>)".
----------------------------------------
<
igchart:UltraChart ID="ucProjectStatus" runat="server" OnChartDrawItem="ultraChart1_ChartDrawItem" >
<Legend Visible="true" AlphaLevel="100" SpanPercentage="20" Location
="Bottom">
<Margins Bottom="15" Left="0" Top="0" Right="0"></Margins>
="False"
Font-Underline="False" FormatString="<ITEM_LABEL:>" />
</igchart:UltraChart>
-------------------------------
System.NullReferenceException was unhandled by user code Message="Object reference not set to an instance of an object." Source="Infragistics35.WebUI.UltraWebChart.v9.1" StackTrace: at Infragistics.UltraChart.Render.ActiveImage.ActiveImageRender.RenderChart(SceneGraph scene, CIMMap map, Boolean is3DChart, Boolean is508Compliant) at Infragistics.WebUI.UltraWebChart.UltraChart.Render(HtmlTextWriter output) at System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) at System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) at System.Web.UI.Control.RenderControl(HtmlTextWriter writer) at System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) at System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) at System.Web.UI.WebControls.WebControl.RenderContents(HtmlTextWriter writer) at System.Web.UI.WebControls.WebControl.Render(HtmlTextWriter writer) at System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) at System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) at System.Web.UI.Control.RenderControl(HtmlTextWriter writer) at System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) at System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) at System.Web.UI.WebControls.WebControl.RenderContents(HtmlTextWriter writer) at Infragistics.WebUI.WebControls.WebPanelBase.RenderContents(HtmlTextWriter writer) at Infragistics.WebUI.Misc.RenderUpLevelPanel.RenderContents(HtmlTextWriter writer) at Infragistics.WebUI.Misc.RenderUpLevelPanel.VisitObjects(HtmlTextWriter writer) at Infragistics.WebUI.Misc.WebPanel.Render(HtmlTextWriter writer) at System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) at System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) at System.Web.UI.Control.RenderControl(HtmlTextWriter writer) at ASP.project_projectdashboard_aspx.__RenderContent1(HtmlTextWriter __w, Control parameterContainer) in c:\Users\namasivayam\AppData\Local\Temp\Temporary ASP.NET Files\tmc\57e8b3e3\16bb1350\App_Web_he3q-5ni.0.cs:line 0 at System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) at System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) at System.Web.UI.Control.Render(HtmlTextWriter writer) at System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) at System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) at System.Web.UI.Control.RenderControl(HtmlTextWriter writer) at System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) at System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) at System.Web.UI.WebControls.WebControl.RenderContents(HtmlTextWriter writer) at System.Web.UI.WebControls.WebControl.Render(HtmlTextWriter writer) at System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) at System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) at System.Web.UI.Control.RenderControl(HtmlTextWriter writer) at System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) at System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) at System.Web.UI.HtmlControls.HtmlForm.RenderChildren(HtmlTextWriter writer) at System.Web.UI.HtmlControls.HtmlContainerControl.Render(HtmlTextWriter writer) at System.Web.UI.HtmlControls.HtmlForm.Render(HtmlTextWriter output) at System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) at System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) at System.Web.UI.HtmlControls.HtmlForm.RenderControl(HtmlTextWriter writer) at System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) at System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) at System.Web.UI.HtmlControls.HtmlContainerControl.Render(HtmlTextWriter writer) at System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) at System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) at System.Web.UI.Control.RenderControl(HtmlTextWriter writer) at System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) at System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) at System.Web.UI.Control.Render(HtmlTextWriter writer) at System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) at System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) at System.Web.UI.Control.RenderControl(HtmlTextWriter writer) at System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) at System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) at System.Web.UI.Page.Render(HtmlTextWriter writer) at System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) at System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) at System.Web.UI.Control.RenderControl(HtmlTextWriter writer) at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) InnerException:
Regards
Sridhar
whoops, that solution would have worked better for WinChart. here's some code to get it working in WebChart - since Text primitives don't ordinarily add themselves to the ImageMap, you'll need to overlay a transparent Box primitive over your Text objects.
private Primitive LastPrimitive { get; set; } void UltraChart1_FillSceneGraph(object sender, Infragistics.UltraChart.Shared.Events.FillSceneGraphEventArgs e) { PrimitiveCollection primitivesToAdd = new PrimitiveCollection(); foreach (Primitive p in e.SceneGraph) { if (p.Path != null && p.Path.Contains("Legend")) { p.Layer = e.ChartCore.GetChartLayer(); if (p is Box) { this.LastPrimitive = p; p.Caps |= PCaps.HitTest | PCaps.Tooltip; } else if (p is Text) { Text t = (Text)p; p.Row = this.LastPrimitive.Row; p.Column = this.LastPrimitive.Column; p.Value = this.LastPrimitive.Value; Box newBox = new Box(t.bounds); newBox.PE.FillOpacity = newBox.PE.StrokeOpacity = 0; newBox.Row = p.Row; newBox.Column = p.Column; newBox.Chart = p.Chart; newBox.Layer = p.Layer; newBox.Value = p.Value; newBox.Caps = PCaps.HitTest | PCaps.Tooltip; primitivesToAdd.Add(newBox); } } } e.SceneGraph.AddRange(primitivesToAdd.ToArray()); }
Hello Rithanya,
I suppose that this forum thread is duplicate with http://es.infragistics.com/community/forums/t/78311.aspx . Please take a look there for more details.
Hi,
I have tried the above code as said in fillscenegraph event and the tool tip is worked well if the scroll bar is disabled.
And the same is not working well if the scroll bar is enabled. (EnableScrollbar = true).
Please assist us to over come from this issue and reply is much appreciated.
Best Regards
Rithanya.
Hi, I noticed that this was posted months ago. I was wondering if the new releases of WebCharts now support having different format strings for the legend tooltip and the tooltip on the chart itself?
Please let me know what I may be missing about legends tooltip as mentioned in my last post.
If required, I can start a new post for this and/or send sample code too.
Thanks a lot.
I have used the above suggested code to draw Tooltip for my Legends of Pie and StackColumn charts. But it is not giving expected result - always shows "undefined" when mouse hovers on Legend label. Also gives incorrect legend tooltip value for some of all the legend items.
Please help me on this. Or if you want, I can provide you the sample code for this issue. I need a generic solution for this.
Thanks.