chart is flickering

Andreas Schlicker <[email protected]> Mon, 10 Apr 2006 16:33:24 +0200
Newsgroups gmane.comp.krysalis.jcharts.user
Message-ID <[email protected]>
Hi all,

I'm using jdk 1.6 update 6 on Linux.

I want to create a simple Bar chart and display it in a separate JFrame. 
  The paint() method of my frame class looks like:

public void paint(Graphics g) {
         DataSeries ds = new DataSeries(goCate, "GO terms", "Number of 
hits", "Histogram");
         AxisChartDataSet axds = null;
         try {
             axds = new AxisChartDataSet(counts, new String[]{""}, new 
Paint[]{Color.blue.darker()}, ChartType.BAR, new BarChartProperties());
         } catch (ChartDataException ex) {
             ex.printStackTrace();
         }
         ds.addIAxisPlotDataSet(axds);
         AxisChart ac = new AxisChart(ds, new ChartProperties(), new 
AxisProperties(), null, this.panel.getWidth(), this.panel.getHeight());

         ac.setGraphics2D((Graphics2D) this.panel.getGraphics());
         try {
             ac.render();
         } catch (ChartDataException ex) {
             ex.printStackTrace();
         } catch (PropertyException ex) {
             ex.printStackTrace();
         }
     }

Which is essentially a copy of the SwingDemo of jCharts source code.

However, the chart is flickering and mostly showing only a grey pane. 
Furthermore, the frame is automatically resizing to a very small size. 
The 1.0.0-alpha release also shows the flickering but not the resizing.

Does anybody have an idea what goes wrong?

Thanks,
Andreas


-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642