|
From: Nathaniel G. A. <nat...@ya...> - 2004-01-07 16:08:07
|
That demo was a quick hack. Move the rendering of the chart into the paint() method to get it to
redraw as in:
/*********************************************************************************
*
* @param graphics
********************************************************************************/
public void paint( Graphics graphics )
{
try {
String[] labels = {"BMW", "Audi", "Lexus"};
String title = "Cars that Own";
Paint[] paints = {Color.blue, Color.gray, Color.red};
double[] data = {50d, 30d, 20d};
PieChartDataSet pieChartDataSet = new PieChartDataSet( title,
data,
labels,
paints,
this.pieChart2DProperties );
Dimension dimension= this.panel.getSize();
PieChart2D pieChart2D = new PieChart2D( pieChartDataSet,
this.legendProperties,
this.chartProperties,
(int) dimension.getWidth(),
(int) dimension.getHeight() );
pieChart2D.setGraphics2D( (Graphics2D) this.panel.getGraphics() );
pieChart2D.render();
}
catch( ChartDataException chartDataException ) {
chartDataException.printStackTrace();
}
catch( PropertyException propertyException ) {
propertyException.printStackTrace();
}
}
--- "J. David Boyd" <da...@ts...> wrote:
> I'm running the demo java code from jChart-0.7.5, and it shows the pie
> chart fine. (Windows XP, jdk 1.4.2_0 )
>
> However, if I minimize the window, then bring it back, the view is empty.
>
> Am I missing something obvious? Why doesn't the window redraw with the
> pie chart still in it?
>
> Dave
>
>
> -------------------------------------------------------
> This SF.net email is sponsored by: IBM Linux Tutorials.
> Become an expert in LINUX or just sharpen your skills. Sign up for IBM's
> Free Linux Tutorials. Learn everything from the bash shell to sys admin.
> Click now! http://ads.osdn.com/?ad_id=1278&alloc_id=3371&op=click
> _______________________________________________
> jCharts-users mailing list
> jCh...@li...
> https://lists.sourceforge.net/lists/listinfo/jcharts-users
__________________________________
Do you Yahoo!?
Yahoo! Hotjobs: Enter the "Signing Bonus" Sweepstakes
http://hotjobs.sweepstakes.yahoo.com/signingbonus
|