krysalis-jcharts/src/java/org/krysalis/jcharts/demo/userGuide BarChartsGuide.java,1.4,1.5

"Nathaniel G. Auvil" <[email protected]> Tue, 27 Jul 2004 00:53:28 +0000
Newsgroups gmane.comp.krysalis.jcharts.cvs
Message-ID <[email protected]>
Update of /cvsroot/jcharts/krysalis-jcharts/src/java/org/krysalis/jcharts/demo/userGuide
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19673/src/java/org/krysalis/jcharts/demo/userGuide

Modified Files:
	BarChartsGuide.java 
Log Message:


Index: BarChartsGuide.java
===================================================================
RCS file: /cvsroot/jcharts/krysalis-jcharts/src/java/org/krysalis/jcharts/demo/userGuide/BarChartsGuide.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** BarChartsGuide.java	22 Jul 2004 01:28:20 -0000	1.4
--- BarChartsGuide.java	27 Jul 2004 00:53:26 -0000	1.5
***************
*** 39,42 ****
--- 39,43 ----
  import org.krysalis.jcharts.chartData.DataSeries;
  import org.krysalis.jcharts.chartData.AxisChartDataSet;
+ import org.krysalis.jcharts.chartData.interfaces.IAxisDataSeries;
  import org.krysalis.jcharts.axisChart.AxisChart;
  import org.krysalis.jcharts.axisChart.customRenderers.axisValue.renderers.ValueLabelPosition;
***************
*** 48,54 ****
--- 49,58 ----
  import org.krysalis.jcharts.properties.ChartProperties;
  import org.krysalis.jcharts.properties.ClusteredBarChartProperties;
+ import org.krysalis.jcharts.properties.StackedBarChart3DProperties;
  import org.krysalis.jcharts.properties.StackedBarChartProperties;
+ import org.krysalis.jcharts.properties.util.ChartFont;
  import org.krysalis.jcharts.properties.util.ChartStroke;
  import org.krysalis.jcharts.types.ChartType;
+ import org.krysalis.jcharts.test.ChartTestDriver;
  import org.krysalis.jcharts.test.TestDataGenerator;
  
***************
*** 79,82 ****
--- 83,88 ----
  		this.stackedBars();
  		this.clusteredBars();
+ 		this.stacked3d();
+ 		this.stacked3dDepth();
  
  		this.horizontalPlots();
***************
*** 338,341 ****
--- 344,398 ----
  	}
  
+ 	
+ 	/***************************************************************/
+ 	private void stacked3d() throws ChartDataException
+ 	{
+ 		String[] xAxisLabels= { "1998", "1999", "2000", "2001", "2002", "2003", "2004" };
+ 		String xAxisTitle= "Years";
+ 		String yAxisTitle= "Problems";
+ 		String title= "Micro$oft at Work";
+ 		DataSeries dataSeries = new DataSeries( xAxisLabels, xAxisTitle, yAxisTitle, title );
+ 
+ 		double[][] data= new double[][]{ { 250, 45, 36, 66, 145, 80, 55  }, { 150, 15, 6, 62, 54, 10, 84  }, { 250, 45, 36, 66, 145, 80, 55  } };
+ 		String[] legendLabels= { "Bugs", "Security Holes", "Backdoors" };
+ 		Paint[] paints= new Paint[]{ Color.red, Color.blue, Color.green };
+ 		StackedBarChart3DProperties stackedBarChart3DProperties= new StackedBarChart3DProperties();
+ 		AxisChartDataSet axisChartDataSet= new AxisChartDataSet( data, legendLabels, paints, ChartType.BAR_STACKED_3D, stackedBarChart3DProperties );
+ 		dataSeries.addIAxisPlotDataSet( axisChartDataSet );
+ 
+ 		ChartProperties chartProperties= new ChartProperties();
+ 		AxisProperties axisProperties= new AxisProperties();
+ 		LegendProperties legendProperties= new LegendProperties();
+ 		AxisChart axisChart= new AxisChart( dataSeries, chartProperties, axisProperties, legendProperties, AxisChartsGuide.width, AxisChartsGuide.height );
+ 
+ 		super.exportImage( axisChart, "stackedBarChart3d" );
+ 	}
+ 	
+ 	
+ 	/***************************************************************/
+ 	private void stacked3dDepth() throws ChartDataException
+ 	{
+ 		String[] xAxisLabels= { "1998", "1999", "2000", "2001", "2002", "2003", "2004" };
+ 		String xAxisTitle= "Years";
+ 		String yAxisTitle= "Problems";
+ 		String title= "Micro$oft at Work";
+ 		DataSeries dataSeries = new DataSeries( xAxisLabels, xAxisTitle, yAxisTitle, title );
+ 
+ 		double[][] data= new double[][]{ { 250, 45, 36, 66, 145, 80, 55  }, { 150, 15, 6, 62, 54, 10, 84  }, { 250, 45, 36, 66, 145, 80, 55  } };
+ 		String[] legendLabels= { "Bugs", "Security Holes", "Backdoors" };
+ 		Paint[] paints= new Paint[]{ Color.red, Color.blue, Color.green };
+ 		StackedBarChart3DProperties stackedBarChart3DProperties= new StackedBarChart3DProperties();
+ 		stackedBarChart3DProperties.setDepth( 20 );
+ 		AxisChartDataSet axisChartDataSet= new AxisChartDataSet( data, legendLabels, paints, ChartType.BAR_STACKED_3D, stackedBarChart3DProperties );
+ 		dataSeries.addIAxisPlotDataSet( axisChartDataSet );
+ 
+ 		ChartProperties chartProperties= new ChartProperties();
+ 		AxisProperties axisProperties= new AxisProperties();
+ 		LegendProperties legendProperties= new LegendProperties();
+ 		AxisChart axisChart= new AxisChart( dataSeries, chartProperties, axisProperties, legendProperties, AxisChartsGuide.width, AxisChartsGuide.height );
+ 
+ 		super.exportImage( axisChart, "stackedBarChart3dDepth" );
+ 	}
+ 
  }
  



-------------------------------------------------------
This SF.Net email is sponsored by BEA Weblogic Workshop
FREE Java Enterprise J2EE developer tools!
Get your free copy of BEA WebLogic Workshop 8.1 today.
http://ads.osdn.com/?ad_id=4721&alloc_id=10040&op=click