Nevron Forum

how to add tooltip for linechart

https://www.nevron.com/Forum/Topic6343.aspx

By soundara lakshmi - Wednesday, April 18, 2012

Hi,
i am getting below exception,
i am using SurfaceChartLegendRenderer for legend ,


System.InvalidOperationException was unhandled
Message=Handle is not initialized.
Source=mscorlib
StackTrace:
at System.Runtime.InteropServices.GCHandle.Free()
at Nevron.GraphicsGL.lI1lIIII1.l1l1II11Il()
at Nevron.GraphicsGL.l1111I11l.Deactivate()
at Nevron.GraphicsGL.GLBitmapRenderSurface.Deactivate()
at Nevron.GraphicsGL.lI1lIIII1.lI1l111I(Boolean lIlI1lI1)
at Nevron.GraphicsGL.lI1lIIII1.ClearDeviceSpecificResources()
at Nevron.GraphicsGL.lI1lIIII1.Dispose()
at Nevron.Chart.NChartRenderingContext3D.Dispose(Boolean disposing)
at Nevron.Chart.NChartRenderingContext.Finalize()
InnerException:


Please help in resolve this problem...

while running the code sometimes its shows this error.
By Nevron Support - Wednesday, April 18, 2012

What Is the environment you're using the control (WinForms / WebForms)? In general you need to add the tooltip tool to the control not the series - for example:

NChartControl1.Controller.Tools.Add(new NTooltipTool());

By soundara lakshmi - Wednesday, April 18, 2012

Hi,
for WinForms environment i need to add tooltip for line chart,

LineChart linechart = new LineChart();
linechart .Controller.Tools.Add(new NTooltipTool());// Controller -> is not available
please help me...
By Niranjan Singh - Friday, June 8, 2012

Are you adding lineChart to NChartControl object, nChartControl1 is by default added when you drop Nevron Chart Control on the form.

your linechart is inherited to NChart not the NChartControl class of ChartControl, so check this code snippet as i am creating these chart control and chart in code..

private NChartControl chartControl;
chartControl = new NChartControl();


NChart chart = new NChart();

chartControl.Charts.Add(chart);/// chart is your lineChart..

so chartControl.Controller.Tools.Add(new NTooltipTool()) will work.