Performance problems in SegmentedTimeLine

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
d_rambabu
Posts: 8
Joined: Mon Apr 14, 2008 8:36 am
Location: Hyderabad, India
Contact:

Performance problems in SegmentedTimeLine

Post by d_rambabu » Mon Nov 03, 2008 1:19 pm

Hi,
I am building a chart that uses SegmentedTimeline and shows financial data across multiple days. The segmented timeline starts from 10AM thru 4PM and base time line is a monday thru friday timeline. The chart performs well as long as all the data is between 10AM-4PM. But when I have some data outside this range, the AWT thread becomes busy drawing the chart. The chart redraw takes lot of time. Jstack shows the following stack trace for the thread,

"AWT-EventQueue-0" prio=3 tid=0x0883b400 nid=0x1b runnable [0x42678000..0x42679b70]
java.lang.Thread.State: RUNNABLE
at sun.util.calendar.BaseCalendar.getCalendarDateFromFixedDate(BaseCalendar.java:416)
at java.util.GregorianCalendar.computeFields(GregorianCalendar.java:2081)
at java.util.GregorianCalendar.computeFields(GregorianCalendar.java:1996)
at java.util.Calendar.setTimeInMillis(Calendar.java:1104)
at java.util.GregorianCalendar.<init>(GregorianCalendar.java:576)
at java.util.Calendar.createCalendar(Calendar.java:1006)
at java.util.Calendar.getInstance(Calendar.java:958)
at org.jfree.chart.axis.DateTickUnit.rollDate(DateTickUnit.java:291)
at org.jfree.chart.axis.DateAxis.refreshTicksHorizontal(DateAxis.java:1626)
at org.jfree.chart.axis.DateAxis.refreshTicks(DateAxis.java:1549)
at org.jfree.chart.axis.ValueAxis.reserveSpace(ValueAxis.java:787)
at org.jfree.chart.plot.CombinedDomainXYPlot.calculateAxisSpace(CombinedDomainXYPlot.java:364)
at org.jfree.chart.plot.CombinedDomainXYPlot.draw(CombinedDomainXYPlot.java:442)
at org.jfree.chart.JFreeChart.draw(JFreeChart.java:1227)
at org.jfree.chart.ChartPanel.paintComponent(ChartPanel.java:1361)
at javax.swing.JComponent.paint(JComponent.java:1027)

I have checked the graph without the segmented timeline, and the graph performs well. Please let me know if I am going in the wrong direction.


Thanks,
Rambabu.

Locked