ArrayIndexOutOfBoundsException when creating line chart

TeeChart for Java (NetBeans, Eclipse, Android Studio, etc)
Post Reply
Chen
Newbie
Newbie
Posts: 43
Joined: Tue Mar 11, 2008 12:00 am
Contact:

ArrayIndexOutOfBoundsException when creating line chart

Post by Chen » Mon Jun 16, 2008 9:17 pm

Hi,

Thanks for your reply to my previous query. I have a different issue now.
I am getting the below mentioned exception when I tried to add large number of points to a line chart. I have seen a similar query in the forum.
I am also using a dual core machine. Is this because of the machine type or something else ? If the number of points are small then I am able to create a line chart.

Exception in thread "AWT-EventQueue-0" java.lang.ArrayIndexOutOfBoundsException: 2000
at com.steema.teechart.axis.AxisDraw.addTick(AxisDraw.java:432)
at com.steema.teechart.axis.AxisDraw.drawThisLabel(AxisDraw.java:463)
at com.steema.teechart.axis.AxisDraw.internalDrawLabel(AxisDraw.java:447)
at com.steema.teechart.axis.AxisDraw.doDefaultLabels(AxisDraw.java:623)
at com.steema.teechart.axis.AxisDraw.doNotCustomLabels(AxisDraw.java:687)
at com.steema.teechart.axis.AxisDraw.doCustomLabels(AxisDraw.java:715)
at com.steema.teechart.axis.AxisDraw.draw(AxisDraw.java:1034)
at com.steema.teechart.axis.Axis.draw(Axis.java:2521)
at com.steema.teechart.axis.Axes.draw(Axes.java:410)
at com.steema.teechart.Chart.internalDraw(Chart.java:645)
at com.steema.teechart.Chart.paint(Chart.java:1807)
at com.steema.teechart.TChart.paintComponent(TChart.java:568)
at javax.swing.JComponent.paint(Unknown Source)
at javax.swing.JComponent.paintChildren(Unknown Source)
at javax.swing.JComponent.paint(Unknown Source)
at javax.swing.JComponent.paintToOffscreen(Unknown Source)
at javax.swing.RepaintManager$PaintManager.paintDoubleBuffered(Unknown Source)
at javax.swing.RepaintManager$PaintManager.paint(Unknown Source)
at javax.swing.BufferStrategyPaintManager.paint(Unknown Source)
at javax.swing.RepaintManager.paint(Unknown Source)
at javax.swing.JComponent._paintImmediately(Unknown Source)
at javax.swing.JComponent.paintImmediately(Unknown Source)
at javax.swing.RepaintManager.paintDirtyRegions(Unknown Source)
at javax.swing.RepaintManager.paintDirtyRegions(Unknown Source)
at javax.swing.RepaintManager.seqPaintDirtyRegions(Unknown Source)
at javax.swing.SystemEventQueueUtilities$ComponentWorkRequest.run(Unknown Source)
at java.awt.event.InvocationEvent.dispatch(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)


Thanks,
Varun

Marc
Site Admin
Site Admin
Posts: 1266
Joined: Thu Oct 16, 2003 4:00 am
Location: Girona
Contact:

Post by Marc » Fri Jun 27, 2008 10:03 am

Hello Varun,

Sorry for the delay with this reply. We've been unable to reproduce the problem. Do you have a sample project or code that we could use to generate the error?

If the problem is a TeeChart process-cycle error then it may be that it appears more readily on a dual core machine, though the problem is most likely to be applicable to all machine types by nature.

With thanks.
Regards,
Marc Meumann
Steema Support

Chen
Newbie
Newbie
Posts: 43
Joined: Tue Mar 11, 2008 12:00 am
Contact:

Post by Chen » Fri Jun 27, 2008 2:40 pm

Hi,

This issue may be related to setIncrement() of TChart.

teeChartAxis.setIncrement(teeChartAxis.getMinAxisIncrement());

If my x-axis represent date values, then setting axis label increment to "min axis increment" throws this exception.

Hope that you have understood the issue now.
Now I am checking for date explicitly, is there any other way I could do this ?

Thanks,
Varun

Marc
Site Admin
Site Admin
Posts: 1266
Joined: Thu Oct 16, 2003 4:00 am
Location: Girona
Contact:

Post by Marc » Fri Jun 27, 2008 4:21 pm

Hello Varun,

Thanks, we can provoke a failure using teeChartAxis.setIncrement(teeChartAxis.getMinAxisIncrement()) in that way. We'll make some checks and get back to you.

Regards,
Marc
Steema Support

Marc
Site Admin
Site Admin
Posts: 1266
Joined: Thu Oct 16, 2003 4:00 am
Location: Girona
Contact:

Post by Marc » Mon Jun 30, 2008 3:10 pm

Hello Varun,

We believe we've found the cause of the problem. A fix is being tested for inclusion in the next maintenance release.

Regards,
Marc
Steema Support

Chen
Newbie
Newbie
Posts: 43
Joined: Tue Mar 11, 2008 12:00 am
Contact:

Post by Chen » Mon Jun 30, 2008 8:58 pm

Hi,

That is encouraging.
I have another question, Can we draw rectangles in the chart panel using mouse ?

Thanks,
Varun

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Tue Jul 01, 2008 9:25 am

Hi Varun,

Yes, you can custom draw on TeeChart's canvas as shown in Tutorial 10 - Custom drawing on the Chart Panel. For defining rectangle coordinates you could use mouse pressed and released events as shown on this thread.

Hope this helps!
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Post Reply