Internal error

TeeChart for Java (NetBeans, Eclipse, Android Studio, etc)
Post Reply
Myti
Newbie
Newbie
Posts: 10
Joined: Mon Jul 08, 2013 12:00 am

Internal error

Post by Myti » Tue Jul 30, 2013 10:23 am

Hi,

This error happens occasionally on a continuously (every minute) updating linear chart.
I'm using TeeChart test version 0722fg.

Have you any idea why it happens?

Thank you!
Ishan.

Code: Select all

java.lang.NullPointerException
	at com.steema.teechart.axis.Axis.internalCalcLabelStyle(Axis.java:2042)
	at com.steema.teechart.axis.Axis.calcLabelStyle(Axis.java:3203)
	at com.steema.teechart.axis.Axis.maxLabelsWidth(Axis.java:1484)
	at com.steema.teechart.axis.Axis.internalCalcSize(Axis.java:1539)
	at com.steema.teechart.axis.Axis.getSizeLabels(Axis.java:1577)
	at com.steema.teechart.axis.Axis.calcRect(Axis.java:2459)
	at com.steema.teechart.Chart.axisRect(Chart.java:2197)
	at com.steema.teechart.Chart.calcAxisRect(Chart.java:2216)
	at com.steema.teechart.Chart.internalDraw(Chart.java:722)
	at com.steema.teechart.Chart.paint(Chart.java:2080)
	at com.steema.teechart.TChart.image(TChart.java:1453)
	at com.steema.teechart.Chart.image(Chart.java:291)
	at com.steema.teechart.TChart.getImage(TChart.java:1060)
	at com.steema.teechart.TChart.paint(TChart.java:482)
	at com.steema.teechart.TChart.paintChart(TChart.java:509)
	at com.steema.teechart.TChart.access$400(TChart.java:79)
	at com.steema.teechart.TChart$2.paintControl(TChart.java:341)
	at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:230)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
	at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4136)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1458)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1481)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1466)
	at org.eclipse.swt.widgets.Control.drawWidget(Control.java:1244)
	at org.eclipse.swt.widgets.Widget.drawRect(Widget.java:741)
	at org.eclipse.swt.widgets.Display.windowProc(Display.java:5473)
	at org.eclipse.swt.internal.cocoa.OS.objc_msgSendSuper(Native Method)
	at org.eclipse.swt.widgets.Display.applicationNextEventMatchingMask(Display.java:4875)
	at org.eclipse.swt.widgets.Display.applicationProc(Display.java:5241)
	at org.eclipse.swt.internal.cocoa.OS.objc_msgSend(Native Method)
	at org.eclipse.swt.internal.cocoa.NSApplication.nextEventMatchingMask(NSApplication.java:94)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3615)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1053)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:942)
	at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:86)
	at org.eclipse.e4.ui.internal.workbench.swt.E4Application.start(E4Application.java:150)
	at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:353)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:180)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:629)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:584)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1438)
	at org.eclipse.equinox.launcher.Main.main(Main.java:1414)

Yeray
Site Admin
Site Admin
Posts: 8733
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: Internal error

Post by Yeray » Tue Jul 30, 2013 3:20 pm

Hello Ishan,

Could you please arrange a simple example project we can run as-is to reproduce the problem here?
Thanks in advance.
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

Myti
Newbie
Newbie
Posts: 10
Joined: Mon Jul 08, 2013 12:00 am

Re: Internal error

Post by Myti » Thu Aug 01, 2013 9:01 am

Hi,

I'm sorry but it's not possible.
We are not even able to reproduce the problem on the developing workstation.

We were trying to understand if the exception is caused by values in the data, values in the labels or something else...

Mauro ( Ishan's colleague )

Myti
Newbie
Newbie
Posts: 10
Joined: Mon Jul 08, 2013 12:00 am

Re: Internal error

Post by Myti » Thu Aug 01, 2013 10:39 am

We found the error.
There were some labels in the serie with a null value.
Maybe the next TeeChart can manage this situation without throwing a NPE.

Mauro.

Yeray
Site Admin
Site Admin
Posts: 8733
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: Internal error

Post by Yeray » Thu Aug 01, 2013 10:46 am

Hi Mauro,

How are you adding these null labels to the series?
The following seems to work fine for me here with SWT:

Code: Select all

		Bar bar1 = new Bar(tChart1.getChart());
		String s;
		for (int i=0; i<5; i++) {
			if (i!=2)
				s="hi " + String.valueOf(i);
			else
				s=null;
			
			bar1.add(i, s);
		}
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

Post Reply