jcharts-0.7.5/0000755000175000001440000000000007751071404012217 5ustar onkarusersjcharts-0.7.5/build/0000755000175000001440000000000007751071404013316 5ustar onkarusersjcharts-0.7.5/build/build.xml0000644000175000001440000001732707751071404015151 0ustar onkarusers jcharts-0.7.5/demo/0000755000175000001440000000000007751071402013141 5ustar onkarusersjcharts-0.7.5/demo/simpleServlet/0000755000175000001440000000000007751071402015777 5ustar onkarusersjcharts-0.7.5/demo/simpleServlet/WEB-INF/0000755000175000001440000000000007751071402017026 5ustar onkarusersjcharts-0.7.5/demo/simpleServlet/WEB-INF/classes/0000755000175000001440000000000007751071402020463 5ustar onkarusersjcharts-0.7.5/demo/simpleServlet/WEB-INF/classes/org/0000755000175000001440000000000007751071402021252 5ustar onkarusersjcharts-0.7.5/demo/simpleServlet/WEB-INF/classes/org/jCharts/0000755000175000001440000000000007751071402022650 5ustar onkarusersjcharts-0.7.5/demo/simpleServlet/WEB-INF/classes/org/jCharts/demo/0000755000175000001440000000000007751071402023574 5ustar onkarusersjcharts-0.7.5/demo/simpleServlet/WEB-INF/classes/org/jCharts/demo/simpleServlet/0000755000175000001440000000000007751071402026432 5ustar onkarusers././@LongLink0000000000000000000000000000014500000000000011565 Lustar rootrootjcharts-0.7.5/demo/simpleServlet/WEB-INF/classes/org/jCharts/demo/simpleServlet/BarChartServlet.javajcharts-0.7.5/demo/simpleServlet/WEB-INF/classes/org/jCharts/demo/simpleServlet/BarChartServlet.java0000644000175000001440000001475207751071402032341 0ustar onkarusers/*********************************************************************************************** * File Info: $Id: BarChartServlet.java,v 1.5 2003/04/19 01:41:27 nathaniel_auvil Exp $ * Copyright (C) 2002 * Author: Nathaniel G. Auvil * Contributor(s): * * Copyright 2002 (C) Nathaniel G. Auvil. All Rights Reserved. * * Redistribution and use of this software and associated documentation ("Software"), with or * without modification, are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain copyright statements and notices. * Redistributions must also contain a copy of this document. * * 2. Redistributions in binary form must reproduce the above copyright notice, this list of * conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. * * 3. The name "jCharts" or "Nathaniel G. Auvil" must not be used to endorse or promote * products derived from this Software without prior written permission of Nathaniel G. * Auvil. For written permission, please contact nathaniel_auvil@users.sourceforge.net * * 4. Products derived from this Software may not be called "jCharts" nor may "jCharts" appear * in their names without prior written permission of Nathaniel G. Auvil. jCharts is a * registered trademark of Nathaniel G. Auvil. * * 5. Due credit should be given to the jCharts Project (http://jcharts.sourceforge.net/). * * THIS SOFTWARE IS PROVIDED BY Nathaniel G. Auvil AND CONTRIBUTORS ``AS IS'' AND ANY * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL * jCharts OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE ************************************************************************************************/ package org.jCharts.demo.simpleServlet; import org.jCharts.axisChart.AxisChart; import org.jCharts.axisChart.customRenderers.axisValue.renderers.ValueLabelPosition; import org.jCharts.axisChart.customRenderers.axisValue.renderers.ValueLabelRenderer; import org.jCharts.chartData.AxisChartDataSet; import org.jCharts.chartData.DataSeries; import org.jCharts.chartData.interfaces.IAxisDataSeries; import org.jCharts.encoders.ServletEncoderHelper; import org.jCharts.properties.*; import org.jCharts.properties.util.ChartFont; import org.jCharts.types.ChartType; import javax.servlet.ServletException; import javax.servlet.http.*; import java.awt.*; import java.io.IOException; public class BarChartServlet extends HttpServlet { //---all of my charts serviced by this Servlet will have the same properties. private BarChartProperties barChartProperties; //---all of my charts serviced by this Servlet will have the same properties. protected LegendProperties legendProperties; protected AxisProperties axisProperties; protected ChartProperties chartProperties; protected int width = 550; protected int height = 360; /********************************************************************************************** * **********************************************************************************************/ public void init() { this.legendProperties = new LegendProperties(); this.chartProperties = new ChartProperties(); this.axisProperties = new AxisProperties( false ); ChartFont axisScaleFont = new ChartFont( new Font( "Georgia Negreta cursiva", Font.PLAIN, 13 ), Color.black ); axisProperties.getXAxisProperties().setScaleChartFont( axisScaleFont ); axisProperties.getYAxisProperties().setScaleChartFont( axisScaleFont ); ChartFont axisTitleFont = new ChartFont( new Font( "Arial Narrow", Font.PLAIN, 14 ), Color.black ); axisProperties.getXAxisProperties().setTitleChartFont( axisTitleFont ); axisProperties.getYAxisProperties().setTitleChartFont( axisTitleFont ); DataAxisProperties dataAxisProperties = (DataAxisProperties) axisProperties.getYAxisProperties(); try { dataAxisProperties.setUserDefinedScale( -3000, 3000 ); } catch( PropertyException propertyException ) { propertyException.printStackTrace(); } dataAxisProperties.setRoundToNearest( 2 ); ChartFont titleFont = new ChartFont( new Font( "Georgia Negreta cursiva", Font.PLAIN, 14 ), Color.black ); this.chartProperties.setTitleFont( titleFont ); this.barChartProperties = new BarChartProperties(); ValueLabelRenderer valueLabelRenderer = new ValueLabelRenderer( false, false, true, -1 ); valueLabelRenderer.setValueLabelPosition( ValueLabelPosition.ON_TOP ); valueLabelRenderer.useVerticalLabels( false ); barChartProperties.addPostRenderEventListener( valueLabelRenderer ); } /********************************************************************************************** * **********************************************************************************************/ public void service( HttpServletRequest req, HttpServletResponse httpServletResponse ) throws ServletException, IOException { try { String[] xAxisLabels = {"1995", "1996", "1997", "1998", "1999", "2000", "2001", "2002", "2003", "2004"}; String xAxisTitle = "Years"; String yAxisTitle = "Problems"; String title = "Micro$oft At Work"; IAxisDataSeries dataSeries = new DataSeries( xAxisLabels, xAxisTitle, yAxisTitle, title ); double[][] data = new double[][]{{1500, 6880, 4510, 2600, -1200, -1580, 7000, 4555, 4000, 6120}}; String[] legendLabels = {"Bugs"}; Paint[] paints = new Paint[]{Color.yellow}; dataSeries.addIAxisPlotDataSet( new AxisChartDataSet( data, legendLabels, paints, ChartType.BAR, this.barChartProperties ) ); AxisChart axisChart = new AxisChart( dataSeries, this.chartProperties, this.axisProperties, this.legendProperties, this.width, this.height ); ServletEncoderHelper.encodeJPEG13( axisChart, 1.0f, httpServletResponse ); } catch( Throwable throwable ) { //HACK do your error handling here... throwable.printStackTrace(); } } } jcharts-0.7.5/demo/simpleServlet/WEB-INF/classes/org/jCharts/demo/simpleServlet/ChartServlet.java0000644000175000001440000000716507751071402031714 0ustar onkarusers/*********************************************************************************************** * File Info: $Id: ChartServlet.java,v 1.2 2003/03/14 03:23:23 nathaniel_auvil Exp $ * Copyright (C) 2002 * Author: Nathaniel G. Auvil * Contributor(s): * * Copyright 2002 (C) Nathaniel G. Auvil. All Rights Reserved. * * Redistribution and use of this software and associated documentation ("Software"), with or * without modification, are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain copyright statements and notices. * Redistributions must also contain a copy of this document. * * 2. Redistributions in binary form must reproduce the above copyright notice, this list of * conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. * * 3. The name "jCharts" or "Nathaniel G. Auvil" must not be used to endorse or promote * products derived from this Software without prior written permission of Nathaniel G. * Auvil. For written permission, please contact nathaniel_auvil@users.sourceforge.net * * 4. Products derived from this Software may not be called "jCharts" nor may "jCharts" appear * in their names without prior written permission of Nathaniel G. Auvil. jCharts is a * registered trademark of Nathaniel G. Auvil. * * 5. Due credit should be given to the jCharts Project (http://jcharts.sourceforge.net/). * * THIS SOFTWARE IS PROVIDED BY Nathaniel G. Auvil AND CONTRIBUTORS ``AS IS'' AND ANY * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL * jCharts OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE ************************************************************************************************/ package org.jCharts.demo.simpleServlet; import org.jCharts.Chart; import org.jCharts.chartData.ChartDataException; import org.jCharts.encoders.ServletEncoderHelper; import org.jCharts.properties.PropertyException; import javax.servlet.ServletException; import javax.servlet.http.*; import java.io.IOException; public class ChartServlet extends HttpServlet { public static final String CHART = "CHART"; public static final String IMAGE_MAP = "IMAGE_MAP"; /********************************************************************************************** * **********************************************************************************************/ public void service( HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse ) throws ServletException, IOException { Chart chart = (Chart) httpServletRequest.getSession().getAttribute( CHART ); try { //---call encode just like you would normally ServletEncoderHelper.encodeJPEG13( chart, 1.0f, httpServletResponse ); } catch( PropertyException propertyException ) { propertyException.printStackTrace(); } catch( ChartDataException dataException ) { dataException.printStackTrace(); } httpServletRequest.getSession().removeAttribute( CHART ); } } ././@LongLink0000000000000000000000000000014700000000000011567 Lustar rootrootjcharts-0.7.5/demo/simpleServlet/WEB-INF/classes/org/jCharts/demo/simpleServlet/ComboChartServlet.javajcharts-0.7.5/demo/simpleServlet/WEB-INF/classes/org/jCharts/demo/simpleServlet/ComboChartServlet.ja0000644000175000001440000001444707751071402032346 0ustar onkarusers/*********************************************************************************************** * File Info: $Id: ComboChartServlet.java,v 1.3 2003/03/14 03:23:23 nathaniel_auvil Exp $ * Copyright (C) 2000 * Author: Nathaniel G. Auvil * Contributor(s): * * Copyright 2002 (C) Nathaniel G. Auvil. All Rights Reserved. * * Redistribution and use of this software and associated documentation * ("Software"), with or without modification, are permitted provided * that the following conditions are met: * * 1. Redistributions of source code must retain copyright * statements and notices. Redistributions must also contain a * copy of this document. * * 2. Redistributions in binary form must reproduce the * above copyright notice, this list of conditions and the * following disclaimer in the documentation and/or other * materials provided with the distribution. * * 3. The name "jCharts" or "Nathaniel G. Auvil" must not be used to * endorse or promote products derived from this Software without * prior written permission of Nathaniel G. Auvil. For written * permission, please contact nathaniel_auvil@users.sourceforge.net * * 4. Products derived from this Software may not be called "jCharts" * nor may "jCharts" appear in their names without prior written * permission of Nathaniel G. Auvil. jCharts is a registered * trademark of Nathaniel G. Auvil. * * 5. Due credit should be given to the jCharts Project * (http://jcharts.sourceforge.net/). * * THIS SOFTWARE IS PROVIDED BY Nathaniel G. Auvil AND CONTRIBUTORS * ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT * NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL * jCharts OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED * OF THE POSSIBILITY OF SUCH DAMAGE. ************************************************************************************************/ package org.jCharts.demo.simpleServlet; import org.jCharts.axisChart.AxisChart; import org.jCharts.chartData.AxisChartDataSet; import org.jCharts.chartData.DataSeries; import org.jCharts.chartData.interfaces.IAxisDataSeries; import org.jCharts.encoders.ServletEncoderHelper; import org.jCharts.properties.*; import org.jCharts.properties.util.ChartFont; import org.jCharts.types.ChartType; import javax.servlet.ServletException; import javax.servlet.http.*; import java.awt.*; import java.io.IOException; public class ComboChartServlet extends HttpServlet { //---all of my charts serviced by this Servlet will have the same properties. private LineChartProperties lineChartProperties; //---all of my charts serviced by this Servlet will have the same properties. private BarChartProperties barChartProperties; //---all of my charts serviced by this Servlet will have the same properties. protected LegendProperties legendProperties; protected AxisProperties axisProperties; protected ChartProperties chartProperties; protected int width = 550; protected int height = 360; /********************************************************************************************** * **********************************************************************************************/ public void init() { this.legendProperties = new LegendProperties(); this.chartProperties = new ChartProperties(); this.axisProperties = new AxisProperties( false ); ChartFont axisScaleFont = new ChartFont( new Font( "Georgia Negreta cursiva", Font.PLAIN, 13 ), Color.black ); axisProperties.getXAxisProperties().setScaleChartFont( axisScaleFont ); axisProperties.getYAxisProperties().setScaleChartFont( axisScaleFont ); ChartFont axisTitleFont = new ChartFont( new Font( "Arial Narrow", Font.PLAIN, 14 ), Color.black ); axisProperties.getXAxisProperties().setTitleChartFont( axisTitleFont ); axisProperties.getYAxisProperties().setTitleChartFont( axisTitleFont ); ChartFont titleFont = new ChartFont( new Font( "Georgia Negreta cursiva", Font.PLAIN, 14 ), Color.black ); this.chartProperties.setTitleFont( titleFont ); Stroke[] strokes = {LineChartProperties.DEFAULT_LINE_STROKE}; Shape[] shapes = {PointChartProperties.SHAPE_DIAMOND}; this.lineChartProperties = new LineChartProperties( strokes, shapes ); this.barChartProperties = new BarChartProperties(); } /********************************************************************************************** * **********************************************************************************************/ public void service( HttpServletRequest req, HttpServletResponse httpServletResponse ) throws ServletException, IOException { try { String[] xAxisLabels = {"1995", "1996", "1997", "1998", "1999", "2000", "2001", "2002", "2003", "2004"}; String xAxisTitle = "Years"; String yAxisTitle = "Problems"; String title = "Micro$oft At Work"; IAxisDataSeries dataSeries = new DataSeries( xAxisLabels, xAxisTitle, yAxisTitle, title ); double[][] data = new double[][]{{1500, 6880, 4510, 2600, 1200, 1580, 8000, 4555, 4000, 6120}}; String[] legendLabels = {"Bugs"}; Paint[] paints = new Paint[]{Color.blue.darker()}; Paint[] linePaints = new Paint[]{Color.green}; dataSeries.addIAxisPlotDataSet( new AxisChartDataSet( data, legendLabels, paints, ChartType.BAR, this.barChartProperties ) ); dataSeries.addIAxisPlotDataSet( new AxisChartDataSet( data, legendLabels, linePaints, ChartType.LINE, this.lineChartProperties ) ); AxisChart axisChart = new AxisChart( dataSeries, this.chartProperties, this.axisProperties, this.legendProperties, this.width, this.height ); ServletEncoderHelper.encodeJPEG13( axisChart, 1.0f, httpServletResponse ); } catch( Throwable throwable ) { //HACK do your error handling here... throwable.printStackTrace(); } } } ././@LongLink0000000000000000000000000000016200000000000011564 Lustar rootrootjcharts-0.7.5/demo/simpleServlet/WEB-INF/classes/org/jCharts/demo/simpleServlet/HorizontalBarImageMapServlet.javajcharts-0.7.5/demo/simpleServlet/WEB-INF/classes/org/jCharts/demo/simpleServlet/HorizontalBarImageMa0000644000175000001440000001462307751071402032362 0ustar onkarusers/*********************************************************************************************** * File Info: $Id: HorizontalBarImageMapServlet.java,v 1.3 2003/03/14 03:23:23 nathaniel_auvil Exp $ * Copyright (C) 2002 * Author: Nathaniel G. Auvil * Contributor(s): * * Copyright 2002 (C) Nathaniel G. Auvil. All Rights Reserved. * * Redistribution and use of this software and associated documentation ("Software"), with or * without modification, are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain copyright statements and notices. * Redistributions must also contain a copy of this document. * * 2. Redistributions in binary form must reproduce the above copyright notice, this list of * conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. * * 3. The name "jCharts" or "Nathaniel G. Auvil" must not be used to endorse or promote * products derived from this Software without prior written permission of Nathaniel G. * Auvil. For written permission, please contact nathaniel_auvil@users.sourceforge.net * * 4. Products derived from this Software may not be called "jCharts" nor may "jCharts" appear * in their names without prior written permission of Nathaniel G. Auvil. jCharts is a * registered trademark of Nathaniel G. Auvil. * * 5. Due credit should be given to the jCharts Project (http://jcharts.sourceforge.net/). * * THIS SOFTWARE IS PROVIDED BY Nathaniel G. Auvil AND CONTRIBUTORS ``AS IS'' AND ANY * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL * jCharts OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE ************************************************************************************************/ package org.jCharts.demo.simpleServlet; import org.jCharts.axisChart.AxisChart; import org.jCharts.chartData.*; import org.jCharts.chartData.interfaces.IAxisDataSeries; import org.jCharts.imageMap.ImageMap; import org.jCharts.properties.*; import org.jCharts.properties.util.ChartFont; import org.jCharts.types.ChartType; import javax.servlet.ServletException; import javax.servlet.http.*; import java.awt.*; import java.io.IOException; public class HorizontalBarImageMapServlet extends HttpServlet { //---all of my charts serviced by this Servlet will have the same properties. private BarChartProperties barChartProperties; //---all of my charts serviced by this Servlet will have the same properties. protected LegendProperties legendProperties; protected AxisProperties axisProperties; protected ChartProperties chartProperties; protected int width = 550; protected int height = 360; /********************************************************************************************** * **********************************************************************************************/ public void init() { this.legendProperties = new LegendProperties(); this.chartProperties = new ChartProperties(); this.axisProperties = new AxisProperties( true ); ChartFont axisScaleFont = new ChartFont( new Font( "Georgia Negreta cursiva", Font.PLAIN, 13 ), Color.black ); axisProperties.getXAxisProperties().setScaleChartFont( axisScaleFont ); axisProperties.getYAxisProperties().setScaleChartFont( axisScaleFont ); ChartFont axisTitleFont = new ChartFont( new Font( "Arial Narrow", Font.PLAIN, 14 ), Color.black ); axisProperties.getXAxisProperties().setTitleChartFont( axisTitleFont ); axisProperties.getYAxisProperties().setTitleChartFont( axisTitleFont ); ChartFont titleFont = new ChartFont( new Font( "Georgia Negreta cursiva", Font.PLAIN, 14 ), Color.black ); this.chartProperties.setTitleFont( titleFont ); this.barChartProperties = new BarChartProperties(); } /********************************************************************************************** * * **********************************************************************************************/ public void service( HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse ) throws ServletException, IOException { try { String[] xAxisLabels = {"1995", "1996", "1997", "1998", "1999", "2000", "2001", "2002", "2003", "2004"}; String xAxisTitle = "Years"; String yAxisTitle = "Problems"; String title = "Micro$oft At Work"; IAxisDataSeries dataSeries = new DataSeries( xAxisLabels, xAxisTitle, yAxisTitle, title ); double[][] data = new double[][]{{1500, 6880, 4510, 2600, 1200, 1580, 8000, 4555, 4000, 6120}}; String[] legendLabels = {"Bugs"}; Paint[] paints = new Paint[]{Color.blue.darker()}; dataSeries.addIAxisPlotDataSet( new AxisChartDataSet( data, legendLabels, paints, ChartType.BAR, this.barChartProperties ) ); AxisChart axisChart = new AxisChart( dataSeries, this.chartProperties, this.axisProperties, this.legendProperties, this.width, this.height ); //---this call will render the chart to an internal BufferedImage, creating all the image map coordinates axisChart.renderWithImageMap(); //---get the ImageMap information from the chart ImageMap imageMap = axisChart.getImageMap(); //---set the ImageMap into the HttpServletRequest so can get it out in JSP httpServletRequest.setAttribute( ChartServlet.IMAGE_MAP, imageMap ); //---set the Chart into the HttpSession so we can stream it in another request httpServletRequest.getSession( true ).setAttribute( ChartServlet.CHART, axisChart ); } catch( ChartDataException chartDataException ) { chartDataException.printStackTrace(); } catch( PropertyException propertyException ) { propertyException.printStackTrace(); } this.getServletContext().getRequestDispatcher( "/imageMapChart.jsp" ).forward( httpServletRequest, httpServletResponse ); } } ././@LongLink0000000000000000000000000000014700000000000011567 Lustar rootrootjcharts-0.7.5/demo/simpleServlet/WEB-INF/classes/org/jCharts/demo/simpleServlet/PieChart2DServlet.javajcharts-0.7.5/demo/simpleServlet/WEB-INF/classes/org/jCharts/demo/simpleServlet/PieChart2DServlet.ja0000644000175000001440000001163207751071402032203 0ustar onkarusers/*********************************************************************************************** * File Info: $Id: PieChart2DServlet.java,v 1.2 2003/03/14 03:23:23 nathaniel_auvil Exp $ * Copyright (C) 2000 * Author: Nathaniel G. Auvil * Contributor(s): * * Copyright 2002 (C) Nathaniel G. Auvil. All Rights Reserved. * * Redistribution and use of this software and associated documentation ("Software"), with or * without modification, are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain copyright statements and notices. * Redistributions must also contain a copy of this document. * * 2. Redistributions in binary form must reproduce the above copyright notice, this list of * conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. * * 3. The name "jCharts" or "Nathaniel G. Auvil" must not be used to endorse or promote * products derived from this Software without prior written permission of Nathaniel G. * Auvil. For written permission, please contact nathaniel_auvil@users.sourceforge.net * * 4. Products derived from this Software may not be called "jCharts" nor may "jCharts" appear * in their names without prior written permission of Nathaniel G. Auvil. jCharts is a * registered trademark of Nathaniel G. Auvil. * * 5. Due credit should be given to the jCharts Project (http://jcharts.sourceforge.net/). * * THIS SOFTWARE IS PROVIDED BY Nathaniel G. Auvil AND CONTRIBUTORS ``AS IS'' AND ANY * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL * jCharts OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE ************************************************************************************************/ package org.jCharts.demo.simpleServlet; import org.jCharts.chartData.ChartDataException; import org.jCharts.chartData.PieChartDataSet; import org.jCharts.encoders.ServletEncoderHelper; import org.jCharts.nonAxisChart.PieChart2D; import org.jCharts.properties.*; import javax.servlet.ServletException; import javax.servlet.http.*; import java.awt.*; import java.io.IOException; public class PieChart2DServlet extends HttpServlet { //---all of my pie charts serviced by this Servlet will have the same properties. private PieChart2DProperties properties; private LegendProperties legendProperties; private ChartProperties chartProperties; private int width = 550; private int height = 350; /********************************************************************************************** * **********************************************************************************************/ public void init() { //---all charts of this type of pie chart are going to share the same properties. this.properties = new PieChart2DProperties(); this.legendProperties = new LegendProperties(); this.legendProperties.setNumColumns( 2 ); this.legendProperties.setPlacement( LegendProperties.RIGHT ); this.chartProperties = new ChartProperties(); } /********************************************************************************************** * **********************************************************************************************/ public void service( HttpServletRequest req, HttpServletResponse response ) throws ServletException, IOException { try { PieChart2D pieChart2D = new PieChart2D( this.getData(), this.legendProperties, this.chartProperties, this.width, this.height ); ServletEncoderHelper.encodeJPEG13( pieChart2D, 1.0f, response ); } catch( Throwable throwable ) { //HACK do your error handling here... throwable.printStackTrace(); } } /****************************************************************************************** * Returns a Tests a 'real' data set and usage. * * @throws ChartDataException ******************************************************************************************/ private PieChartDataSet getData() throws ChartDataException { double[] data = new double[]{40, 15, 35, 65, 59}; Paint[] paints = new Paint[]{Color.blue, Color.red, Color.green, Color.yellow, Color.white}; String[] labels = {"BMW", "Honda", "Lexus", "Audi", "Acura"}; return new PieChartDataSet( "Cars That Own!", data, labels, paints, this.properties ); } } ././@LongLink0000000000000000000000000000015500000000000011566 Lustar rootrootjcharts-0.7.5/demo/simpleServlet/WEB-INF/classes/org/jCharts/demo/simpleServlet/ScatterPlotChartServlet.javajcharts-0.7.5/demo/simpleServlet/WEB-INF/classes/org/jCharts/demo/simpleServlet/ScatterPlotChartServ0000644000175000001440000001626107751071402032451 0ustar onkarusers/*********************************************************************************************** * File Info: $Id: ScatterPlotChartServlet.java,v 1.2 2003/03/14 03:23:23 nathaniel_auvil Exp $ * Copyright (C) 2002 * Author: Nathaniel G. Auvil * Contributor(s): * * Copyright 2002 (C) Nathaniel G. Auvil. All Rights Reserved. * * Redistribution and use of this software and associated documentation ("Software"), with or * without modification, are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain copyright statements and notices. * Redistributions must also contain a copy of this document. * * 2. Redistributions in binary form must reproduce the above copyright notice, this list of * conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. * * 3. The name "jCharts" or "Nathaniel G. Auvil" must not be used to endorse or promote * products derived from this Software without prior written permission of Nathaniel G. * Auvil. For written permission, please contact nathaniel_auvil@users.sourceforge.net * * 4. Products derived from this Software may not be called "jCharts" nor may "jCharts" appear * in their names without prior written permission of Nathaniel G. Auvil. jCharts is a * registered trademark of Nathaniel G. Auvil. * * 5. Due credit should be given to the jCharts Project (http://jcharts.sourceforge.net/). * * THIS SOFTWARE IS PROVIDED BY Nathaniel G. Auvil AND CONTRIBUTORS ``AS IS'' AND ANY * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL * jCharts OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE ************************************************************************************************/ package org.jCharts.demo.simpleServlet; import org.jCharts.axisChart.ScatterPlotAxisChart; import org.jCharts.chartData.ScatterPlotDataSeries; import org.jCharts.chartData.ScatterPlotDataSet; import org.jCharts.encoders.ServletEncoderHelper; import org.jCharts.properties.*; import org.jCharts.properties.util.ChartFont; import javax.servlet.ServletException; import javax.servlet.http.*; import java.awt.*; import java.awt.geom.Point2D; import java.io.IOException; public class ScatterPlotChartServlet extends HttpServlet { //---all of my charts serviced by this Servlet will have the same properties. protected LegendProperties legendProperties; protected AxisProperties axisProperties; protected ChartProperties chartProperties; protected int width = 550; protected int height = 360; /********************************************************************************************** * **********************************************************************************************/ public void init() { this.legendProperties = new LegendProperties(); this.chartProperties = new ChartProperties(); this.axisProperties = new AxisProperties( true ); ChartFont axisScaleFont = new ChartFont( new Font( "Georgia Negreta cursiva", Font.PLAIN, 13 ), Color.black ); axisProperties.getXAxisProperties().setScaleChartFont( axisScaleFont ); axisProperties.getYAxisProperties().setScaleChartFont( axisScaleFont ); ChartFont axisTitleFont = new ChartFont( new Font( "Arial Narrow", Font.PLAIN, 14 ), Color.black ); axisProperties.getXAxisProperties().setTitleChartFont( axisTitleFont ); axisProperties.getYAxisProperties().setTitleChartFont( axisTitleFont ); ChartFont titleFont = new ChartFont( new Font( "Georgia Negreta cursiva", Font.PLAIN, 14 ), Color.black ); this.chartProperties.setTitleFont( titleFont ); } /****************************************************************************************** * * ******************************************************************************************/ private ScatterPlotProperties createScatterPlotProperties() { Stroke[] strokes = new Stroke[]{LineChartProperties.DEFAULT_LINE_STROKE}; Shape[] shapes = new Shape[]{PointChartProperties.SHAPE_CIRCLE}; return new ScatterPlotProperties( strokes, shapes ); } /***************************************************************************************** * Generates a random MultiDataSet * * @return ScatterPlotDataSet ******************************************************************************************/ private ScatterPlotDataSet createScatterPlotDataSet() { Point2D.Double[] points = new Point2D.Double[ 20 ]; for( int x = 0; x < 20; x++ ) { //--- y = x^2 points[ x ] = ScatterPlotDataSet.createPoint2DDouble(); points[ x ].setLocation( x, Math.pow( x, 2 ) ); } ScatterPlotDataSet scatterPlotDataSet = new ScatterPlotDataSet( this.createScatterPlotProperties() ); scatterPlotDataSet.addDataPoints( points, Color.red, "Proprietary" ); return scatterPlotDataSet; } /********************************************************************************************** * **********************************************************************************************/ public void service( HttpServletRequest req, HttpServletResponse httpServletResponse ) throws ServletException, IOException { try { ScatterPlotDataSet scatterPlotDataSet = this.createScatterPlotDataSet(); ScatterPlotDataSeries scatterPlotDataSeries = new ScatterPlotDataSeries( scatterPlotDataSet, "X-Axis Title", "Y-Axis Title", "Chart Title" ); DataAxisProperties xAxisProperties = new DataAxisProperties(); xAxisProperties.setUserDefinedScale( -5, 3 ); xAxisProperties.setNumItems( 10 ); xAxisProperties.setRoundToNearest( 0 ); DataAxisProperties yAxisProperties = new DataAxisProperties(); yAxisProperties.setUserDefinedScale( -30, 50 ); yAxisProperties.setNumItems( 10 ); yAxisProperties.setRoundToNearest( 1 ); AxisProperties axisProperties = new AxisProperties( xAxisProperties, yAxisProperties ); ChartProperties chartProperties = new ChartProperties(); LegendProperties legendProperties = new LegendProperties(); ScatterPlotAxisChart scatterPlotAxisChart = new ScatterPlotAxisChart( scatterPlotDataSeries, chartProperties, axisProperties, legendProperties, 500, 400 ); ServletEncoderHelper.encodeJPEG13( scatterPlotAxisChart, 1.0f, httpServletResponse ); } catch( Throwable throwable ) { //HACK do your error handling here... throwable.printStackTrace(); } } } jcharts-0.7.5/demo/simpleServlet/WEB-INF/lib/0000755000175000001440000000000007751071402017574 5ustar onkarusersjcharts-0.7.5/demo/simpleServlet/WEB-INF/web.xml0000644000175000001440000000422307751071402020326 0ustar onkarusers jCharts - Simple Servlet Examples Web Application PieChart2DServlet org.jCharts.demo.simpleServlet.PieChart2DServlet BarChartServlet org.jCharts.demo.simpleServlet.BarChartServlet ComboChartServlet org.jCharts.demo.simpleServlet.ComboChartServlet ScatterPlotChartServlet org.jCharts.demo.simpleServlet.ScatterPlotChartServlet HorizontalBarImageMapServlet org.jCharts.demo.simpleServlet.HorizontalBarImageMapServlet ChartServlet org.jCharts.demo.simpleServlet.ChartServlet PieChart2DServlet /PieChart2DServlet/* BarChartServlet /BarChartServlet/* ComboChartServlet /ComboChartServlet/* ScatterPlotChartServlet /ScatterPlotChartServlet/* HorizontalBarImageMapServlet /HorizontalBarImageMapServlet/* ChartServlet /ChartServlet/* jcharts-0.7.5/demo/simpleServlet/chart.jsp0000644000175000001440000001077107751071402017624 0ustar onkarusers<%@ page import="java.awt.*,org.jCharts.*,org.jCharts.chartData.*,org.jCharts.properties.*,org.jCharts.types.ChartType,org.jCharts.axisChart.*,org.jCharts.test.TestDataGenerator,org.jCharts.encoders.JPEGEncoder13,org.jCharts.properties.util.ChartFont, org.jCharts.encoders.ServletEncoderHelper"%><% /************************************************************************************** * Copyright 2002 (C) Nathaniel G. Auvil. All Rights Reserved. * * Redistribution and use of this software and associated documentation * ("Software"), with or without modification, are permitted provided * that the following conditions are met: * * 1. Redistributions of source code must retain copyright * statements and notices. Redistributions must also contain a * copy of this document. * * 2. Redistributions in binary form must reproduce the * above copyright notice, this list of conditions and the * following disclaimer in the documentation and/or other * materials provided with the distribution. * * 3. The name "jCharts" or "Nathaniel G. Auvil" must not be used to * endorse or promote products derived from this Software without * prior written permission of Nathaniel G. Auvil. For written * permission, please contact nathaniel_auvil@users.sourceforge.net * * 4. Products derived from this Software may not be called "jCharts" * nor may "jCharts" appear in their names without prior written * permission of Nathaniel G. Auvil. jCharts is a registered * trademark of Nathaniel G. Auvil. * * 5. Due credit should be given to the jCharts Project * (http://jcharts.sourceforge.net/). * * THIS SOFTWARE IS PROVIDED BY Nathaniel G. Auvil AND CONTRIBUTORS * ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT * NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL * jCharts OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED * OF THE POSSIBILITY OF SUCH DAMAGE. **********************************************************************************/ try { //From AxisChartServlet.java:init() LegendProperties legendProperties = new LegendProperties(); ChartProperties chartProperties = new ChartProperties(); AxisProperties axisProperties = new AxisProperties( false ); ChartFont axisScaleFont = new ChartFont( new Font( "Georgia Negreta cursiva", Font.PLAIN, 13 ), Color.black ); axisProperties.getXAxisProperties().setScaleChartFont( axisScaleFont ); axisProperties.getYAxisProperties().setScaleChartFont( axisScaleFont ); ChartFont axisTitleFont = new ChartFont( new Font( "Arial Narrow", Font.PLAIN, 14 ), Color.black ); axisProperties.getXAxisProperties().setTitleChartFont( axisTitleFont ); axisProperties.getYAxisProperties().setTitleChartFont( axisTitleFont ); Stroke[] strokes= { LineChartProperties.DEFAULT_LINE_STROKE, LineChartProperties.DEFAULT_LINE_STROKE, LineChartProperties.DEFAULT_LINE_STROKE }; Shape[] shapes= { PointChartProperties.SHAPE_TRIANGLE,PointChartProperties.SHAPE_DIAMOND, PointChartProperties.SHAPE_CIRCLE }; LineChartProperties lineChartProperties = new LineChartProperties(strokes,shapes); 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 ); //From AxisChartServlet.java:createAxisChartDataSet double[][] data= TestDataGenerator.getRandomNumbers( 3, 7, 200, 500 ); String[] legendLabels= { "Bugs", "Security Holes", "Backdoors" }; Paint[] paints= TestDataGenerator.getRandomPaints( 3 ); AxisChartDataSet acds = new AxisChartDataSet(data, legendLabels, paints,ChartType.LINE, lineChartProperties ); dataSeries.addIAxisPlotDataSet(acds); AxisChart axisChart = new AxisChart(dataSeries, chartProperties, axisProperties,legendProperties, 550, 360); ServletEncoderHelper.encodeJPEG13(axisChart, 1.0f, response); } catch(Exception e) { System.out.println(e); } %>jcharts-0.7.5/demo/simpleServlet/imageMapChart.jsp0000644000175000001440000001100507751071402021214 0ustar onkarusers <%@page import="org.jCharts.demo.simpleServlet.ChartServlet" %> <%@page import="org.jCharts.imageMap.*" %> <%@page import="java.util.Iterator" %> <% /************************************************************************************** * Copyright 2002 (C) Nathaniel G. Auvil. All Rights Reserved. * * Redistribution and use of this software and associated documentation * ("Software"), with or without modification, are permitted provided * that the following conditions are met: * * 1. Redistributions of source code must retain copyright * statements and notices. Redistributions must also contain a * copy of this document. * * 2. Redistributions in binary form must reproduce the * above copyright notice, this list of conditions and the * following disclaimer in the documentation and/or other * materials provided with the distribution. * * 3. The name "jCharts" or "Nathaniel G. Auvil" must not be used to * endorse or promote products derived from this Software without * prior written permission of Nathaniel G. Auvil. For written * permission, please contact nathaniel_auvil@users.sourceforge.net * * 4. Products derived from this Software may not be called "jCharts" * nor may "jCharts" appear in their names without prior written * permission of Nathaniel G. Auvil. jCharts is a registered * trademark of Nathaniel G. Auvil. * * 5. Due credit should be given to the jCharts Project * (http://jcharts.sourceforge.net/). * * THIS SOFTWARE IS PROVIDED BY Nathaniel G. Auvil AND CONTRIBUTORS * ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT * NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL * jCharts OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED * OF THE POSSIBILITY OF SUCH DAMAGE. **********************************************************************************/ %> jCharts - Client-side Image Map Demo
     Client-side Image Map Demo


<% StringBuffer html= new StringBuffer( 100 ); ImageMap imageMap= (ImageMap) request.getAttribute( ChartServlet.IMAGE_MAP ); Iterator iterator= imageMap.getIterator(); while( iterator.hasNext() ) { ImageMapArea imageMapArea= (ImageMapArea) iterator.next(); html.append( "href=\"javascript:showValues(" ); html.append( imageMapArea.getValue() ); html.append( ",'" ); html.append( imageMapArea.getLengendLabel() ); html.append( "','" ); html.append( imageMapArea.getXAxisLabel() ); html.append( "');\"" ); %> <%= imageMapArea.toHTML( html.toString() ) %> <% //---reuse same StringBuffer Object html.delete( 0, html.length() ); } %>

Click on the chart to see the values.

This is a trivial example of what is possible. For example, you could create a mouseOver function to show the values when the mouse simply moves over the chart. Or, you could use this to drill down into charts. Or you could link to other pages... There are many things one could do...

I will leave the rest to your imagination and your html coder... jcharts-0.7.5/demo/simpleServlet/index.html0000644000175000001440000001016707751071402020001 0ustar onkarusers jCharts - Simple Servlet Examples
   jCharts Simple Servlet Demo's

Pie
Bar
Horizontal Bar with Image Map
Combo
Scatter Plot

Here is a chart generated directly from a JSP, although, this is not a good design to follow, as
the preferred way to generate a chart, is to use a Servlet.

These examples were tested with Tomcat 4.0.4 and the jdk 1.4 and jdk 1.3

jcharts-0.7.5/demo/simpleServlet/jChartsTitle.png0000644000175000001440000000723507751071402021114 0ustar onkarusers‰PNG  IHDRÈA…|ÙtEXtCreation TimeÑ-1¢íÞtIMEÑ/ ƒ/µž pHYs  ÒÝ~üIDATxÚí\OlůíþKÚPUv« ). „ì*!!ñïÀ%é %׆ ‡€8‘r¬{M{l’ qIÄ­ µ/ˆÆ ÄF…BTuJBÒ?Ijóí¼x³Ù™Yï®còk3Ÿ¬h³ž}óÞ7ï}3» cÿÿí´­B,tœœÛiÓv¶Xa2™tœœŸŸ/—Ë;8°îîî|>ï8999yúôé´j÷ Ò|===£££Ž“.\8{ö¬ß®ÀÑ4G&“Áq*•Û”J%°¶X,®¬¬€: /~›¡ñ$®j‰5Záá 3gÎøêí¯\¹R „›7oŠJ{CÛioixÆÕ«WÅŠÅQP ÌF)ÂÌ̌ح´OdÁö–†gHƒíåBœh†R„‘‘GÏ ÇĦÑ"4«±¤™ITÍ"úúú.]ºÇ]Úœ²ßKÚͼX%6{²ÑÙÙ™H$°ž››ûïïÞ,±  ³Ù¬ãdC V«¾ÅR`bbbjjJüŠV æèÁ’öâí ÿÅkŸxåI±°ÏÀݲÃN¨Š·w„ùî»ïJŠã.TîMŠÝÇ===*VpÛu©t{â•ûíÛ·ƒ‰ÝÇÈ1ÒÁÒâ»P¹Ã·â¨¥éü¿ASËïž;t•T}÷÷÷o£’–<‡r‡åÈÐj·t"7—Ëù2Ã| ûWèw„L”nÞŠ ¡í8éÐÝd0Í@t §1[¤›ÉhæðF¡Ph8(kÚñÖdÔšjSzÛ ­kÃÃÃÞ“®Ú^« ¼Ä»œ;wÎrŽU‰ÔoX1HŒÑãF Ôž—,•G'Ä­>´w¬ îidò¾GÝZ]‰·Tí¹Kw,àm7ÑE¹ƒ 7c]–«Ôƒ÷@ZáDBr·Yµ HƒmÍé`UPÍaÕ]T@ÔZC¨:¼/CÀ6©‰~ŸüxJ¹»¬Fpáj î¸víš‹Áªí\œWåE¤—Áª`ÑÑqw¿ÛÔV¾tASKÊ!©ÀOV*•Vl±ˆjbŠÁ=Ù ^¼xÑKçô8œ~…NBÈEÙÕÕ_©¤§j“YDªœ˜M2ªH!ݸKÄNXkµG•DKzÙé2DÊeUùP©±f€’'ýŽ_¯r¨”–tf[aÀU(@VÎÝ"íÖeMª(–——U C¬DRý*>éòxk•ÐÄÐè]ÕØ·Þ•»ÔúZköîÜÅ,r¾}_î“’À…Xøª¡(”¾îáB,w}ƒi€pZÕbWRà Ý%»öe‚—BéΓôyœôÕ(”§V¼ èR&&&h‰nvFÜŸW:pþüù†m¬ÊؤͨG¸].—³Ÿœãp´ öò*Žqñeüöûr—NÄmße ¨t¨j[ß} Ò•šª±T¹×x½óžÑƒí¹K"´hhEh¼Âã`¤¢Ç½Ü4_¬b­yø#öé².õ/VÞsWI‡`†€¥ƒ³¨´¶µµI{hÅ»ÒL3=="¨ºDº„ô»­ìx!öé2XiCù󮤕ԋ{U‹;t8Í3/ÛËû`TÜ÷+D¼@z/éë7/¤°žÑ:¼a{—>¥6ûZÏ{» Ì"ñQ¡‹ ‘‡ßÉføjÝü`Z iŒ]‚àµ-zîY=:::00àqÉ¥Oi¾–5ÍüÙˆc5#u)›Í¢8ŠK×x×¼ªBÞŠ·£¤‚ÉeÝ×k[~Ÿ{¸KO«O±±ß“oË õªöóDíå]},…Éh”ýò Û»—E" DZÕUù“ó{÷ØÂ‚y`lÍŽkkÁníé²Ë‹¹ÒŒ%]oCBMNNªªíSÓ±˜?\yó¯P{»*@*t½øâø ð±p˜U«f¤P|ðk(džSïßOE"WGFNzûÃÌ Ä2‡rëf Û¿ßdÕž=¸qéÆ yë»wÙÏ?›&òf¦¯¯g’É—_¸» ݯ¼b2˜è‹Ÿ¸ jÊW_¹\’BHþüƘNäWUî܉ˆiŠ -ÝòA™p¼#f ¿ÊÝײFRI×׋®&EÌݺõRooúäÉso¾ÙûòËf²À(à°juu#<|hr‹±3¯¾:öÙg û B¬TGûî;“(`} CåŽÙŸ~bøÀÖH„OF§ pk¤Oœ`¿þjC$†;ªÕü§ŸªÚwŸ:eŽ‚f$><õ–øAlyåý÷ãXjáÐ3öÖ{ïå>úÈÙ§ƒÜ@µZúæ¥ÍÏ>ËîÜ1ûd›=ÿùç>Fœ÷Ûo¦Kq9¨€Q//—=Ë+ÎÌœ~çdlÏ©Sq”#ž¨LJÁBÌ=tn}Ï?ß*b¥¼o¿5ãG³! ‡K?þ(m<ûû µÇàyxz÷ïµ·Ï//0@ŠT{ûFj„=ˆ=Ï‹Åéiå(¾ÿ~³@Ã{öä¿øÂÙì™gºÐÕْ̌f?þXd³“6 CfVü¢:kš6ƒ¯”Оߢ¬ð¤™ãÇÍQð¹mfð`iÉeÔ 1W©¼qéRçáÃ㯿Þuô¨É*ÊXˆ"‘¶ÅE/ý!V² ‹X…ñpwA  h‰)e%|(<µÚà /œÿúëÀ.p 2¡Ãà'7¯¤Â)´m0-ÁD"Ea_qµ'iúò6ànî“Oä}¹)—ïÛGb¥ c¬£#ñài3†žÑ>]X˜ÿë/ï£Nbf’¢¢ð‚U¸~½IgÎݽûÒ‡Þ|íµNQCÆ"ù…[x@b%‰³äh|ø¤/üóªýäÌLï‘#zƯÊ:4uäH‘¤½ÄöïŸÇÔÜŠ\ ƣ纭DË@â÷R±E«Ó0âª%QùxJ!·ÿZ“»q£——ç Úpåé§ß0Œ)Ï›oÉŽŽ¡'ÚÂáþ­Â¥A‚‹xÊj®©¥%ö÷ß2Ÿ¦R­Î ŒI€÷öUm4š” 1>×Õ•BWˆXÈm†1¯&V†ˆUO®¦ñápÑÏŸ?$4+)* E±Í‚àŠôáÃEõ”³ÐÛhì¶pÒdhßÄ2!ŽÔA×K¦¦èBu°›È…&ÛÛñíùÅÅ)„Y†X4š>x0ÓÞÞ×Þžà – BË4Ö§¤šÑ?œË“V^]SºŸzŠá[JT\á¸,ë =U"V$DúŽ›Àr²Ž3Ù'mmæ³®Ã6Ôó; #i2PâçwÉc¡ã­j‰XTCªÕÁcÇr6óœþܳgúèÑR<>º²2±°0'ä~òùåcÇ43©[¸iÃpŸ®|+M°#*5š%oܾ}õС¸¥÷YaÜ] "‹åI ÛzCzˆ×›1 ‰G·$<JÙCXŸµE5±Ò (z#჌…  ¨,-mn3àî<·µ•ž{nž!Æ‘ŸpwXEkÒº[ðÉ06œJ•îÝÔ^ ™KBZÛ“T]_/ûX&¥0ǨüÕK.‡ÃƒÇO Nß³‹‹e¤RË¥¨¹++)ÌÏPè‘#hSUjµ"¢Z ë*äª.çnÙ \ÁX¿7V±Äʈ§`S£­ÞòêêÛ++ãp:QGd'·>c ÙF=* ÄJà ´*¶õ†pªìI! u?š¿ó¨i7k+àî^­VøùRð+×^•p8NIJ’ǨÓÑáx–‹´‘@-®÷Fãš]_Ÿ÷& …¥¥Ê¾}q ¿õá÷MÑdãK¹Ó6V™„=ä>öÆB_PîdŒvj6ÃVB¡ÿ­®Îy6Ï7±¤/s<. jcharts-0.7.5/docs/jCharts_license.txt0000644000175000001440000000430607751071404017013 0ustar onkarusers CVS Info: $Id: jCharts_license.txt,v 1.1 2002/07/24 22:25:56 nathaniel_auvil Exp $ jCharts License ---------------------------------------------------------------------------------------- * Copyright 2002 (C) Nathaniel G. Auvil. All Rights Reserved. * * Redistribution and use of this software and associated documentation * ("Software"), with or without modification, are permitted provided * that the following conditions are met: * * 1. Redistributions of source code must retain copyright * statements and notices. Redistributions must also contain a * copy of this document. * * 2. Redistributions in binary form must reproduce the * above copyright notice, this list of conditions and the * following disclaimer in the documentation and/or other * materials provided with the distribution. * * 3. The name "jCharts" or "Nathaniel G. Auvil" must not be used to * endorse or promote products derived from this Software without * prior written permission of Nathaniel G. Auvil. For written * permission, please contact nathaniel_auvil@users.sourceforge.net * * 4. Products derived from this Software may not be called "jCharts" * nor may "jCharts" appear in their names without prior written * permission of Nathaniel G. Auvil. jCharts is a registered * trademark of Nathaniel G. Auvil. * * 5. Due credit should be given to the jCharts Project * (http://jcharts.sourceforge.net/). * * THIS SOFTWARE IS PROVIDED BY Nathaniel G. Auvil AND CONTRIBUTORS * ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT * NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL * jCharts OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED * OF THE POSSIBILITY OF SUCH DAMAGE.jcharts-0.7.5/docs/README.html0000644000175000001440000003160007751071404014772 0ustar onkarusers jCharts - 0.7.5
jCharts
Release 0.7.5

jCharts 0.7.5

Welcome to the 0.7.5 release of jCharts!

Please be aware, there have been significant changes in the Properties model in this Release, and some minor tweaks to the data interfaces. You CAN NOT simply replace the 0.6 jar with the 0.7 jar and have your chart work. Please consult the java docs, examples, test framework, and User Guide for the changes.

Do NOT be alarmed, as the changes will **NOT** require a complete rewrite of your code.

jCharts 0.7.5 **REQUIRES** the JDK 1.4.x for the PNG and JPEG encoders to work, however, legacy support is provided via the JPEGEncoder13 class



jCharts Contents
jCharts0.7.5
+--build
	--build.xml - ant build script
+--demo
	+--servletsApp - the demo servlet source
+--docs
	--jCharts_license.txt - the jCharts License
	--apache_license.txt - the Apache License
	--README.html - this document
+--javadocs - complete javadocs of jCharts packages
+--lib - Apache XML Batik libraries needed for encoding to SVG
+--src - all of the source code
--jCharts-0.7.5.jar - the jCharts compiled code base
--jChartsExampleServlets.war - demo web archive. Put it in your Servlet container's 'webapps' directory

0.7.5
* Line and Point charts no longer start their plots at the y-axis.
* Fixed defect in ScatterPlot image map coordinate generation.

0.7.4
* Fixed Bug: The Y-Axis Title was not centering itself on the y-axis correctly.
* Fixed bug: multi-line chart title not computing its height correctly.

0.7.3
* fixed bug in Scatter Plots where x-axis labels were not being drawn correctly.
* fixed bug where the y-axis grid lines were not using the specified ChartStroke.

0.7.2
* JDK 1.4 dependent code removed from BarChartProperties, ChartDataException and Legend.
* added an Ant target: compile13, which compiles using jdk 1.3. Be aware of the excludes in this task. This helps to keep the JDK 1.4 dependencies isolated to the encoders package and the test packages.
* Percentage display on Numeric Axis now works. Be aware, Java's NumberFormat Object will multiply your value by 100 before displaying it in your locale specific percent.

0.7.1
* Horizontal Plots not starting the ticks at the y-axis, were offset. This was because some code for the next release accidently was inserted into the code base.
* Code accidentally added which caused the above bug, has: Area, Line, and, Point, charts plot start along the y-axis rather than offset, so those plots fill the entire plot area.

0.7.0
* Nothing has changed since Beta 3!

0.7.0 - Beta 3
* Legend icon borders now are drawn; this was commented out by accident in the code
* Pie Charts with a single item are now drawn correctly.

0.7.0 - Beta 2
* Fixed NullPointerException when not displaying labels on Axis Charts.
* Point Charts now show the shape for each data set in the Legend.

0.7.0 - Beta 1
* Added a Validation which will check each Axis Label for NULL and throw a ChartDataException if found.
* Changed default setting for ChartProperties.validate to true. If you want to spare some CPU cycles after development, set this to false to skip the validations.
* Pie Charts now support legend placement on all sides of plot.
* You can now toggle axis scale labels on both axis independently.
* The x-axis label overlap was not being calculated correctly so labels could overlap. This has been fixed.
* In order to break the runtime dependency on j2ee.jar, all references to HttpServletResponse have been removed from the encoders. The shortcut methods for outputting from a Servlet or JSP are now located in the org.jCharts.encoders.ServletEncoderHelper Class.

0.7.0 - Alpha 2
* Fixed bug in alpha 1: NullPointer when trying to render an AxisChart without a legend
* Fixed bug in alpha 1: XAxis was rendering a grid line over the y-axis on a horizontal plot, so axis was always gray.
* Copied the SwingTest.java from the test code to the demo package and named it SwingDemo.java
* Bar and Clustered Bar, both vertical and horiztonal, allow value labels to be placed on them. Run the examples web app and look at the Bar Chart to see this. The source is in the demo package.

0.7.0 - Alpha 1
* Added a Validation framework to assist developers in tracking down data problems. The Chart Properties Object now contains a method setValidate( boolean ) which allows developers to toggle the validations for speed. The IDataSeries interface has a new method: public void validate() throws PropertyException
* Removed all 'transient' data members and made everything Serializable.
* The encode( Chart chart, HttpServletResponse httpServletResponse ) method has been renamed to encodeServlet
* A framework has been introduce which allows for custom scale increment code to be included in Axis Charts. Simply extend the org.jCharts.axisCharts.scale.AutomaticScaleCalculator Class and override the computeIncrement( int ) method.
* Bug fix: x-axis labels will no longer go off the right edge of the chart image.
* Horizontal Bar, Stacked Bar, and Clustered Bars have been added.
* Scatter Plot Charts have been added.
* Servlet demos have been updated to be easier for non-java programers to understand as many have requested this. So inheritance has been avoided and the code is self contained so you can just change values and use them as they are.

Known Issues
Apache XML Batik, which jCharts uses to output SVG formatted charts, does not display vertical axis labels. This has been reported to them as of 6-23-2002 and hopefully a solution will be found soon; horizontal axis labels work in SVG. I tried 1.1.1 and 1.5 beta 3.


Having Problems?
Bugs

Links
User's Mail List
jCharts Project Page
Feature Requests

Bundled Software
This product includes software developed by the Apache Software Foundation (http://www.apache.org/), namely the Apache XML Batik Project

jCharts uses the Ant build system developed by the Apache Software Foundation (http://ant.apache.org)




jcharts-0.7.5/javadocs/0000755000175000001440000000000007751071404014011 5ustar onkarusersjcharts-0.7.5/javadocs/org/0000755000175000001440000000000007751071402014576 5ustar onkarusersjcharts-0.7.5/javadocs/org/jCharts/0000755000175000001440000000000007751071404016176 5ustar onkarusersjcharts-0.7.5/javadocs/org/jCharts/axisChart/0000755000175000001440000000000007751071404020124 5ustar onkarusersjcharts-0.7.5/javadocs/org/jCharts/axisChart/axis/0000755000175000001440000000000007751071404021070 5ustar onkarusersjcharts-0.7.5/javadocs/org/jCharts/axisChart/axis/scale/0000755000175000001440000000000007751071404022157 5ustar onkarusersjcharts-0.7.5/javadocs/org/jCharts/axisChart/axis/scale/AutomaticScaleCalculator.html0000644000175000001440000003124707751071400027760 0ustar onkarusers AutomaticScaleCalculator (jCharts-0.7.5 API)

org.jCharts.axisChart.axis.scale
Class AutomaticScaleCalculator

java.lang.Object
  |
  +--org.jCharts.axisChart.axis.scale.ScaleCalculator
        |
        +--org.jCharts.axisChart.axis.scale.AutomaticScaleCalculator

public class AutomaticScaleCalculator
extends ScaleCalculator


Field Summary
 
Fields inherited from class org.jCharts.axisChart.axis.scale.ScaleCalculator
increment
 
Constructor Summary
AutomaticScaleCalculator()
           
 
Method Summary
 void computeIncrement()
          Computes the axis increment taking into account the user specified criteria.
 
Methods inherited from class org.jCharts.axisChart.axis.scale.ScaleCalculator
computeScaleValues, getIncrement, getMaxValue, getMinValue, getNumberOfScaleItems, getRoundingPowerOfTen, round, roundTheIncrement, setMaxValue, setMinValue, setNumberOfScaleItems, setRoundingPowerOfTen, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AutomaticScaleCalculator

public AutomaticScaleCalculator()
Method Detail

computeIncrement

public void computeIncrement()
Computes the axis increment taking into account the user specified criteria.

Specified by:
computeIncrement in class ScaleCalculator


jcharts-0.7.5/javadocs/org/jCharts/axisChart/axis/scale/ChartScale.html0000644000175000001440000005500507751071400025057 0ustar onkarusers ChartScale (jCharts-0.7.5 API)

org.jCharts.axisChart.axis.scale
Class ChartScale

java.lang.Object
  |
  +--org.jCharts.axisChart.axis.scale.ChartScale

public class ChartScale
extends java.lang.Object


Field Summary
(package private)  int rounding
          * The suggested value for the rounding of the data.
(package private)  int segments
          * The number of segments that the suggested yStart, yEnd and yDelta produce.
(package private)  double yDelta
          * The difference between two points on adjacent grid lines.
(package private)  double yEnd
          * The value which the last grid line represents.
(package private)  double yMax
          * The largest number in the dataset.
(package private)  double yMin
          * The smallest number in the dataset.
(package private)  double yStart
          * The value which the first grid line represents.
 
Constructor Summary
ChartScale()
           
ChartScale(double[][] data)
          Constructor.
 
Method Summary
private  void calculate()
          Compute yDelta, yStart, yEnd, segments and rounding.
 AxisProperties getAxisProperties()
          * Creates and returns a new AxisProperties object based on the internally calculated values of yStart, yDelta, * segments and rounding.
private  double getMax(double[][] data)
          Helper method that finds the largest double in the 2D array of doubles.
private  double getMin(double[][] data)
          Helper method that finds the smallest double in the 2D array of doubles.
 int getRounding()
          * Accessor for the rounding property.
 int getSegments()
          * Accessor for the segments property.
 double getYDelta()
          * Accessor for the yDelta property.
 double getYEnd()
          * Accessor for the yEnd property.
 double getYMax()
          * Accessor for the yMax property.
 double getYMin()
          * Accessor for the yMin property.
 double getYStart()
          * Accessor for the yStart property.
static void main(java.lang.String[] args)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

yMax

double yMax
* The largest number in the dataset.


yMin

double yMin
* The smallest number in the dataset.


yDelta

double yDelta
* The difference between two points on adjacent grid lines.


yStart

double yStart
* The value which the first grid line represents.


yEnd

double yEnd
* The value which the last grid line represents.


rounding

int rounding
* The suggested value for the rounding of the data.


segments

int segments
* The number of segments that the suggested yStart, yEnd and yDelta produce.

Constructor Detail

ChartScale

public ChartScale()

ChartScale

public ChartScale(double[][] data)
Constructor. Creates a ChartScale object and initializes all of its properties as appropriate for the given * data's minimum and maximum values. * * @param data double[] the data for which you would like suggested graph values

Method Detail

main

public static void main(java.lang.String[] args)

calculate

private void calculate()
Compute yDelta, yStart, yEnd, segments and rounding.


getMax

private double getMax(double[][] data)
Helper method that finds the largest double in the 2D array of doubles. * * @param data double[][] to look into for the max * @return double the largest value found


getMin

private double getMin(double[][] data)
Helper method that finds the smallest double in the 2D array of doubles. * * @param data double[][] to look into for the min * @return double the smallest value found


getYMax

public double getYMax()
* Accessor for the yMax property. This property represents the largest value in the dataset. * * @return double largest value in the associated dataset


getYMin

public double getYMin()
* Accessor for the yMin property. This property represents the smallest value in the dataset. * * @return double smallest value in the associated dataset


getYDelta

public double getYDelta()
* Accessor for the yDelta property. The difference between any two points on adjacent grid lines. * * @return double grid line spacing


getYStart

public double getYStart()
* Accessor for the yStart property. The value which the first grid line represents. * * @return double y axis value for the bottom horizontal grid line.


getYEnd

public double getYEnd()
* Accessor for the yEnd property. The value which the last grid line represents. * * @return double y axis value for the top horizontal grid line.


getRounding

public int getRounding()
* Accessor for the rounding property. The suggested value for the rounding of the data. * * @return double rounding value suggestion.


getSegments

public int getSegments()
* Accessor for the segments property. The number of segments that the suggested yStart, yEnd and yDelta produce. * * @return double segments in the graph as suggested.


getAxisProperties

public AxisProperties getAxisProperties()
                                 throws PropertyException
* Creates and returns a new AxisProperties object based on the internally calculated values of yStart, yDelta, * segments and rounding. * * @return AxisProperties with yStart, yDelta, segments and rounding set.

PropertyException


jcharts-0.7.5/javadocs/org/jCharts/axisChart/axis/scale/package-frame.html0000644000175000001440000000247007751071376025543 0ustar onkarusers org.jCharts.axisChart.axis.scale (jCharts-0.7.5 API) org.jCharts.axisChart.axis.scale
Classes 
AutomaticScaleCalculator
ChartScale
ScaleCalculator
UserDefinedScaleCalculator
jcharts-0.7.5/javadocs/org/jCharts/axisChart/axis/scale/package-summary.html0000644000175000001440000001406607751071376026152 0ustar onkarusers org.jCharts.axisChart.axis.scale (jCharts-0.7.5 API)

Package org.jCharts.axisChart.axis.scale

Class Summary
AutomaticScaleCalculator  
ChartScale  
ScaleCalculator Base class for the logic used to compute the scale on the charts.
UserDefinedScaleCalculator  
 



jcharts-0.7.5/javadocs/org/jCharts/axisChart/axis/scale/package-tree.html0000644000175000001440000001401007751071376025401 0ustar onkarusers org.jCharts.axisChart.axis.scale Class Hierarchy (jCharts-0.7.5 API)

Hierarchy For Package org.jCharts.axisChart.axis.scale

Package Hierarchies:
All Packages

Class Hierarchy



jcharts-0.7.5/javadocs/org/jCharts/axisChart/axis/scale/ScaleCalculator.html0000644000175000001440000005237007751071400026111 0ustar onkarusers ScaleCalculator (jCharts-0.7.5 API)

org.jCharts.axisChart.axis.scale
Class ScaleCalculator

java.lang.Object
  |
  +--org.jCharts.axisChart.axis.scale.ScaleCalculator
Direct Known Subclasses:
AutomaticScaleCalculator, UserDefinedScaleCalculator

public abstract class ScaleCalculator
extends java.lang.Object

Base class for the logic used to compute the scale on the charts. There are two implementations provided and you are free to implement your own if you do not like the default implementations provided.


Field Summary
protected  double increment
           
private  double maxValue
           
private  double minValue
           
private  int numberOfScaleItems
           
private  int roundingPowerOfTen
           
 
Constructor Summary
ScaleCalculator()
           
 
Method Summary
protected abstract  void computeIncrement()
          Computes the scale increment.
 void computeScaleValues()
          Drives the computation of the axis increment and related values taking into account the user specified rounding criteria.
 double getIncrement()
           
 double getMaxValue()
           
 double getMinValue()
           
 int getNumberOfScaleItems()
           
 int getRoundingPowerOfTen()
           
protected  double round(double value, double powerOfTen)
          Rounds the passed value by the power of ten specified
protected  void roundTheIncrement(double powerOfTen)
          Rounds the scale increment up by the power of ten specified in the properties.
 void setMaxValue(double maxValue)
           
 void setMinValue(double minValue)
           
 void setNumberOfScaleItems(int numberOfScaleItems)
           
 void setRoundingPowerOfTen(int powerOfTen)
          Sets the exponent power of ten to round values to.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

minValue

private double minValue

maxValue

private double maxValue

roundingPowerOfTen

private int roundingPowerOfTen

numberOfScaleItems

private int numberOfScaleItems

increment

protected double increment
Constructor Detail

ScaleCalculator

public ScaleCalculator()
Method Detail

computeIncrement

protected abstract void computeIncrement()
Computes the scale increment.


computeScaleValues

public final void computeScaleValues()
Drives the computation of the axis increment and related values taking into account the user specified rounding criteria. So if you specify to round to the nearest 100 and give an increment of 2.5, the increment will become 100.


setMinValue

public final void setMinValue(double minValue)

getMinValue

public final double getMinValue()

setMaxValue

public final void setMaxValue(double maxValue)

getMaxValue

public final double getMaxValue()

getIncrement

public final double getIncrement()

getNumberOfScaleItems

public int getNumberOfScaleItems()

setNumberOfScaleItems

public void setNumberOfScaleItems(int numberOfScaleItems)

setRoundingPowerOfTen

public final void setRoundingPowerOfTen(int powerOfTen)
Sets the exponent power of ten to round values to.

Parameters:
powerOfTen - exponent of ten to round to: 1=10, 2=100, -2=.01

getRoundingPowerOfTen

public final int getRoundingPowerOfTen()

round

protected double round(double value,
                       double powerOfTen)
Rounds the passed value by the power of ten specified

Parameters:
value - the value to round
powerOfTen - the product of 10 times the rounding property.
Returns:
double the rounded result

roundTheIncrement

protected void roundTheIncrement(double powerOfTen)
Rounds the scale increment up by the power of ten specified in the properties.

Parameters:
powerOfTen - the value of 10 times the rounding property.

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object
Returns:


jcharts-0.7.5/javadocs/org/jCharts/axisChart/axis/scale/UserDefinedScaleCalculator.html0000644000175000001440000003606607751071400030233 0ustar onkarusers UserDefinedScaleCalculator (jCharts-0.7.5 API)

org.jCharts.axisChart.axis.scale
Class UserDefinedScaleCalculator

java.lang.Object
  |
  +--org.jCharts.axisChart.axis.scale.ScaleCalculator
        |
        +--org.jCharts.axisChart.axis.scale.UserDefinedScaleCalculator

public class UserDefinedScaleCalculator
extends ScaleCalculator


Field Summary
private  double userDefinedIncrement
           
private  double userDefinedMinimum
           
 
Fields inherited from class org.jCharts.axisChart.axis.scale.ScaleCalculator
increment
 
Constructor Summary
UserDefinedScaleCalculator(double userDefinedMinimum, double userDefinedIncrement)
          It would seem to make sense to pass in the min and the max, but we want to allow people to use custom implementations which will be created when the AxisChart constructor gets called and we will not have looped the data to find the min and max yet.
 
Method Summary
protected  void computeIncrement()
          Computes the axis increment WITHOUT taking into account the user specified rounding criteria and sets it to the super class increment variable.
 
Methods inherited from class org.jCharts.axisChart.axis.scale.ScaleCalculator
computeScaleValues, getIncrement, getMaxValue, getMinValue, getNumberOfScaleItems, getRoundingPowerOfTen, round, roundTheIncrement, setMaxValue, setMinValue, setNumberOfScaleItems, setRoundingPowerOfTen, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

userDefinedMinimum

private double userDefinedMinimum

userDefinedIncrement

private double userDefinedIncrement
Constructor Detail

UserDefinedScaleCalculator

public UserDefinedScaleCalculator(double userDefinedMinimum,
                                  double userDefinedIncrement)
It would seem to make sense to pass in the min and the max, but we want to allow people to use custom implementations which will be created when the AxisChart constructor gets called and we will not have looped the data to find the min and max yet. No sense in making people do that when we will do that already.

Parameters:
userDefinedMinimum -
userDefinedIncrement -
Method Detail

computeIncrement

protected void computeIncrement()
Computes the axis increment WITHOUT taking into account the user specified rounding criteria and sets it to the super class increment variable. You can extend this class and override this method to compute you own scale.

Specified by:
computeIncrement in class ScaleCalculator


jcharts-0.7.5/javadocs/org/jCharts/axisChart/axis/Axis.html0000644000175000001440000011236707751071400022670 0ustar onkarusers Axis (jCharts-0.7.5 API)

org.jCharts.axisChart.axis
Class Axis

java.lang.Object
  |
  +--org.jCharts.axisChart.axis.Axis
All Implemented Interfaces:
HTMLTestable, java.io.Serializable
Direct Known Subclasses:
DataAxis, LabelAxis, XAxis, YAxis

public abstract class Axis
extends java.lang.Object
implements HTMLTestable, java.io.Serializable

See Also:
Serialized Form

Field Summary
private  AxisChart axisChart
           
private  TextTagGroup axisLabelsGroup
           
private  float minimumHeightNeeded
           
private  float minimumWidthNeeded
           
private  int numberOfScaleItems
           
private  double oneUnitPixelSize
           
private  float origin
           
private  float pixelLength
           
private  ScaleCalculator scaleCalculator
           
private  float scalePixelWidth
           
private  float tickStart
           
private  float titleHeight
           
private  float titleWidth
           
private  float zeroLineCoordinate
           
 
Constructor Summary
Axis(AxisChart axisChart, int numberOfScaleItems)
          Constructor
 
Method Summary
 void computeAxisTitleDimensions(java.lang.String title, ChartFont axisTitleFont)
           
 void computeOneUnitPixelSize(float scalePixelLength, double increment)
          Computes the relationship of data point values to pixel values so know where along the axis a value is.
 void computeScalePixelWidth()
          Computes the number of pixels between each value on the axis.
 void computeScalePixelWidthDataAxis()
          Computes the number of pixels between each value on the axis.
 AxisChart getAxisChart()
          Returns reference to AxisChart Object.
 TextTagGroup getAxisLabelsGroup()
           
 float getMinimumHeightNeeded()
           
 float getMinimumWidthNeeded()
           
 int getNumberOfScaleItems()
           
 double getOneUnitPixelSize()
          Returns the number of pixels one value unit occupies.
 float getOrigin()
           
 float getPixelLength()
           
 ScaleCalculator getScaleCalculator()
           
 float getScalePixelWidth()
           
 float getTickStart()
           
 float getTitleHeight()
           
 float getTitleWidth()
           
 float getZeroLineCoordinate()
          Returns the screen coordinate of the zero line.
 void setAxisLabelsGroup(TextTagGroup axisLabelsGroup)
           
 void setMinimumHeightNeeded(float minimumHeightNeeded)
           
 void setMinimumWidthNeeded(float minimumWidthNeeded)
           
 void setOneUnitPixelSize(double oneUnitPixelSize)
           
 void setOrigin(float origin)
           
 void setPixelLength(float pixelLength)
           
 void setScaleCalculator(ScaleCalculator scaleCalculator)
           
 void setScalePixelWidth(float scalePixelWidth)
           
 void setTickStart(float tickStart)
           
 void setZeroLineCoordinate(float value)
          Sets the screen coordinate of the zero line.
 void toHTML(HTMLGenerator htmlGenerator)
          Enables the testing routines to display the contents of this Object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

axisChart

private AxisChart axisChart

scalePixelWidth

private float scalePixelWidth

pixelLength

private float pixelLength

origin

private float origin

titleHeight

private float titleHeight

titleWidth

private float titleWidth

minimumWidthNeeded

private float minimumWidthNeeded

minimumHeightNeeded

private float minimumHeightNeeded

axisLabelsGroup

private TextTagGroup axisLabelsGroup

numberOfScaleItems

private int numberOfScaleItems

tickStart

private float tickStart

oneUnitPixelSize

private double oneUnitPixelSize

zeroLineCoordinate

private float zeroLineCoordinate

scaleCalculator

private ScaleCalculator scaleCalculator
Constructor Detail

Axis

public Axis(AxisChart axisChart,
            int numberOfScaleItems)
Constructor

Parameters:
axisChart -
numberOfScaleItems -
Method Detail

getAxisChart

public final AxisChart getAxisChart()
Returns reference to AxisChart Object.

Returns:
axisChart

getNumberOfScaleItems

public int getNumberOfScaleItems()

getAxisLabelsGroup

public TextTagGroup getAxisLabelsGroup()

setAxisLabelsGroup

public void setAxisLabelsGroup(TextTagGroup axisLabelsGroup)

getTitleWidth

public final float getTitleWidth()

getTitleHeight

public final float getTitleHeight()

getPixelLength

public final float getPixelLength()

setPixelLength

public final void setPixelLength(float pixelLength)

getOrigin

public final float getOrigin()

setOrigin

public final void setOrigin(float origin)

getMinimumWidthNeeded

public final float getMinimumWidthNeeded()

setMinimumWidthNeeded

public final void setMinimumWidthNeeded(float minimumWidthNeeded)

getMinimumHeightNeeded

public final float getMinimumHeightNeeded()

setMinimumHeightNeeded

public final void setMinimumHeightNeeded(float minimumHeightNeeded)

getScalePixelWidth

public final float getScalePixelWidth()

setScalePixelWidth

public final void setScalePixelWidth(float scalePixelWidth)

getTickStart

public float getTickStart()

setTickStart

public void setTickStart(float tickStart)

getScaleCalculator

public ScaleCalculator getScaleCalculator()

setScaleCalculator

public void setScaleCalculator(ScaleCalculator scaleCalculator)

computeAxisTitleDimensions

public final void computeAxisTitleDimensions(java.lang.String title,
                                             ChartFont axisTitleFont)
Parameters:
title -
axisTitleFont -

toHTML

public void toHTML(HTMLGenerator htmlGenerator)
Enables the testing routines to display the contents of this Object. Can only see 'private' fields from this class.

Specified by:
toHTML in interface HTMLTestable
Parameters:
htmlGenerator -

computeScalePixelWidth

public void computeScalePixelWidth()
Computes the number of pixels between each value on the axis.


computeScalePixelWidthDataAxis

public void computeScalePixelWidthDataAxis()
Computes the number of pixels between each value on the axis.


setOneUnitPixelSize

public void setOneUnitPixelSize(double oneUnitPixelSize)

getOneUnitPixelSize

public double getOneUnitPixelSize()
Returns the number of pixels one value unit occupies.

Returns:
double the number of pixels one value unit occupies.

getZeroLineCoordinate

public float getZeroLineCoordinate()
Returns the screen coordinate of the zero line. This will not always be the same as the origin as not all charts start at zero. This is needed not only by the Axis, but some of the Chart implementations as well.

Returns:
float the screen pixel location of the zero line.

setZeroLineCoordinate

public void setZeroLineCoordinate(float value)
Sets the screen coordinate of the zero line. This will not always be the same as the origin as not all charts start at zero.

Parameters:
value - the screen pixel location of the zero line.

computeOneUnitPixelSize

public void computeOneUnitPixelSize(float scalePixelLength,
                                    double increment)
Computes the relationship of data point values to pixel values so know where along the axis a value is.

Parameters:
scalePixelLength -
increment -


jcharts-0.7.5/javadocs/org/jCharts/axisChart/axis/DataAxis.html0000644000175000001440000006775507751071400023474 0ustar onkarusers DataAxis (jCharts-0.7.5 API)

org.jCharts.axisChart.axis
Class DataAxis

java.lang.Object
  |
  +--org.jCharts.axisChart.axis.Axis
        |
        +--org.jCharts.axisChart.axis.DataAxis
All Implemented Interfaces:
HTMLTestable, java.io.Serializable

Deprecated. just using the YAxis Object

public class DataAxis
extends Axis
implements HTMLTestable

See Also:
Serialized Form

Field Summary
private  double increment
          Deprecated.  
private  double maxValue
          Deprecated.  
private  double minValue
          Deprecated.  
protected  float zeroLineCoordinate
          Deprecated.  
 
Fields inherited from class org.jCharts.axisChart.axis.Axis
 
Constructor Summary
DataAxis(AxisChart axisChart)
          Deprecated. this class is no longer used
 
Method Summary
 void addTextTags()
          Deprecated. Add all text labels to be display on this axis.
protected  boolean amDataAxis()
          Deprecated.  
protected  boolean amLabelAxis()
          Deprecated.  
(package private)  float computeAxisCoordinate(double value)
          Deprecated. Takes a value and determines the screen coordinate it should be drawn at.
(package private)  void computeScaleIncrement(AxisChartDataProcessor axisChartDataProcessor)
          Deprecated. Calculates the axis scale increment.
 double getMaxValue()
          Deprecated. Returns the MAX value plotted by the axis.
 double getMinValue()
          Deprecated. Returns the MIN value plotted by the axis.
 double getOneUnitPixelSize()
          Deprecated. Returns the number of pixels one value unit occupies.
 float getZeroLineCoordinate()
          Deprecated. Returns the screen coordinate of the zero line.
protected  void render(java.awt.Graphics2D graphics2D, IDataSeries iDataSeries)
          Deprecated. Renders the DataAxis on the passes Graphics2D object
private  double round(double value, double powerOfTen)
          Deprecated. Rounds the scale increment up by the power of ten specified in the properties.
private  void roundTheIncrement(double powerOfTen)
          Deprecated. Rounds the scale increment up by the power of ten specified in the properties.
 void toHTML(HTMLGenerator htmlGenerator)
          Deprecated. Enables the testing routines to display the contents of this Object.
 
Methods inherited from class org.jCharts.axisChart.axis.Axis
computeAxisTitleDimensions, computeOneUnitPixelSize, computeScalePixelWidth, computeScalePixelWidthDataAxis, getAxisChart, getAxisLabelsGroup, getMinimumHeightNeeded, getMinimumWidthNeeded, getNumberOfScaleItems, getOrigin, getPixelLength, getScaleCalculator, getScalePixelWidth, getTickStart, getTitleHeight, getTitleWidth, setAxisLabelsGroup, setMinimumHeightNeeded, setMinimumWidthNeeded, setOneUnitPixelSize, setOrigin, setPixelLength, setScaleCalculator, setScalePixelWidth, setTickStart, setZeroLineCoordinate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

minValue

private double minValue
Deprecated. 

maxValue

private double maxValue
Deprecated. 

increment

private double increment
Deprecated. 

zeroLineCoordinate

protected float zeroLineCoordinate
Deprecated. 
Constructor Detail

DataAxis

public DataAxis(AxisChart axisChart)
Deprecated. this class is no longer used

Parameters:
axisChart -
Method Detail

amDataAxis

protected boolean amDataAxis()
Deprecated. 

amLabelAxis

protected boolean amLabelAxis()
Deprecated. 

addTextTags

public void addTextTags()
Deprecated. 
Add all text labels to be display on this axis.


computeScaleIncrement

void computeScaleIncrement(AxisChartDataProcessor axisChartDataProcessor)
Deprecated. 
Calculates the axis scale increment. If the user does not specify a scale, it is auto computed in the followin way:
  • if all values are positive, the MIN value will be zero.
  • if all values are negative, the MAX value will be zero.
  • Padding is done by either adding or subtracting the increment by the rounding power of ten specified in the properties.
  • Parameters:
    axisChartDataProcessor - need to get the min/max

    round

    private double round(double value,
                         double powerOfTen)
    Deprecated. 
    Rounds the scale increment up by the power of ten specified in the properties.

    Parameters:
    value - the value to round
    powerOfTen - the product of 10 times the rounding property.
    Returns:
    double the rounded result

    roundTheIncrement

    private void roundTheIncrement(double powerOfTen)
    Deprecated. 
    Rounds the scale increment up by the power of ten specified in the properties.

    Parameters:
    powerOfTen - the value of 10 times the rounding property.

    getZeroLineCoordinate

    public float getZeroLineCoordinate()
    Deprecated. 
    Returns the screen coordinate of the zero line. This will not always be the same as the origin as not all charts start at zero.

    Overrides:
    getZeroLineCoordinate in class Axis
    Returns:
    float the screen pixel location of the zero line.

    computeAxisCoordinate

    float computeAxisCoordinate(double value)
    Deprecated. 
    Takes a value and determines the screen coordinate it should be drawn at.

    Parameters:
    value -
    Returns:
    float the screen pixel coordinate

    getMaxValue

    public double getMaxValue()
    Deprecated. 
    Returns the MAX value plotted by the axis.

    Returns:
    double the MAX value plotted by the axis

    getMinValue

    public double getMinValue()
    Deprecated. 
    Returns the MIN value plotted by the axis.

    Returns:
    double the MIN value plotted by the axis

    getOneUnitPixelSize

    public double getOneUnitPixelSize()
    Deprecated. 
    Returns the number of pixels one value unit occupies.

    Overrides:
    getOneUnitPixelSize in class Axis
    Returns:
    double the number of pixels one value unit occupies.

    render

    protected void render(java.awt.Graphics2D graphics2D,
                          IDataSeries iDataSeries)
    Deprecated. 
    Renders the DataAxis on the passes Graphics2D object

    Parameters:
    graphics2D -
    iDataSeries -

    toHTML

    public void toHTML(HTMLGenerator htmlGenerator)
    Deprecated. 
    Enables the testing routines to display the contents of this Object.

    Specified by:
    toHTML in interface HTMLTestable
    Overrides:
    toHTML in class Axis
    Parameters:
    htmlGenerator -


    jcharts-0.7.5/javadocs/org/jCharts/axisChart/axis/LabelAxis.html0000644000175000001440000004372207751071400023626 0ustar onkarusers LabelAxis (jCharts-0.7.5 API)

    org.jCharts.axisChart.axis
    Class LabelAxis

    java.lang.Object
      |
      +--org.jCharts.axisChart.axis.Axis
            |
            +--org.jCharts.axisChart.axis.LabelAxis
    
    All Implemented Interfaces:
    HTMLTestable, java.io.Serializable

    Deprecated. just using the Axis Object

    public class LabelAxis
    extends Axis
    implements HTMLTestable

    See Also:
    Serialized Form

    Field Summary
     
    Fields inherited from class org.jCharts.axisChart.axis.Axis
     
    Constructor Summary
    LabelAxis(AxisChart axisChart)
              Deprecated. this class is no longer used
     
    Method Summary
    protected  void addTextTags()
              Deprecated. Add the scale labels.
    protected  boolean amDataAxis()
              Deprecated.  
    protected  boolean amLabelAxis()
              Deprecated.  
    protected  void render(java.awt.Graphics2D graphics2D, IDataSeries iDataSeries)
              Deprecated. Renders the axis on the passed Graphics2D object
     void toHTML(HTMLGenerator htmlGenerator)
              Deprecated. Enables the testing routines to display the contents of this Object.
     
    Methods inherited from class org.jCharts.axisChart.axis.Axis
    computeAxisTitleDimensions, computeOneUnitPixelSize, computeScalePixelWidth, computeScalePixelWidthDataAxis, getAxisChart, getAxisLabelsGroup, getMinimumHeightNeeded, getMinimumWidthNeeded, getNumberOfScaleItems, getOneUnitPixelSize, getOrigin, getPixelLength, getScaleCalculator, getScalePixelWidth, getTickStart, getTitleHeight, getTitleWidth, getZeroLineCoordinate, setAxisLabelsGroup, setMinimumHeightNeeded, setMinimumWidthNeeded, setOneUnitPixelSize, setOrigin, setPixelLength, setScaleCalculator, setScalePixelWidth, setTickStart, setZeroLineCoordinate
     
    Methods inherited from class java.lang.Object
    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
     

    Constructor Detail

    LabelAxis

    public LabelAxis(AxisChart axisChart)
    Deprecated. this class is no longer used

    Parameters:
    axisChart -
    Method Detail

    amDataAxis

    protected boolean amDataAxis()
    Deprecated. 

    amLabelAxis

    protected boolean amLabelAxis()
    Deprecated. 

    addTextTags

    protected void addTextTags()
    Deprecated. 
    Add the scale labels.


    render

    protected void render(java.awt.Graphics2D graphics2D,
                          IDataSeries iDataSeries)
    Deprecated. 
    Renders the axis on the passed Graphics2D object

    Parameters:
    graphics2D -
    iDataSeries -

    toHTML

    public void toHTML(HTMLGenerator htmlGenerator)
    Deprecated. 
    Enables the testing routines to display the contents of this Object.

    Specified by:
    toHTML in interface HTMLTestable
    Overrides:
    toHTML in class Axis
    Parameters:
    htmlGenerator -


    jcharts-0.7.5/javadocs/org/jCharts/axisChart/axis/package-frame.html0000644000175000001440000000235407751071376024455 0ustar onkarusers org.jCharts.axisChart.axis (jCharts-0.7.5 API) org.jCharts.axisChart.axis
    Classes 
    Axis
    DataAxis
    LabelAxis
    XAxis
    YAxis
    jcharts-0.7.5/javadocs/org/jCharts/axisChart/axis/package-summary.html0000644000175000001440000001400707751071376025056 0ustar onkarusers org.jCharts.axisChart.axis (jCharts-0.7.5 API)

    Package org.jCharts.axisChart.axis

    Class Summary
    Axis  
    DataAxis Deprecated. just using the YAxis Object
    LabelAxis Deprecated. just using the Axis Object
    XAxis  
    YAxis  
     



    jcharts-0.7.5/javadocs/org/jCharts/axisChart/axis/package-tree.html0000644000175000001440000001463307751071376024325 0ustar onkarusers org.jCharts.axisChart.axis Class Hierarchy (jCharts-0.7.5 API)

    Hierarchy For Package org.jCharts.axisChart.axis

    Package Hierarchies:
    All Packages

    Class Hierarchy



    jcharts-0.7.5/javadocs/org/jCharts/axisChart/axis/XAxis.html0000644000175000001440000006163207751071400023016 0ustar onkarusers XAxis (jCharts-0.7.5 API)

    org.jCharts.axisChart.axis
    Class XAxis

    java.lang.Object
      |
      +--org.jCharts.axisChart.axis.Axis
            |
            +--org.jCharts.axisChart.axis.XAxis
    
    All Implemented Interfaces:
    HTMLTestable, java.io.Serializable

    public final class XAxis
    extends Axis
    implements HTMLTestable

    See Also:
    Serialized Form

    Field Summary
    private  boolean startTicksAtAxis
               
    private  int xLabelFilter
               
     
    Fields inherited from class org.jCharts.axisChart.axis.Axis
     
    Constructor Summary
    XAxis(AxisChart axisChart, int numberOfScaleItems)
               
     
    Method Summary
     float computeAxisCoordinate(float origin, double value, double axisMinValue)
              Takes a value and determines the screen coordinate it should be drawn at.
     void computeLabelFilter()
              Method to compute the filter to use on the x-axis label display so labels do not overlap
     void computeMinimumHeightNeeded(java.lang.String axisTitle)
              Computes the minimum pixel height required for the X-Axis.
     void computeScalePixelWidth()
              Computes the number of pixels between each value on the axis.
     void computeShouldTickStartAtYAxis(IAxisDataSeries iAxisDataSeries, AxisTypeProperties axisTypeProperties)
              Determines if we should start x-axis ticks at the y-axis or space it out a half a scale item width.
     void computeTickStart()
              Computes the screen pixel location of the first tick mark
     void render(java.awt.Graphics2D graphics2D, AxisProperties axisProperties, java.lang.String axisTitle)
              Renders the YAxis on the passes Graphics2D object
    private  void renderAxisTitle(java.lang.String axisTitle, java.awt.Graphics2D graphics2D, AxisTypeProperties axisTypeProperties)
              Computes the number of pixels between each value on the axis.
     void toHTML(HTMLGenerator htmlGenerator)
              Enables the testing routines to display the contents of this Object.
     
    Methods inherited from class org.jCharts.axisChart.axis.Axis
    computeAxisTitleDimensions, computeOneUnitPixelSize, computeScalePixelWidthDataAxis, getAxisChart, getAxisLabelsGroup, getMinimumHeightNeeded, getMinimumWidthNeeded, getNumberOfScaleItems, getOneUnitPixelSize, getOrigin, getPixelLength, getScaleCalculator, getScalePixelWidth, getTickStart, getTitleHeight, getTitleWidth, getZeroLineCoordinate, setAxisLabelsGroup, setMinimumHeightNeeded, setMinimumWidthNeeded, setOneUnitPixelSize, setOrigin, setPixelLength, setScaleCalculator, setScalePixelWidth, setTickStart, setZeroLineCoordinate
     
    Methods inherited from class java.lang.Object
    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
     

    Field Detail

    xLabelFilter

    private int xLabelFilter

    startTicksAtAxis

    private boolean startTicksAtAxis
    Constructor Detail

    XAxis

    public XAxis(AxisChart axisChart,
                 int numberOfScaleItems)
    Parameters:
    axisChart -
    numberOfScaleItems -
    Method Detail

    computeMinimumHeightNeeded

    public void computeMinimumHeightNeeded(java.lang.String axisTitle)
    Computes the minimum pixel height required for the X-Axis. Includes space, if needed, for: axis title + padding, axis values + tick padding, and tick marks.

    Parameters:
    axisTitle -

    renderAxisTitle

    private void renderAxisTitle(java.lang.String axisTitle,
                                 java.awt.Graphics2D graphics2D,
                                 AxisTypeProperties axisTypeProperties)
    Computes the number of pixels between each value on the axis. public void computeScalePixelWidth( int numberOfValuesOnXAxis ) { super.setScalePixelWidth( super.getPixelLength() / numberOfValuesOnXAxis ); } /****************************************************************************************************

    Parameters:
    axisTitle -
    graphics2D -
    axisTypeProperties -

    computeShouldTickStartAtYAxis

    public void computeShouldTickStartAtYAxis(IAxisDataSeries iAxisDataSeries,
                                              AxisTypeProperties axisTypeProperties)
    Determines if we should start x-axis ticks at the y-axis or space it out a half a scale item width.

    Parameters:
    iAxisDataSeries -
    axisTypeProperties -

    computeTickStart

    public void computeTickStart()
    Computes the screen pixel location of the first tick mark


    computeScalePixelWidth

    public void computeScalePixelWidth()
    Computes the number of pixels between each value on the axis.

    Overrides:
    computeScalePixelWidth in class Axis

    render

    public void render(java.awt.Graphics2D graphics2D,
                       AxisProperties axisProperties,
                       java.lang.String axisTitle)
    Renders the YAxis on the passes Graphics2D object

    Parameters:
    graphics2D -
    axisProperties -
    axisTitle -

    computeLabelFilter

    public void computeLabelFilter()
    Method to compute the filter to use on the x-axis label display so labels do not overlap


    toHTML

    public void toHTML(HTMLGenerator htmlGenerator)
    Enables the testing routines to display the contents of this Object.

    Specified by:
    toHTML in interface HTMLTestable
    Overrides:
    toHTML in class Axis
    Parameters:
    htmlGenerator -

    computeAxisCoordinate

    public float computeAxisCoordinate(float origin,
                                       double value,
                                       double axisMinValue)
    Takes a value and determines the screen coordinate it should be drawn at. THe only difference between this and the y-axis is we add to the origin versus subtract from it.

    Parameters:
    origin -
    value -
    axisMinValue - the minimum value on the axis
    Returns:
    float the screen pixel coordinate


    jcharts-0.7.5/javadocs/org/jCharts/axisChart/axis/YAxis.html0000644000175000001440000005127707751071400023023 0ustar onkarusers YAxis (jCharts-0.7.5 API)

    org.jCharts.axisChart.axis
    Class YAxis

    java.lang.Object
      |
      +--org.jCharts.axisChart.axis.Axis
            |
            +--org.jCharts.axisChart.axis.YAxis
    
    All Implemented Interfaces:
    HTMLTestable, java.io.Serializable

    public final class YAxis
    extends Axis
    implements HTMLTestable

    See Also:
    Serialized Form

    Field Summary
    private  float lastTickY
               
     
    Fields inherited from class org.jCharts.axisChart.axis.Axis
     
    Constructor Summary
    YAxis(AxisChart axisChart, int numberOfScaleItems)
              Constructor
     
    Method Summary
     float computeAxisCoordinate(float origin, double value, double axisMinValue)
              Takes a value and determines the screen coordinate it should be drawn at.
     void computeMinimumWidthNeeded(java.lang.String yAxisTitle)
              Computes the minimum pixel width required for the Y-Axis.
     float getLastTickY()
              Need this value as horizontal plots start from the top of the axis and go down
     void render(java.awt.Graphics2D graphics2D, AxisProperties axisProperties, java.lang.String yAxisTitle)
              Renders the YAxis on the passes Graphics2D object
    private  void renderAxisTitle(java.lang.String axisTitle, java.awt.Graphics2D graphics2D, AxisTypeProperties axisTypeProperties)
               
     void toHTML(HTMLGenerator htmlGenerator)
              Enables the testing routines to display the contents of this Object.
     
    Methods inherited from class org.jCharts.axisChart.axis.Axis
    computeAxisTitleDimensions, computeOneUnitPixelSize, computeScalePixelWidth, computeScalePixelWidthDataAxis, getAxisChart, getAxisLabelsGroup, getMinimumHeightNeeded, getMinimumWidthNeeded, getNumberOfScaleItems, getOneUnitPixelSize, getOrigin, getPixelLength, getScaleCalculator, getScalePixelWidth, getTickStart, getTitleHeight, getTitleWidth, getZeroLineCoordinate, setAxisLabelsGroup, setMinimumHeightNeeded, setMinimumWidthNeeded, setOneUnitPixelSize, setOrigin, setPixelLength, setScaleCalculator, setScalePixelWidth, setTickStart, setZeroLineCoordinate
     
    Methods inherited from class java.lang.Object
    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
     

    Field Detail

    lastTickY

    private float lastTickY
    Constructor Detail

    YAxis

    public YAxis(AxisChart axisChart,
                 int numberOfScaleItems)
    Constructor

    Parameters:
    axisChart -
    Method Detail

    getLastTickY

    public float getLastTickY()
    Need this value as horizontal plots start from the top of the axis and go down

    Returns:

    computeMinimumWidthNeeded

    public void computeMinimumWidthNeeded(java.lang.String yAxisTitle)
    Computes the minimum pixel width required for the Y-Axis. Includes space, if needed, for: axis title + padding, axis values + tick padding, and tick marks.


    renderAxisTitle

    private void renderAxisTitle(java.lang.String axisTitle,
                                 java.awt.Graphics2D graphics2D,
                                 AxisTypeProperties axisTypeProperties)
    Parameters:
    axisTitle -
    graphics2D -
    axisTypeProperties -

    render

    public void render(java.awt.Graphics2D graphics2D,
                       AxisProperties axisProperties,
                       java.lang.String yAxisTitle)
    Renders the YAxis on the passes Graphics2D object

    Parameters:
    graphics2D -
    axisProperties -
    yAxisTitle -

    computeAxisCoordinate

    public float computeAxisCoordinate(float origin,
                                       double value,
                                       double axisMinValue)
    Takes a value and determines the screen coordinate it should be drawn at. THe only difference between this and the x-axis is we subtract to the origin versus subtract from it.

    Parameters:
    origin -
    value -
    axisMinValue - the minimum value on the axis
    Returns:
    float the screen pixel coordinate

    toHTML

    public void toHTML(HTMLGenerator htmlGenerator)
    Enables the testing routines to display the contents of this Object.

    Specified by:
    toHTML in interface HTMLTestable
    Overrides:
    toHTML in class Axis
    Parameters:
    htmlGenerator -


    jcharts-0.7.5/javadocs/org/jCharts/axisChart/customRenderers/0000755000175000001440000000000007751071402023306 5ustar onkarusersjcharts-0.7.5/javadocs/org/jCharts/axisChart/customRenderers/axisValue/0000755000175000001440000000000007751071404025251 5ustar onkarusersjcharts-0.7.5/javadocs/org/jCharts/axisChart/customRenderers/axisValue/renderers/0000755000175000001440000000000007751071404027242 5ustar onkarusers././@LongLink0000000000000000000000000000015100000000000011562 Lustar rootrootjcharts-0.7.5/javadocs/org/jCharts/axisChart/customRenderers/axisValue/renderers/BackgroundRenderer.htmljcharts-0.7.5/javadocs/org/jCharts/axisChart/customRenderers/axisValue/renderers/BackgroundRenderer.0000644000175000001440000003041607751071400033011 0ustar onkarusers BackgroundRenderer (jCharts-0.7.5 API)

    org.jCharts.axisChart.customRenderers.axisValue.renderers
    Class BackgroundRenderer

    java.lang.Object
      |
      +--org.jCharts.axisChart.customRenderers.axisValue.renderers.BackgroundRenderer
    
    All Implemented Interfaces:
    java.util.EventListener, PreAxisValueRenderListener

    public class BackgroundRenderer
    extends java.lang.Object
    implements PreAxisValueRenderListener


    Field Summary
    private  boolean draw
               
    private  java.awt.Paint paint
               
     
    Constructor Summary
    BackgroundRenderer(java.awt.Paint paint)
               
     
    Method Summary
     void preRender(AxisValueRenderEvent axisValueRenderEvent)
               
     
    Methods inherited from class java.lang.Object
    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
     

    Field Detail

    paint

    private java.awt.Paint paint

    draw

    private boolean draw
    Constructor Detail

    BackgroundRenderer

    public BackgroundRenderer(java.awt.Paint paint)
    Parameters:
    paint - the paint to do the background in. You might want to use an alpha less than 255 (as in 'new Color( 20, 20, 20, 50 )' ) as this gets plotted over top of the axis grid lines.
    Method Detail

    preRender

    public void preRender(AxisValueRenderEvent axisValueRenderEvent)
    Specified by:
    preRender in interface PreAxisValueRenderListener
    Parameters:
    axisValueRenderEvent -


    jcharts-0.7.5/javadocs/org/jCharts/axisChart/customRenderers/axisValue/renderers/package-frame.html0000644000175000001440000000254107751071376032625 0ustar onkarusers org.jCharts.axisChart.customRenderers.axisValue.renderers (jCharts-0.7.5 API) org.jCharts.axisChart.customRenderers.axisValue.renderers
    Classes 
    BackgroundRenderer
    ValueLabelPosition
    ValueLabelRenderer
    ././@LongLink0000000000000000000000000000014600000000000011566 Lustar rootrootjcharts-0.7.5/javadocs/org/jCharts/axisChart/customRenderers/axisValue/renderers/package-summary.htmljcharts-0.7.5/javadocs/org/jCharts/axisChart/customRenderers/axisValue/renderers/package-summary.htm0000644000175000001440000001375607751071376033066 0ustar onkarusers org.jCharts.axisChart.customRenderers.axisValue.renderers (jCharts-0.7.5 API)

    Package org.jCharts.axisChart.customRenderers.axisValue.renderers

    Class Summary
    BackgroundRenderer  
    ValueLabelPosition  
    ValueLabelRenderer  
     



    jcharts-0.7.5/javadocs/org/jCharts/axisChart/customRenderers/axisValue/renderers/package-tree.html0000644000175000001440000001477707751071376032510 0ustar onkarusers org.jCharts.axisChart.customRenderers.axisValue.renderers Class Hierarchy (jCharts-0.7.5 API)

    Hierarchy For Package org.jCharts.axisChart.customRenderers.axisValue.renderers

    Package Hierarchies:
    All Packages

    Class Hierarchy



    ././@LongLink0000000000000000000000000000015100000000000011562 Lustar rootrootjcharts-0.7.5/javadocs/org/jCharts/axisChart/customRenderers/axisValue/renderers/ValueLabelPosition.htmljcharts-0.7.5/javadocs/org/jCharts/axisChart/customRenderers/axisValue/renderers/ValueLabelPosition.0000644000175000001440000003712507751071400033010 0ustar onkarusers ValueLabelPosition (jCharts-0.7.5 API)

    org.jCharts.axisChart.customRenderers.axisValue.renderers
    Class ValueLabelPosition

    java.lang.Object
      |
      +--org.jCharts.axisChart.customRenderers.axisValue.renderers.ValueLabelPosition
    

    public class ValueLabelPosition
    extends java.lang.Object


    Field Summary
    static ValueLabelPosition ABOVE_ZERO_LINE
               
    static ValueLabelPosition AT_TOP
               
    static ValueLabelPosition AXIS_BOTTOM
               
    static ValueLabelPosition AXIS_TOP
               
    static ValueLabelPosition ON_TOP
               
    private  int position
               
     
    Constructor Summary
    protected ValueLabelPosition(int position)
               
     
    Method Summary
     boolean equals(ValueLabelPosition valueLabelPosition)
               
     int getPosition()
               
     
    Methods inherited from class java.lang.Object
    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
     

    Field Detail

    ON_TOP

    public static final ValueLabelPosition ON_TOP

    AT_TOP

    public static final ValueLabelPosition AT_TOP

    ABOVE_ZERO_LINE

    public static final ValueLabelPosition ABOVE_ZERO_LINE

    AXIS_TOP

    public static final ValueLabelPosition AXIS_TOP

    AXIS_BOTTOM

    public static final ValueLabelPosition AXIS_BOTTOM

    position

    private int position
    Constructor Detail

    ValueLabelPosition

    protected ValueLabelPosition(int position)
    Parameters:
    position -
    Method Detail

    getPosition

    public int getPosition()
    Returns:

    equals

    public final boolean equals(ValueLabelPosition valueLabelPosition)
    Parameters:
    valueLabelPosition -
    Returns:
    boolean


    ././@LongLink0000000000000000000000000000015100000000000011562 Lustar rootrootjcharts-0.7.5/javadocs/org/jCharts/axisChart/customRenderers/axisValue/renderers/ValueLabelRenderer.htmljcharts-0.7.5/javadocs/org/jCharts/axisChart/customRenderers/axisValue/renderers/ValueLabelRenderer.0000644000175000001440000006440607751071400032754 0ustar onkarusers ValueLabelRenderer (jCharts-0.7.5 API)

    org.jCharts.axisChart.customRenderers.axisValue.renderers
    Class ValueLabelRenderer

    java.lang.Object
      |
      +--org.jCharts.axisChart.customRenderers.axisValue.renderers.ValueLabelRenderer
    
    All Implemented Interfaces:
    java.util.EventListener, PostAxisValueRenderListener

    public class ValueLabelRenderer
    extends java.lang.Object
    implements PostAxisValueRenderListener


    Field Summary
    private  java.awt.Font derivedFont
               
    private  boolean isLabelVertical
               
    private  java.text.NumberFormat numberFormat
               
    private  int pixelValuePadding
               
    private  ChartFont valueChartFont
               
    private  ValueLabelPosition valueLabelPosition
               
     
    Constructor Summary
    ValueLabelRenderer(boolean isCurrency, boolean isPercent, boolean showGrouping, int roundingPowerOfTen)
               
    ValueLabelRenderer(boolean isCurrency, boolean showGrouping, int roundingPowerOfTen)
              Deprecated.  
     
    Method Summary
    private  float calculateXHorizontalPlot(AxisValueRenderEvent axisValueRenderEvent, TextTag formattedTextTag, boolean isNegative)
               
    private  float calculateXVerticalPlot(AxisValueRenderEvent axisValueRenderEvent, TextTag formattedTextTag)
              Calculates the label x so that the label is centered on the scale item.
    private  float calculateYHorizontalPlot(AxisValueRenderEvent axisValueRenderEvent, TextTag formattedTextTag)
               
    private  float calculateYVerticalPlot(AxisValueRenderEvent axisValueRenderEvent, TextTag formattedTextTag, boolean isNegative)
               
     void postRender(AxisValueRenderEvent axisValueRenderEvent)
               
     void setPixelValuePadding(int pixelValuePadding)
              The pixel padding between the label and the data point.
     void setValueChartFont(ChartFont valueChartFont)
               
     void setValueLabelPosition(ValueLabelPosition valueLabelPosition)
              Sets where you would like to position the label
     void useVerticalLabels(boolean useVerticalLabels)
               
     
    Methods inherited from class java.lang.Object
    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
     

    Field Detail

    numberFormat

    private java.text.NumberFormat numberFormat

    valueChartFont

    private ChartFont valueChartFont

    derivedFont

    private java.awt.Font derivedFont

    isLabelVertical

    private boolean isLabelVertical

    valueLabelPosition

    private ValueLabelPosition valueLabelPosition

    pixelValuePadding

    private int pixelValuePadding
    Constructor Detail

    ValueLabelRenderer

    public ValueLabelRenderer(boolean isCurrency,
                              boolean showGrouping,
                              int roundingPowerOfTen)
    Deprecated.  

    Parameters:
    isCurrency -
    showGrouping -
    roundingPowerOfTen -

    ValueLabelRenderer

    public ValueLabelRenderer(boolean isCurrency,
                              boolean isPercent,
                              boolean showGrouping,
                              int roundingPowerOfTen)
    Parameters:
    isCurrency -
    isPercent -
    showGrouping -
    roundingPowerOfTen -
    Method Detail

    setValueLabelPosition

    public void setValueLabelPosition(ValueLabelPosition valueLabelPosition)
    Sets where you would like to position the label

    Parameters:
    valueLabelPosition -

    setValueChartFont

    public void setValueChartFont(ChartFont valueChartFont)
    Parameters:
    valueChartFont -

    useVerticalLabels

    public void useVerticalLabels(boolean useVerticalLabels)
    Parameters:
    useVerticalLabels -

    setPixelValuePadding

    public void setPixelValuePadding(int pixelValuePadding)
    The pixel padding between the label and the data point.

    Parameters:
    pixelValuePadding -

    postRender

    public void postRender(AxisValueRenderEvent axisValueRenderEvent)
    Specified by:
    postRender in interface PostAxisValueRenderListener
    Parameters:
    axisValueRenderEvent -

    calculateXVerticalPlot

    private float calculateXVerticalPlot(AxisValueRenderEvent axisValueRenderEvent,
                                         TextTag formattedTextTag)
    Calculates the label x so that the label is centered on the scale item.

    Parameters:
    axisValueRenderEvent -
    formattedTextTag -
    Returns:
    float

    calculateYHorizontalPlot

    private float calculateYHorizontalPlot(AxisValueRenderEvent axisValueRenderEvent,
                                           TextTag formattedTextTag)
    Parameters:
    axisValueRenderEvent -
    formattedTextTag -
    Returns:
    float

    calculateXHorizontalPlot

    private float calculateXHorizontalPlot(AxisValueRenderEvent axisValueRenderEvent,
                                           TextTag formattedTextTag,
                                           boolean isNegative)
    Parameters:
    axisValueRenderEvent -
    formattedTextTag -
    isNegative -
    Returns:

    calculateYVerticalPlot

    private float calculateYVerticalPlot(AxisValueRenderEvent axisValueRenderEvent,
                                         TextTag formattedTextTag,
                                         boolean isNegative)
    Parameters:
    axisValueRenderEvent -
    formattedTextTag -
    isNegative -
    Returns:


    jcharts-0.7.5/javadocs/org/jCharts/axisChart/customRenderers/axisValue/AxisValueRenderEvent.html0000644000175000001440000005775107751071400032215 0ustar onkarusers AxisValueRenderEvent (jCharts-0.7.5 API)

    org.jCharts.axisChart.customRenderers.axisValue
    Class AxisValueRenderEvent

    java.lang.Object
      |
      +--java.util.EventObject
            |
            +--org.jCharts.axisChart.customRenderers.axisValue.AxisValueRenderEvent
    
    All Implemented Interfaces:
    java.io.Serializable

    public class AxisValueRenderEvent
    extends java.util.EventObject

    See Also:
    Serialized Form

    Field Summary
    private  int dataSetIndex
               
    private  java.awt.font.FontRenderContext fontRenderContext
               
    private  java.awt.Graphics2D graphics2D
               
    private  IAxisPlotDataSet iAxisPlotDataSet
               
    private  java.awt.geom.Rectangle2D.Float totalItemAxisArea
               
    private  int valueIndex
               
    private  float valueX
               
    private  float valueY
               
    private  float zeroLineCoordinate
               
     
    Fields inherited from class java.util.EventObject
    source
     
    Constructor Summary
    AxisValueRenderEvent(AxisChart axisChart, IAxisPlotDataSet iAxisPlotDataSet, java.awt.Graphics2D graphics2D, java.awt.geom.Rectangle2D.Float totalItemAxisArea, float zeroLineCoordinate)
               
     
    Method Summary
     int getDataSetIndex()
               
     java.awt.font.FontRenderContext getFontRenderContext()
               
     java.awt.Graphics2D getGraphics2D()
               
     IAxisPlotDataSet getiAxisPlotDataSet()
               
     java.awt.geom.Rectangle2D.Float getTotalItemAxisArea()
              Returns the bounding box of the total axis plot area alotted to the current scale item.
     int getValueIndex()
               
     float getValueX()
               
     float getValueY()
               
     float getZeroLineCoordinate()
               
     void setDataSetIndex(int dataSetIndex)
               
     void setValueIndex(int valueIndex)
               
     void setValueX(float valueX)
               
     void setValueY(float valueY)
               
     
    Methods inherited from class java.util.EventObject
    getSource, toString
     
    Methods inherited from class java.lang.Object
    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
     

    Field Detail

    graphics2D

    private java.awt.Graphics2D graphics2D

    fontRenderContext

    private java.awt.font.FontRenderContext fontRenderContext

    iAxisPlotDataSet

    private IAxisPlotDataSet iAxisPlotDataSet

    totalItemAxisArea

    private java.awt.geom.Rectangle2D.Float totalItemAxisArea

    zeroLineCoordinate

    private float zeroLineCoordinate

    valueX

    private float valueX

    valueY

    private float valueY

    dataSetIndex

    private int dataSetIndex

    valueIndex

    private int valueIndex
    Constructor Detail

    AxisValueRenderEvent

    public AxisValueRenderEvent(AxisChart axisChart,
                                IAxisPlotDataSet iAxisPlotDataSet,
                                java.awt.Graphics2D graphics2D,
                                java.awt.geom.Rectangle2D.Float totalItemAxisArea,
                                float zeroLineCoordinate)
    Parameters:
    axisChart -
    graphics2D -
    totalItemAxisArea -
    Method Detail

    getGraphics2D

    public java.awt.Graphics2D getGraphics2D()
    Returns:
    Graphics2D

    getFontRenderContext

    public java.awt.font.FontRenderContext getFontRenderContext()
    Returns:
    FontRenderContext

    getTotalItemAxisArea

    public java.awt.geom.Rectangle2D.Float getTotalItemAxisArea()
    Returns the bounding box of the total axis plot area alotted to the current scale item.

    Returns:
    Rectangle2D.Float

    getiAxisPlotDataSet

    public IAxisPlotDataSet getiAxisPlotDataSet()

    getValueX

    public float getValueX()
    Returns:

    setValueX

    public void setValueX(float valueX)

    getValueY

    public float getValueY()

    setValueY

    public void setValueY(float valueY)

    getDataSetIndex

    public int getDataSetIndex()

    setDataSetIndex

    public void setDataSetIndex(int dataSetIndex)

    getValueIndex

    public int getValueIndex()

    setValueIndex

    public void setValueIndex(int valueIndex)

    getZeroLineCoordinate

    public float getZeroLineCoordinate()


    jcharts-0.7.5/javadocs/org/jCharts/axisChart/customRenderers/axisValue/package-frame.html0000644000175000001440000000302107751071376030626 0ustar onkarusers org.jCharts.axisChart.customRenderers.axisValue (jCharts-0.7.5 API) org.jCharts.axisChart.customRenderers.axisValue
    Interfaces 
    PostAxisValueRenderListener
    PreAxisValueRenderListener
    Classes 
    AxisValueRenderEvent
    jcharts-0.7.5/javadocs/org/jCharts/axisChart/customRenderers/axisValue/package-summary.html0000644000175000001440000001453707751071376031247 0ustar onkarusers org.jCharts.axisChart.customRenderers.axisValue (jCharts-0.7.5 API)

    Package org.jCharts.axisChart.customRenderers.axisValue

    Interface Summary
    PostAxisValueRenderListener This Class is used to recieve callbacks from the chart renderers after they render their value to the chart, with value meaning their bar, point, line, etc...
    PreAxisValueRenderListener  
     

    Class Summary
    AxisValueRenderEvent  
     



    jcharts-0.7.5/javadocs/org/jCharts/axisChart/customRenderers/axisValue/package-tree.html0000644000175000001440000001435707751071376030511 0ustar onkarusers org.jCharts.axisChart.customRenderers.axisValue Class Hierarchy (jCharts-0.7.5 API)

    Hierarchy For Package org.jCharts.axisChart.customRenderers.axisValue

    Package Hierarchies:
    All Packages

    Class Hierarchy

    Interface Hierarchy



    ././@LongLink0000000000000000000000000000015000000000000011561 Lustar rootrootjcharts-0.7.5/javadocs/org/jCharts/axisChart/customRenderers/axisValue/PostAxisValueRenderListener.htmljcharts-0.7.5/javadocs/org/jCharts/axisChart/customRenderers/axisValue/PostAxisValueRenderListener.h0000644000175000001440000002062407751071400033037 0ustar onkarusers PostAxisValueRenderListener (jCharts-0.7.5 API)

    org.jCharts.axisChart.customRenderers.axisValue
    Interface PostAxisValueRenderListener

    All Superinterfaces:
    java.util.EventListener
    All Known Implementing Classes:
    ValueLabelRenderer

    public interface PostAxisValueRenderListener
    extends java.util.EventListener

    This Class is used to recieve callbacks from the chart renderers after they render their value to the chart, with value meaning their bar, point, line, etc...


    Method Summary
     void postRender(AxisValueRenderEvent axisValueRenderEvent)
               
     

    Method Detail

    postRender

    public void postRender(AxisValueRenderEvent axisValueRenderEvent)


    ././@LongLink0000000000000000000000000000014700000000000011567 Lustar rootrootjcharts-0.7.5/javadocs/org/jCharts/axisChart/customRenderers/axisValue/PreAxisValueRenderListener.htmljcharts-0.7.5/javadocs/org/jCharts/axisChart/customRenderers/axisValue/PreAxisValueRenderListener.ht0000644000175000001440000002033207751071400033020 0ustar onkarusers PreAxisValueRenderListener (jCharts-0.7.5 API)

    org.jCharts.axisChart.customRenderers.axisValue
    Interface PreAxisValueRenderListener

    All Superinterfaces:
    java.util.EventListener
    All Known Implementing Classes:
    BackgroundRenderer

    public interface PreAxisValueRenderListener
    extends java.util.EventListener


    Method Summary
     void preRender(AxisValueRenderEvent axisValueRenderEvent)
               
     

    Method Detail

    preRender

    public void preRender(AxisValueRenderEvent axisValueRenderEvent)


    jcharts-0.7.5/javadocs/org/jCharts/axisChart/AreaChart.html0000644000175000001440000002254507751071400022650 0ustar onkarusers AreaChart (jCharts-0.7.5 API)

    org.jCharts.axisChart
    Class AreaChart

    java.lang.Object
      |
      +--org.jCharts.axisChart.AreaChart
    

    abstract class AreaChart
    extends java.lang.Object


    Constructor Summary
    (package private) AreaChart()
               
     
    Method Summary
    (package private) static void render(AxisChart axisChart, IAxisChartDataSet iAxisChartDataSet)
              Draws the chart
     
    Methods inherited from class java.lang.Object
    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
     

    Constructor Detail

    AreaChart

    AreaChart()
    Method Detail

    render

    static void render(AxisChart axisChart,
                       IAxisChartDataSet iAxisChartDataSet)
    Draws the chart

    Parameters:
    axisChart -
    iAxisChartDataSet -


    jcharts-0.7.5/javadocs/org/jCharts/axisChart/AxisChart.html0000644000175000001440000007616707751071400022715 0ustar onkarusers AxisChart (jCharts-0.7.5 API)

    org.jCharts.axisChart
    Class AxisChart

    java.lang.Object
      |
      +--org.jCharts.Chart
            |
            +--org.jCharts.axisChart.AxisChart
    
    All Implemented Interfaces:
    HTMLChartTestable, java.io.Serializable
    Direct Known Subclasses:
    ScatterPlotAxisChart

    public class AxisChart
    extends Chart
    implements HTMLChartTestable

    This Class is used to create all axis chart types. This class knows how to render charts based on the ChartType specified in on the iAxisChartDataSet.

    See Also:
    Serialized Form

    Field Summary
    protected  AxisProperties axisProperties
               
    private  IAxisDataSeries iAxisDataSeries
               
    protected  XAxis xAxis
               
    protected  YAxis yAxis
               
     
    Fields inherited from class org.jCharts.Chart
     
    Constructor Summary
    AxisChart(IAxisDataSeries iAxisDataSeries, ChartProperties chartProperties, AxisProperties axisProperties, LegendProperties legendProperties, int pixelWidth, int pixelHeight)
              Constructor
     
    Method Summary
    private  boolean allowHorizontalPlot()
              We only allow horizontal plots for the Bar Chart types in this release.
     AxisChartDataProcessor createAxisChartDataProcessor()
              ScatterPlots create a subclass of AxisChartDataProcessor so we need this method so we can overload it.
    protected  void deriveAxisValues()
               
     AxisProperties getAxisProperties()
               
     IAxisDataSeries getIAxisDataSeries()
               
     XAxis getXAxis()
               
     YAxis getYAxis()
               
    protected  void overlayCharts()
              Draws the charts over the axis.
    protected  void renderChart()
              Implement the method to render the Axis based chart
    protected  void setupAxis(AxisChartDataProcessor axisChartDataProcessor, java.awt.font.FontRenderContext fontRenderContext)
               
    protected  NumericTagGroup setupDataAxisProperties(Axis axis, DataAxisProperties dataAxisProperties, AxisChartDataProcessor axisChartDataProcessor, java.awt.font.FontRenderContext fontRenderContext)
              Once we determine which axis is the data axis, the logic to set it up is the same whether it is a horizontal or vertical plot.
    private  void sizeAndPositionAxis(float xAxisWidth, float yAxisHeight, float chartTitleHeight)
              Finalizes the size of both Axis and sets the origin position
     void toHTML(HTMLGenerator htmlGenerator, java.lang.String imageFileName, ImageMap imageMap)
              Enables the testing routines to display the contents of this Object.
    private  void validateHorizontalPlot()
              Currently, we only support the bar chart types being horizontal, and you can not have a horizontally plotted bar chart in a combo chart.
     
    Methods inherited from class org.jCharts.Chart
    getBufferedImage, getChartProperties, getGenerateImageMapFlag, getGraphics2D, getImageHeight, getImageMap, getImageWidth, getLegend, hasLegend, render, renderChartTitle, renderWithImageMap, setGraphics2D, setImageMap
     
    Methods inherited from class java.lang.Object
    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
     

    Field Detail

    xAxis

    protected XAxis xAxis

    yAxis

    protected YAxis yAxis

    axisProperties

    protected AxisProperties axisProperties

    iAxisDataSeries

    private IAxisDataSeries iAxisDataSeries
    Constructor Detail

    AxisChart

    public AxisChart(IAxisDataSeries iAxisDataSeries,
                     ChartProperties chartProperties,
                     AxisProperties axisProperties,
                     LegendProperties legendProperties,
                     int pixelWidth,
                     int pixelHeight)
    Constructor

    Parameters:
    iAxisDataSeries -
    chartProperties -
    axisProperties -
    legendProperties - if no legend is desired, pass NULL
    pixelWidth -
    pixelHeight -
    Method Detail

    getIAxisDataSeries

    public IAxisDataSeries getIAxisDataSeries()
    Returns:
    IAxisDataSeries

    createAxisChartDataProcessor

    public AxisChartDataProcessor createAxisChartDataProcessor()
    ScatterPlots create a subclass of AxisChartDataProcessor so we need this method so we can overload it.

    Returns:
    AxisChartDataProcessor

    setupDataAxisProperties

    protected NumericTagGroup setupDataAxisProperties(Axis axis,
                                                      DataAxisProperties dataAxisProperties,
                                                      AxisChartDataProcessor axisChartDataProcessor,
                                                      java.awt.font.FontRenderContext fontRenderContext)
    Once we determine which axis is the data axis, the logic to set it up is the same whether it is a horizontal or vertical plot.

    Parameters:
    dataAxisProperties -
    axisChartDataProcessor -
    fontRenderContext -
    Returns:
    NumericTagGroup need to set this on the right axis

    setupAxis

    protected void setupAxis(AxisChartDataProcessor axisChartDataProcessor,
                             java.awt.font.FontRenderContext fontRenderContext)
                      throws ChartDataException
    Parameters:
    axisChartDataProcessor -
    fontRenderContext -
    ChartDataException

    sizeAndPositionAxis

    private void sizeAndPositionAxis(float xAxisWidth,
                                     float yAxisHeight,
                                     float chartTitleHeight)
    Finalizes the size of both Axis and sets the origin position

    Parameters:
    xAxisWidth -
    yAxisHeight -
    chartTitleHeight -

    deriveAxisValues

    protected void deriveAxisValues()

    renderChart

    protected void renderChart()
                        throws ChartDataException,
                               PropertyException
    Implement the method to render the Axis based chart

    Specified by:
    renderChart in class Chart
    Throws:
    ChartDataException
    PropertyException - there are several validations done to aid in development of the charts.

    overlayCharts

    protected void overlayCharts()
                          throws PropertyException,
                                 ChartDataException
    Draws the charts over the axis. We have to render in a specific order so combo charts get drawn correctly

    Throws:
    PropertyException
    ChartDataException

    validateHorizontalPlot

    private void validateHorizontalPlot()
                                 throws PropertyException
    Currently, we only support the bar chart types being horizontal, and you can not have a horizontally plotted bar chart in a combo chart.

    Throws:
    PropertyException

    allowHorizontalPlot

    private boolean allowHorizontalPlot()
    We only allow horizontal plots for the Bar Chart types in this release.

    Returns:
    boolean

    getAxisProperties

    public AxisProperties getAxisProperties()

    getXAxis

    public XAxis getXAxis()

    getYAxis

    public YAxis getYAxis()

    toHTML

    public void toHTML(HTMLGenerator htmlGenerator,
                       java.lang.String imageFileName,
                       ImageMap imageMap)
    Enables the testing routines to display the contents of this Object. Override Chart implementation as PieCharts use AreaProperties directly rather than a child.

    Specified by:
    toHTML in interface HTMLChartTestable
    Overrides:
    toHTML in class Chart
    Parameters:
    htmlGenerator -
    imageFileName -
    imageMap - if this is NULL we are not creating image map data in html


    jcharts-0.7.5/javadocs/org/jCharts/axisChart/BarChart.html0000644000175000001440000003753707751071400022513 0ustar onkarusers BarChart (jCharts-0.7.5 API)

    org.jCharts.axisChart
    Class BarChart

    java.lang.Object
      |
      +--org.jCharts.axisChart.BarChart
    

    abstract class BarChart
    extends java.lang.Object


    Constructor Summary
    (package private) BarChart()
               
     
    Method Summary
    (package private) static float computeScaleHeightOfValue(double value, double oneUnitPixelSize)
              Takes a value and determines the number of pixels it should fill on the screen.
    private static void horizontalPlot(AxisChart axisChart, IAxisChartDataSet iAxisChartDataSet, BarChartProperties barChartProperties, DataAxisProperties dataAxisProperties, java.awt.Graphics2D g2d, java.awt.geom.Rectangle2D.Float rectangle, float startingX)
               
    (package private) static void render(AxisChart axisChart, IAxisChartDataSet iAxisChartDataSet)
              Draws the chart uses Rectangle2D......keep having rounding problems.
    private static void verticalPlot(AxisChart axisChart, IAxisChartDataSet iAxisChartDataSet, BarChartProperties barChartProperties, DataAxisProperties dataAxisProperties, java.awt.Graphics2D g2d, java.awt.geom.Rectangle2D.Float rectangle, float startingY)
               
     
    Methods inherited from class java.lang.Object
    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
     

    Constructor Detail

    BarChart

    BarChart()
    Method Detail

    render

    static void render(AxisChart axisChart,
                       IAxisChartDataSet iAxisChartDataSet)
    Draws the chart uses Rectangle2D......keep having rounding problems.

    Parameters:
    axisChart -
    iAxisChartDataSet -

    horizontalPlot

    private static void horizontalPlot(AxisChart axisChart,
                                       IAxisChartDataSet iAxisChartDataSet,
                                       BarChartProperties barChartProperties,
                                       DataAxisProperties dataAxisProperties,
                                       java.awt.Graphics2D g2d,
                                       java.awt.geom.Rectangle2D.Float rectangle,
                                       float startingX)
    Parameters:
    axisChart -
    iAxisChartDataSet -
    barChartProperties -
    dataAxisProperties -
    g2d -
    rectangle -
    startingX -

    verticalPlot

    private static void verticalPlot(AxisChart axisChart,
                                     IAxisChartDataSet iAxisChartDataSet,
                                     BarChartProperties barChartProperties,
                                     DataAxisProperties dataAxisProperties,
                                     java.awt.Graphics2D g2d,
                                     java.awt.geom.Rectangle2D.Float rectangle,
                                     float startingY)
    Parameters:
    axisChart -
    iAxisChartDataSet -
    barChartProperties -
    dataAxisProperties -
    g2d -
    rectangle -
    startingY -

    computeScaleHeightOfValue

    static float computeScaleHeightOfValue(double value,
                                           double oneUnitPixelSize)
    Takes a value and determines the number of pixels it should fill on the screen. If there is a user defined scale and the passed value is greater than the MAX or less than the MIN, the height will be forced to the MAX or MIN respectively.

    Parameters:
    value -
    oneUnitPixelSize -
    Returns:
    float the screen pixel coordinate


    jcharts-0.7.5/javadocs/org/jCharts/axisChart/ClusteredBarChart.html0000644000175000001440000003652507751071400024362 0ustar onkarusers ClusteredBarChart (jCharts-0.7.5 API)

    org.jCharts.axisChart
    Class ClusteredBarChart

    java.lang.Object
      |
      +--org.jCharts.axisChart.ClusteredBarChart
    

    abstract class ClusteredBarChart
    extends java.lang.Object


    Constructor Summary
    (package private) ClusteredBarChart()
               
     
    Method Summary
    private static void horizontalPlot(AxisChart axisChart, IAxisChartDataSet iAxisChartDataSet, ClusteredBarChartProperties clusteredBarChartProperties, DataAxisProperties dataAxisProperties, java.awt.Graphics2D g2d, java.awt.geom.Rectangle2D.Float rectangle, float startingX, float startingY, float barWidth)
               
    (package private) static void render(AxisChart axisChart, IAxisChartDataSet iAxisChartDataSet)
              Draws the chart uses Rectangle2D......keep having rounding problems.
    private static void verticalPlot(AxisChart axisChart, IAxisChartDataSet iAxisChartDataSet, BarChartProperties barChartProperties, DataAxisProperties dataAxisProperties, java.awt.Graphics2D g2d, java.awt.geom.Rectangle2D.Float rectangle, float barGroupStartingX, float startingY, float barWidth)
               
     
    Methods inherited from class java.lang.Object
    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
     

    Constructor Detail

    ClusteredBarChart

    ClusteredBarChart()
    Method Detail

    render

    static void render(AxisChart axisChart,
                       IAxisChartDataSet iAxisChartDataSet)
    Draws the chart uses Rectangle2D......keep having rounding problems.

    Parameters:
    axisChart -
    iAxisChartDataSet -

    horizontalPlot

    private static void horizontalPlot(AxisChart axisChart,
                                       IAxisChartDataSet iAxisChartDataSet,
                                       ClusteredBarChartProperties clusteredBarChartProperties,
                                       DataAxisProperties dataAxisProperties,
                                       java.awt.Graphics2D g2d,
                                       java.awt.geom.Rectangle2D.Float rectangle,
                                       float startingX,
                                       float startingY,
                                       float barWidth)
    Parameters:
    axisChart -
    iAxisChartDataSet -
    clusteredBarChartProperties -
    dataAxisProperties -
    g2d -
    rectangle -
    startingX -
    startingY -
    barWidth -

    verticalPlot

    private static void verticalPlot(AxisChart axisChart,
                                     IAxisChartDataSet iAxisChartDataSet,
                                     BarChartProperties barChartProperties,
                                     DataAxisProperties dataAxisProperties,
                                     java.awt.Graphics2D g2d,
                                     java.awt.geom.Rectangle2D.Float rectangle,
                                     float barGroupStartingX,
                                     float startingY,
                                     float barWidth)
    Parameters:
    axisChart -
    iAxisChartDataSet -
    barChartProperties -
    dataAxisProperties -
    g2d -
    rectangle -
    startingY -


    jcharts-0.7.5/javadocs/org/jCharts/axisChart/LineChart.html0000644000175000001440000002334207751071400022663 0ustar onkarusers LineChart (jCharts-0.7.5 API)

    org.jCharts.axisChart
    Class LineChart

    java.lang.Object
      |
      +--org.jCharts.axisChart.LineChart
    

    abstract class LineChart
    extends java.lang.Object


    Constructor Summary
    (package private) LineChart()
               
     
    Method Summary
    (package private) static void render(AxisChart axisChart, IAxisChartDataSet iAxisChartDataSet)
              Draws the chart
     
    Methods inherited from class java.lang.Object
    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
     

    Constructor Detail

    LineChart

    LineChart()
    Method Detail

    render

    static void render(AxisChart axisChart,
                       IAxisChartDataSet iAxisChartDataSet)
                throws PropertyException
    Draws the chart

    Parameters:
    axisChart -
    iAxisChartDataSet -
    Throws:
    PropertyException


    jcharts-0.7.5/javadocs/org/jCharts/axisChart/package-frame.html0000644000175000001440000000330507751071376023506 0ustar onkarusers org.jCharts.axisChart (jCharts-0.7.5 API) org.jCharts.axisChart
    Classes 
    AreaChart
    AxisChart
    BarChart
    ClusteredBarChart
    LineChart
    PointChart
    ScatterPlotAxisChart
    ScatterPlotChart
    StackedAreaChart
    StackedBarChart
    StockChart
    jcharts-0.7.5/javadocs/org/jCharts/axisChart/package-summary.html0000644000175000001440000001544707751071376024123 0ustar onkarusers org.jCharts.axisChart (jCharts-0.7.5 API)

    Package org.jCharts.axisChart

    Class Summary
    AreaChart  
    AxisChart This Class is used to create all axis chart types.
    BarChart  
    ClusteredBarChart  
    LineChart  
    PointChart  
    ScatterPlotAxisChart This Class is used to create all axis chart types.
    ScatterPlotChart  
    StackedAreaChart  
    StackedBarChart  
    StockChart  
     



    jcharts-0.7.5/javadocs/org/jCharts/axisChart/package-tree.html0000644000175000001440000001560007751071376023354 0ustar onkarusers org.jCharts.axisChart Class Hierarchy (jCharts-0.7.5 API)

    Hierarchy For Package org.jCharts.axisChart

    Package Hierarchies:
    All Packages

    Class Hierarchy



    jcharts-0.7.5/javadocs/org/jCharts/axisChart/PointChart.html0000644000175000001440000002302107751071400023057 0ustar onkarusers PointChart (jCharts-0.7.5 API)

    org.jCharts.axisChart
    Class PointChart

    java.lang.Object
      |
      +--org.jCharts.axisChart.PointChart
    

    abstract class PointChart
    extends java.lang.Object


    Constructor Summary
    (package private) PointChart()
               
     
    Method Summary
    (package private) static void render(AxisChart axisChart, IAxisChartDataSet iAxisChartDataSet)
              Draws the chart
     
    Methods inherited from class java.lang.Object
    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
     

    Constructor Detail

    PointChart

    PointChart()
    Method Detail

    render

    static void render(AxisChart axisChart,
                       IAxisChartDataSet iAxisChartDataSet)
    Draws the chart

    Parameters:
    axisChart -
    iAxisChartDataSet -


    jcharts-0.7.5/javadocs/org/jCharts/axisChart/ScatterPlotAxisChart.html0000644000175000001440000006101307751071400025062 0ustar onkarusers ScatterPlotAxisChart (jCharts-0.7.5 API)

    org.jCharts.axisChart
    Class ScatterPlotAxisChart

    java.lang.Object
      |
      +--org.jCharts.Chart
            |
            +--org.jCharts.axisChart.AxisChart
                  |
                  +--org.jCharts.axisChart.ScatterPlotAxisChart
    
    All Implemented Interfaces:
    HTMLChartTestable, java.io.Serializable

    public class ScatterPlotAxisChart
    extends AxisChart
    implements HTMLChartTestable

    This Class is used to create all axis chart types. This class knows how to render charts based on the ChartType specified in on the iAxisChartDataSet.

    See Also:
    Serialized Form

    Field Summary
     
    Fields inherited from class org.jCharts.axisChart.AxisChart
    axisProperties, xAxis, yAxis
     
    Fields inherited from class org.jCharts.Chart
     
    Constructor Summary
    ScatterPlotAxisChart(IScatterPlotDataSeries iScatterPlotDataSeries, ChartProperties chartProperties, AxisProperties axisProperties, LegendProperties legendProperties, int pixelWidth, int pixelHeight)
              Constructor
     
    Method Summary
     AxisChartDataProcessor createAxisChartDataProcessor()
              ScatterPlots create a subclass of AxisChartDataProcessor so we need this method so we can overload it.
    protected  void deriveAxisValues()
               
    protected  void overlayCharts()
              Draws the charts over the axis.
    protected  void setupAxis(AxisChartDataProcessor axisChartDataProcessor, java.awt.font.FontRenderContext fontRenderContext)
               
    protected  NumericTagGroup setupDataAxisProperties(Axis axis, DataAxisProperties dataAxisProperties, AxisChartDataProcessor axisChartDataProcessor, java.awt.font.FontRenderContext fontRenderContext)
              Once we determine which axis is the data axis, the logic to set it up is the same whether it is a horizontal or vertical plot.
     void toHTML(HTMLGenerator htmlGenerator, java.lang.String imageFileName, ImageMap imageMap)
              Enables the testing routines to display the contents of this Object.
     
    Methods inherited from class org.jCharts.axisChart.AxisChart
    getAxisProperties, getIAxisDataSeries, getXAxis, getYAxis, renderChart
     
    Methods inherited from class org.jCharts.Chart
    getBufferedImage, getChartProperties, getGenerateImageMapFlag, getGraphics2D, getImageHeight, getImageMap, getImageWidth, getLegend, hasLegend, render, renderChartTitle, renderWithImageMap, setGraphics2D, setImageMap
     
    Methods inherited from class java.lang.Object
    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
     

    Constructor Detail

    ScatterPlotAxisChart

    public ScatterPlotAxisChart(IScatterPlotDataSeries iScatterPlotDataSeries,
                                ChartProperties chartProperties,
                                AxisProperties axisProperties,
                                LegendProperties legendProperties,
                                int pixelWidth,
                                int pixelHeight)
    Constructor

    Parameters:
    iScatterPlotDataSeries -
    chartProperties -
    axisProperties -
    legendProperties - if no legend is desired, pass NULL
    pixelWidth -
    pixelHeight -
    Method Detail

    createAxisChartDataProcessor

    public AxisChartDataProcessor createAxisChartDataProcessor()
    ScatterPlots create a subclass of AxisChartDataProcessor so we need this method so we can overload it.

    Overrides:
    createAxisChartDataProcessor in class AxisChart
    Returns:
    AxisChartDataProcessor

    setupDataAxisProperties

    protected NumericTagGroup setupDataAxisProperties(Axis axis,
                                                      DataAxisProperties dataAxisProperties,
                                                      AxisChartDataProcessor axisChartDataProcessor,
                                                      java.awt.font.FontRenderContext fontRenderContext)
    Once we determine which axis is the data axis, the logic to set it up is the same whether it is a horizontal or vertical plot.

    Overrides:
    setupDataAxisProperties in class AxisChart
    Parameters:
    dataAxisProperties -
    axisChartDataProcessor -
    fontRenderContext -
    Returns:
    NumericTagGroup need to set this on the right axis

    setupAxis

    protected void setupAxis(AxisChartDataProcessor axisChartDataProcessor,
                             java.awt.font.FontRenderContext fontRenderContext)
    Overrides:
    setupAxis in class AxisChart
    Parameters:
    axisChartDataProcessor -
    fontRenderContext -

    deriveAxisValues

    protected void deriveAxisValues()
    Overrides:
    deriveAxisValues in class AxisChart

    overlayCharts

    protected void overlayCharts()
                          throws PropertyException
    Draws the charts over the axis. We have to render in a specific order so combo charts get drawn correctly

    Overrides:
    overlayCharts in class AxisChart
    Throws:
    PropertyException

    toHTML

    public void toHTML(HTMLGenerator htmlGenerator,
                       java.lang.String imageFileName,
                       ImageMap imageMap)
    Enables the testing routines to display the contents of this Object. Override Chart implementation as PieCharts use AreaProperties directly rather than a child.

    Specified by:
    toHTML in interface HTMLChartTestable
    Overrides:
    toHTML in class AxisChart
    Parameters:
    htmlGenerator -
    imageFileName -
    imageMap - if this is NULL we are not creating image map data in html


    jcharts-0.7.5/javadocs/org/jCharts/axisChart/ScatterPlotChart.html0000644000175000001440000002336407751071400024244 0ustar onkarusers ScatterPlotChart (jCharts-0.7.5 API)

    org.jCharts.axisChart
    Class ScatterPlotChart

    java.lang.Object
      |
      +--org.jCharts.axisChart.ScatterPlotChart
    

    abstract class ScatterPlotChart
    extends java.lang.Object


    Constructor Summary
    (package private) ScatterPlotChart()
               
     
    Method Summary
    (package private) static void render(ScatterPlotAxisChart scatterPlotAxisChart, IScatterPlotDataSet iScatterPlotDataSet)
              Draws the chart
     
    Methods inherited from class java.lang.Object
    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
     

    Constructor Detail

    ScatterPlotChart

    ScatterPlotChart()
    Method Detail

    render

    static void render(ScatterPlotAxisChart scatterPlotAxisChart,
                       IScatterPlotDataSet iScatterPlotDataSet)
    Draws the chart

    Parameters:
    scatterPlotAxisChart -
    iScatterPlotDataSet -


    jcharts-0.7.5/javadocs/org/jCharts/axisChart/StackedAreaChart.html0000644000175000001440000002316507751071400024146 0ustar onkarusers StackedAreaChart (jCharts-0.7.5 API)

    org.jCharts.axisChart
    Class StackedAreaChart

    java.lang.Object
      |
      +--org.jCharts.axisChart.StackedAreaChart
    

    abstract class StackedAreaChart
    extends java.lang.Object


    Constructor Summary
    (package private) StackedAreaChart()
               
     
    Method Summary
    (package private) static void render(AxisChart axisChart, IAxisChartDataSet iAxisChartDataSet)
              Draws the chart
     
    Methods inherited from class java.lang.Object
    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
     

    Constructor Detail

    StackedAreaChart

    StackedAreaChart()
    Method Detail

    render

    static void render(AxisChart axisChart,
                       IAxisChartDataSet iAxisChartDataSet)
    Draws the chart

    Parameters:
    axisChart -
    iAxisChartDataSet -


    jcharts-0.7.5/javadocs/org/jCharts/axisChart/StackedBarChart.html0000644000175000001440000003625207751071400024003 0ustar onkarusers StackedBarChart (jCharts-0.7.5 API)

    org.jCharts.axisChart
    Class StackedBarChart

    java.lang.Object
      |
      +--org.jCharts.axisChart.StackedBarChart
    

    abstract class StackedBarChart
    extends java.lang.Object


    Constructor Summary
    (package private) StackedBarChart()
               
     
    Method Summary
    private static void horizontalPlot(AxisChart axisChart, IAxisChartDataSet iAxisChartDataSet, StackedBarChartProperties stackedBarChartProperties, DataAxisProperties dataAxisProperties, java.awt.Graphics2D g2d, java.awt.geom.Rectangle2D.Float rectangle, float startingX)
               
    (package private) static void render(AxisChart axisChart, IAxisChartDataSet iAxisChartDataSet)
              Draws the chart
    private static void verticalPlot(AxisChart axisChart, IAxisChartDataSet iAxisChartDataSet, StackedBarChartProperties stackedBarChartProperties, DataAxisProperties dataAxisProperties, java.awt.Graphics2D g2d, java.awt.geom.Rectangle2D.Float rectangle, float startingY)
               
     
    Methods inherited from class java.lang.Object
    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
     

    Constructor Detail

    StackedBarChart

    StackedBarChart()
    Method Detail

    render

    static void render(AxisChart axisChart,
                       IAxisChartDataSet iAxisChartDataSet)
                throws ChartDataException
    Draws the chart

    Parameters:
    axisChart -
    ChartDataException

    horizontalPlot

    private static void horizontalPlot(AxisChart axisChart,
                                       IAxisChartDataSet iAxisChartDataSet,
                                       StackedBarChartProperties stackedBarChartProperties,
                                       DataAxisProperties dataAxisProperties,
                                       java.awt.Graphics2D g2d,
                                       java.awt.geom.Rectangle2D.Float rectangle,
                                       float startingX)
                                throws ChartDataException
    Parameters:
    axisChart -
    iAxisChartDataSet -
    stackedBarChartProperties -
    dataAxisProperties -
    g2d -
    rectangle -
    startingX -
    ChartDataException

    verticalPlot

    private static void verticalPlot(AxisChart axisChart,
                                     IAxisChartDataSet iAxisChartDataSet,
                                     StackedBarChartProperties stackedBarChartProperties,
                                     DataAxisProperties dataAxisProperties,
                                     java.awt.Graphics2D g2d,
                                     java.awt.geom.Rectangle2D.Float rectangle,
                                     float startingY)
    Parameters:
    axisChart -
    iAxisChartDataSet -
    stackedBarChartProperties -
    dataAxisProperties -
    g2d -
    rectangle -
    startingY -


    jcharts-0.7.5/javadocs/org/jCharts/axisChart/StockChart.html0000644000175000001440000002262607751071400023063 0ustar onkarusers StockChart (jCharts-0.7.5 API)

    org.jCharts.axisChart
    Class StockChart

    java.lang.Object
      |
      +--org.jCharts.axisChart.StockChart
    

    abstract class StockChart
    extends java.lang.Object


    Constructor Summary
    (package private) StockChart()
               
     
    Method Summary
    (package private) static void render(AxisChart axisChart, IStockChartDataSet iStockChartDataSet)
              Draws the chart
     
    Methods inherited from class java.lang.Object
    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
     

    Constructor Detail

    StockChart

    StockChart()
    Method Detail

    render

    static final void render(AxisChart axisChart,
                             IStockChartDataSet iStockChartDataSet)
    Draws the chart

    Parameters:
    axisChart -
    iStockChartDataSet -


    jcharts-0.7.5/javadocs/org/jCharts/chartData/0000755000175000001440000000000007751071404020071 5ustar onkarusersjcharts-0.7.5/javadocs/org/jCharts/chartData/interfaces/0000755000175000001440000000000007751071404022214 5ustar onkarusersjcharts-0.7.5/javadocs/org/jCharts/chartData/interfaces/IAxisChartDataSet.html0000644000175000001440000002400507751071400026344 0ustar onkarusers IAxisChartDataSet (jCharts-0.7.5 API)

    org.jCharts.chartData.interfaces
    Interface IAxisChartDataSet

    All Superinterfaces:
    IAxisPlotDataSet, IData, IDataSet, java.io.Serializable
    All Known Implementing Classes:
    AxisChartDataSet

    public interface IAxisChartDataSet
    extends IAxisPlotDataSet


    Method Summary
     double getValue(int dataset, int index)
              Returns the value in the data set at the specified position.
     
    Methods inherited from interface org.jCharts.chartData.interfaces.IAxisPlotDataSet
    getChartType, getNumberOfDataSets, validate
     
    Methods inherited from interface org.jCharts.chartData.interfaces.IDataSet
    getChartTypeProperties, getLegendLabel, getNumberOfDataItems, getNumberOfLegendLabels, getPaint
     

    Method Detail

    getValue

    public double getValue(int dataset,
                           int index)
    Returns the value in the data set at the specified position.

    Parameters:
    dataset -
    index -
    Returns:
    double


    jcharts-0.7.5/javadocs/org/jCharts/chartData/interfaces/IAxisDataSeries.html0000644000175000001440000003651707751071400026074 0ustar onkarusers IAxisDataSeries (jCharts-0.7.5 API)

    org.jCharts.chartData.interfaces
    Interface IAxisDataSeries

    All Superinterfaces:
    IData, java.io.Serializable
    All Known Subinterfaces:
    IDataSeries, IScatterPlotDataSeries
    All Known Implementing Classes:
    AxisDataSeries, DataSeries, ScatterPlotDataSeries

    public interface IAxisDataSeries
    extends IData


    Method Summary
     void addIAxisPlotDataSet(IAxisPlotDataSet iAxisPlotDataSet)
               
     java.lang.String getChartTitle()
              Returns the chart title.
     IAxisPlotDataSet getIAxisPlotDataSet(ChartType chartType)
               
     java.util.Iterator getIAxisPlotDataSetIterator()
               
     int getTotalNumberOfDataSets()
              Returns the total number data dimensions in all of the IAxisChartDataSets contained in this collection.
     java.lang.String getXAxisTitle()
              Returns the x-axis title.
     java.lang.String getYAxisTitle()
              Returns the y-axis title.
     int size()
              Returns the number of IAxisPlotDataSet Objects in this series
     void validate()
              Validates the DataSeries implementation.
     

    Method Detail

    getXAxisTitle

    public java.lang.String getXAxisTitle()
    Returns the x-axis title.

    Returns:
    String the x-axis title. If this returns NULL, no title will be displayed.

    getYAxisTitle

    public java.lang.String getYAxisTitle()
    Returns the y-axis title.

    Returns:
    String the y-axis title. If this returns NULL, no title will be displayed.

    getChartTitle

    public java.lang.String getChartTitle()
    Returns the chart title.

    Returns:
    String the chart title. If this returns NULL, no title will be displayed.

    validate

    public void validate()
                  throws ChartDataException,
                         PropertyException
    Validates the DataSeries implementation. This will only get called if the ChartProperties flag to validate is true.

    Throws:
    ChartDataException
    PropertyException
    Since:
    0.7.0
    See Also:
    ChartProperties.setValidate( boolean )

    getIAxisPlotDataSetIterator

    public java.util.Iterator getIAxisPlotDataSetIterator()

    addIAxisPlotDataSet

    public void addIAxisPlotDataSet(IAxisPlotDataSet iAxisPlotDataSet)

    getIAxisPlotDataSet

    public IAxisPlotDataSet getIAxisPlotDataSet(ChartType chartType)

    getTotalNumberOfDataSets

    public int getTotalNumberOfDataSets()
    Returns the total number data dimensions in all of the IAxisChartDataSets contained in this collection. For example, if this contains two IAxisChartDataSets and each one contains 3 dimensions ( 3 lines and 3 sets of points ), this should return six. This provides a means to avoid looping the contents of the series each time i need the value.

    Returns:
    int

    size

    public int size()
    Returns the number of IAxisPlotDataSet Objects in this series

    Returns:
    int


    jcharts-0.7.5/javadocs/org/jCharts/chartData/interfaces/IAxisPlotDataSet.html0000644000175000001440000002676607751071400026241 0ustar onkarusers IAxisPlotDataSet (jCharts-0.7.5 API)

    org.jCharts.chartData.interfaces
    Interface IAxisPlotDataSet

    All Superinterfaces:
    IData, IDataSet, java.io.Serializable
    All Known Subinterfaces:
    IAxisChartDataSet, IScatterPlotDataSet, IStockChartDataSet
    All Known Implementing Classes:
    AxisChartDataSet, ScatterPlotDataSet, StockChartDataSet

    public interface IAxisPlotDataSet
    extends IDataSet


    Method Summary
     ChartType getChartType()
              Returns the type of chart this data is to be plotted on
     int getNumberOfDataSets()
              Returns the number of data sets contained in this Object.
     void validate()
              Allows validations to be performed on the data structures
     
    Methods inherited from interface org.jCharts.chartData.interfaces.IDataSet
    getChartTypeProperties, getLegendLabel, getNumberOfDataItems, getNumberOfLegendLabels, getPaint
     

    Method Detail

    getChartType

    public ChartType getChartType()
    Returns the type of chart this data is to be plotted on

    Returns:
    ChartType

    getNumberOfDataSets

    public int getNumberOfDataSets()
    Returns the number of data sets contained in this Object.

    Returns:
    int

    validate

    public void validate()
                  throws ChartDataException,
                         PropertyException
    Allows validations to be performed on the data structures

    Throws:
    ChartDataException
    PropertyException


    jcharts-0.7.5/javadocs/org/jCharts/chartData/interfaces/IData.html0000644000175000001440000002007507751071400024064 0ustar onkarusers IData (jCharts-0.7.5 API)

    org.jCharts.chartData.interfaces
    Interface IData

    All Superinterfaces:
    java.io.Serializable
    All Known Subinterfaces:
    IAxisChartDataSet, IAxisDataSeries, IAxisPlotDataSet, IDataSeries, IDataSet, IPieChartDataSet, IScatterPlotDataSeries, IScatterPlotDataSet, IStockChartDataSet
    All Known Implementing Classes:
    AxisChartDataSet, AxisDataSeries, DataSeries, DataSet, PieChartDataSet, ScatterPlotDataSeries, ScatterPlotDataSet, StockChartDataSet

    public interface IData
    extends java.io.Serializable

    Provides a common base class for all data structures.




    jcharts-0.7.5/javadocs/org/jCharts/chartData/interfaces/IDataSeries.html0000644000175000001440000002454107751071400025241 0ustar onkarusers IDataSeries (jCharts-0.7.5 API)

    org.jCharts.chartData.interfaces
    Interface IDataSeries

    All Superinterfaces:
    IAxisDataSeries, IData, java.io.Serializable
    All Known Implementing Classes:
    DataSeries

    public interface IDataSeries
    extends IAxisDataSeries


    Method Summary
     java.lang.String getAxisLabel(int index)
              Returns the axis label at the specified index.
     int getNumberOfAxisLabels()
              Returns the number of labels on the x-axis
     
    Methods inherited from interface org.jCharts.chartData.interfaces.IAxisDataSeries
    addIAxisPlotDataSet, getChartTitle, getIAxisPlotDataSet, getIAxisPlotDataSetIterator, getTotalNumberOfDataSets, getXAxisTitle, getYAxisTitle, size, validate
     

    Method Detail

    getNumberOfAxisLabels

    public int getNumberOfAxisLabels()
    Returns the number of labels on the x-axis

    Returns:
    int

    getAxisLabel

    public java.lang.String getAxisLabel(int index)
    Returns the axis label at the specified index.

    Parameters:
    index -
    Returns:
    String the x-axis label


    jcharts-0.7.5/javadocs/org/jCharts/chartData/interfaces/IDataSet.html0000644000175000001440000003031107751071400024532 0ustar onkarusers IDataSet (jCharts-0.7.5 API)

    org.jCharts.chartData.interfaces
    Interface IDataSet

    All Superinterfaces:
    IData, java.io.Serializable
    All Known Subinterfaces:
    IAxisChartDataSet, IAxisPlotDataSet, IPieChartDataSet, IScatterPlotDataSet, IStockChartDataSet
    All Known Implementing Classes:
    AxisChartDataSet, DataSet, PieChartDataSet, ScatterPlotDataSet, StockChartDataSet

    public interface IDataSet
    extends IData


    Method Summary
     ChartTypeProperties getChartTypeProperties()
              Returns ChartTypeProperties Object for the data set which will be typed into the specific chart type class.
     java.lang.String getLegendLabel(int index)
              Returns the Legend Label for the passed index.
     int getNumberOfDataItems()
              Returns the number of elements in the data set.
     int getNumberOfLegendLabels()
              Returns the number of legend labels in the data set.
     java.awt.Paint getPaint(int index)
              Returns the Paint Object for the passed index.
     

    Method Detail

    getPaint

    public java.awt.Paint getPaint(int index)
    Returns the Paint Object for the passed index. This index corresponds to the DataSet for which Paint you want.

    Parameters:
    index -
    Returns:
    Paint

    getChartTypeProperties

    public ChartTypeProperties getChartTypeProperties()
    Returns ChartTypeProperties Object for the data set which will be typed into the specific chart type class.

    Returns:
    ChartTypeProperties

    getLegendLabel

    public java.lang.String getLegendLabel(int index)
    Returns the Legend Label for the passed index. This index corresponds to the DataSet for which Label you want.

    Parameters:
    index -
    Returns:
    String should return NULL of no labels specified

    getNumberOfDataItems

    public int getNumberOfDataItems()
    Returns the number of elements in the data set.

    Returns:
    int

    getNumberOfLegendLabels

    public int getNumberOfLegendLabels()
    Returns the number of legend labels in the data set.

    Returns:
    int should return 0 if no labels specified


    jcharts-0.7.5/javadocs/org/jCharts/chartData/interfaces/IPieChartDataSet.html0000644000175000001440000002353607751071400026165 0ustar onkarusers IPieChartDataSet (jCharts-0.7.5 API)

    org.jCharts.chartData.interfaces
    Interface IPieChartDataSet

    All Superinterfaces:
    IData, IDataSet, java.io.Serializable
    All Known Implementing Classes:
    PieChartDataSet

    public interface IPieChartDataSet
    extends IDataSet


    Method Summary
     java.lang.String getChartTitle()
              Returns the chart title.
     double getValue(int index)
              Returns the value in the data set at the specified position.
     
    Methods inherited from interface org.jCharts.chartData.interfaces.IDataSet
    getChartTypeProperties, getLegendLabel, getNumberOfDataItems, getNumberOfLegendLabels, getPaint
     

    Method Detail

    getValue

    public double getValue(int index)
    Returns the value in the data set at the specified position.

    Parameters:
    index -
    Returns:
    double

    getChartTitle

    public java.lang.String getChartTitle()
    Returns the chart title.

    Returns:
    String the chart title. If this returns NULL, no title will be displayed.


    jcharts-0.7.5/javadocs/org/jCharts/chartData/interfaces/IScatterPlotDataSeries.html0000644000175000001440000002073707751071400027431 0ustar onkarusers IScatterPlotDataSeries (jCharts-0.7.5 API)

    org.jCharts.chartData.interfaces
    Interface IScatterPlotDataSeries

    All Superinterfaces:
    IAxisDataSeries, IData, java.io.Serializable
    All Known Implementing Classes:
    ScatterPlotDataSeries

    public interface IScatterPlotDataSeries
    extends IAxisDataSeries


    Methods inherited from interface org.jCharts.chartData.interfaces.IAxisDataSeries
    addIAxisPlotDataSet, getChartTitle, getIAxisPlotDataSet, getIAxisPlotDataSetIterator, getTotalNumberOfDataSets, getXAxisTitle, getYAxisTitle, size, validate
     



    jcharts-0.7.5/javadocs/org/jCharts/chartData/interfaces/IScatterPlotDataSet.html0000644000175000001440000002444507751071400026732 0ustar onkarusers IScatterPlotDataSet (jCharts-0.7.5 API)

    org.jCharts.chartData.interfaces
    Interface IScatterPlotDataSet

    All Superinterfaces:
    IAxisPlotDataSet, IData, IDataSet, java.io.Serializable
    All Known Implementing Classes:
    ScatterPlotDataSet

    public interface IScatterPlotDataSet
    extends IAxisPlotDataSet


    Method Summary
     java.awt.geom.Point2D.Double getValue(int dataset, int index)
              Returns the value in the data set at the specified position.
     
    Methods inherited from interface org.jCharts.chartData.interfaces.IAxisPlotDataSet
    getChartType, getNumberOfDataSets, validate
     
    Methods inherited from interface org.jCharts.chartData.interfaces.IDataSet
    getChartTypeProperties, getLegendLabel, getNumberOfDataItems, getNumberOfLegendLabels, getPaint
     

    Method Detail

    getValue

    public java.awt.geom.Point2D.Double getValue(int dataset,
                                                 int index)
    Returns the value in the data set at the specified position.

    Parameters:
    dataset -
    index -
    Returns:
    Point.Double


    jcharts-0.7.5/javadocs/org/jCharts/chartData/interfaces/IStockChartDataSet.html0000644000175000001440000003347507751071400026536 0ustar onkarusers IStockChartDataSet (jCharts-0.7.5 API)

    org.jCharts.chartData.interfaces
    Interface IStockChartDataSet

    All Superinterfaces:
    IAxisPlotDataSet, IData, IDataSet, java.io.Serializable
    All Known Implementing Classes:
    StockChartDataSet

    public interface IStockChartDataSet
    extends IAxisPlotDataSet


    Method Summary
     ChartType getChartType()
              Returns the type of chart this data is to be plotted on
     double getCloseValue(int index)
               
     double getHighValue(int index)
               
     double getLowValue(int index)
               
     double getOpenValue(int index)
               
     boolean hasCloseValues()
               
     boolean hasOpenValues()
               
     
    Methods inherited from interface org.jCharts.chartData.interfaces.IAxisPlotDataSet
    getNumberOfDataSets, validate
     
    Methods inherited from interface org.jCharts.chartData.interfaces.IDataSet
    getChartTypeProperties, getLegendLabel, getNumberOfDataItems, getNumberOfLegendLabels, getPaint
     

    Method Detail

    getChartType

    public ChartType getChartType()
    Returns the type of chart this data is to be plotted on

    Specified by:
    getChartType in interface IAxisPlotDataSet
    Returns:
    ChartType

    getHighValue

    public double getHighValue(int index)
    Parameters:
    index -
    Returns:
    double

    getLowValue

    public double getLowValue(int index)
    Parameters:
    index -
    Returns:
    double

    getCloseValue

    public double getCloseValue(int index)
    Parameters:
    index -
    Returns:
    double

    hasCloseValues

    public boolean hasCloseValues()

    getOpenValue

    public double getOpenValue(int index)
    Parameters:
    index -
    Returns:
    double

    hasOpenValues

    public boolean hasOpenValues()


    jcharts-0.7.5/javadocs/org/jCharts/chartData/interfaces/package-frame.html0000644000175000001440000000345307751071376025602 0ustar onkarusers org.jCharts.chartData.interfaces (jCharts-0.7.5 API) org.jCharts.chartData.interfaces
    Interfaces 
    IAxisChartDataSet
    IAxisDataSeries
    IAxisPlotDataSet
    IData
    IDataSeries
    IDataSet
    IPieChartDataSet
    IScatterPlotDataSeries
    IScatterPlotDataSet
    IStockChartDataSet
    jcharts-0.7.5/javadocs/org/jCharts/chartData/interfaces/package-summary.html0000644000175000001440000001554707751071376026214 0ustar onkarusers org.jCharts.chartData.interfaces (jCharts-0.7.5 API)

    Package org.jCharts.chartData.interfaces

    Interface Summary
    IAxisChartDataSet  
    IAxisDataSeries  
    IAxisPlotDataSet  
    IData Provides a common base class for all data structures.
    IDataSeries  
    IDataSet  
    IPieChartDataSet  
    IScatterPlotDataSeries  
    IScatterPlotDataSet  
    IStockChartDataSet  
     



    jcharts-0.7.5/javadocs/org/jCharts/chartData/interfaces/package-tree.html0000644000175000001440000001561107751071376025446 0ustar onkarusers org.jCharts.chartData.interfaces Class Hierarchy (jCharts-0.7.5 API)

    Hierarchy For Package org.jCharts.chartData.interfaces

    Package Hierarchies:
    All Packages

    Interface Hierarchy



    jcharts-0.7.5/javadocs/org/jCharts/chartData/processors/0000755000175000001440000000000007751071404022273 5ustar onkarusersjcharts-0.7.5/javadocs/org/jCharts/chartData/processors/AxisChartDataProcessor.html0000644000175000001440000003703007751071400027540 0ustar onkarusers AxisChartDataProcessor (jCharts-0.7.5 API)

    org.jCharts.chartData.processors
    Class AxisChartDataProcessor

    java.lang.Object
      |
      +--org.jCharts.chartData.processors.AxisChartDataProcessor
    
    Direct Known Subclasses:
    ScatterPlotDataProcessor

    public class AxisChartDataProcessor
    extends java.lang.Object


    Field Summary
    private  double max
               
    private  double min
               
    private  int numberOfElementsInADataSet
               
     
    Constructor Summary
    AxisChartDataProcessor()
              Constructor
     
    Method Summary
     double getMaxValue()
               
     double getMinValue()
               
     int getNumberOfElementsInADataSet()
               
     void processData(AxisChart axisChart, java.awt.font.FontRenderContext fontRenderContext)
              Method to perform all chart data processing.
    private  void processDataSet(IDataSeries iDataSeries)
              Processes the numeric values in the chart data.
    (package private)  void setMaxValue(double max)
               
    (package private)  void setMinValue(double min)
               
     
    Methods inherited from class java.lang.Object
    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
     

    Field Detail

    max

    private double max

    min

    private double min

    numberOfElementsInADataSet

    private int numberOfElementsInADataSet
    Constructor Detail

    AxisChartDataProcessor

    public AxisChartDataProcessor()
    Constructor

    Method Detail

    processData

    public void processData(AxisChart axisChart,
                            java.awt.font.FontRenderContext fontRenderContext)
    Method to perform all chart data processing.

    Parameters:
    axisChart -

    processDataSet

    private void processDataSet(IDataSeries iDataSeries)
    Processes the numeric values in the chart data. If there is a user defined scale there is no need to call this.

    Parameters:
    iDataSeries -

    setMaxValue

    void setMaxValue(double max)

    getMaxValue

    public double getMaxValue()

    setMinValue

    void setMinValue(double min)

    getMinValue

    public double getMinValue()

    getNumberOfElementsInADataSet

    public int getNumberOfElementsInADataSet()


    jcharts-0.7.5/javadocs/org/jCharts/chartData/processors/NonStackedDataProcessor.html0000644000175000001440000002455607751071400027714 0ustar onkarusers NonStackedDataProcessor (jCharts-0.7.5 API)

    org.jCharts.chartData.processors
    Class NonStackedDataProcessor

    java.lang.Object
      |
      +--org.jCharts.chartData.processors.NonStackedDataProcessor
    

    abstract class NonStackedDataProcessor
    extends java.lang.Object


    Constructor Summary
    (package private) NonStackedDataProcessor()
               
     
    Method Summary
    static void processData(IAxisChartDataSet iAxisChartDataSet, AxisChartDataProcessor axisChartDataProcessor)
              Does a single pass through the data set and calculates the min, max, and label dimensions.
     
    Methods inherited from class java.lang.Object
    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
     

    Constructor Detail

    NonStackedDataProcessor

    NonStackedDataProcessor()
    Method Detail

    processData

    public static final void processData(IAxisChartDataSet iAxisChartDataSet,
                                         AxisChartDataProcessor axisChartDataProcessor)
    Does a single pass through the data set and calculates the min, max, and label dimensions. This stuff is grouped together so we can try to limit the number of passes through the data.

    Parameters:
    iAxisChartDataSet -
    axisChartDataProcessor -


    jcharts-0.7.5/javadocs/org/jCharts/chartData/processors/package-frame.html0000644000175000001440000000310607751071376025654 0ustar onkarusers org.jCharts.chartData.processors (jCharts-0.7.5 API) org.jCharts.chartData.processors
    Classes 
    AxisChartDataProcessor
    NonStackedDataProcessor
    PieChartDataProcessor
    ScatterPlotDataProcessor
    StackedDataProcessor
    StockDataProcessor
    TextProcessor
    jcharts-0.7.5/javadocs/org/jCharts/chartData/processors/package-summary.html0000644000175000001440000001503507751071376026263 0ustar onkarusers org.jCharts.chartData.processors (jCharts-0.7.5 API)

    Package org.jCharts.chartData.processors

    Class Summary
    AxisChartDataProcessor  
    NonStackedDataProcessor  
    PieChartDataProcessor Utility class to process the PieChartDataSet
    ScatterPlotDataProcessor  
    StackedDataProcessor Notes: 1) Stacked data cannot have any negative values.
    StockDataProcessor Custom processor for the Stock Chart as data is semi-processed by default.
    TextProcessor  
     



    jcharts-0.7.5/javadocs/org/jCharts/chartData/processors/package-tree.html0000644000175000001440000001463707751071376025534 0ustar onkarusers org.jCharts.chartData.processors Class Hierarchy (jCharts-0.7.5 API)

    Hierarchy For Package org.jCharts.chartData.processors

    Package Hierarchies:
    All Packages

    Class Hierarchy



    jcharts-0.7.5/javadocs/org/jCharts/chartData/processors/PieChartDataProcessor.html0000644000175000001440000003067407751071400027360 0ustar onkarusers PieChartDataProcessor (jCharts-0.7.5 API)

    org.jCharts.chartData.processors
    Class PieChartDataProcessor

    java.lang.Object
      |
      +--org.jCharts.chartData.processors.PieChartDataProcessor
    

    public final class PieChartDataProcessor
    extends java.lang.Object

    Utility class to process the PieChartDataSet


    Field Summary
    private  IPieChartDataSet iPieChartDataSet
               
    private  double sumOfData
               
     
    Constructor Summary
    PieChartDataProcessor(IPieChartDataSet iPieChartDataSet)
              Constructor
     
    Method Summary
     double getPercentageOfPie(int index)
              Returns percentage of pie(360 degrees) data point at specified index.
     void processData()
              This method should do a single pass through the data set and calculate all needed values, such as: min, max, sum, etc...
     
    Methods inherited from class java.lang.Object
    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
     

    Field Detail

    iPieChartDataSet

    private IPieChartDataSet iPieChartDataSet

    sumOfData

    private double sumOfData
    Constructor Detail

    PieChartDataProcessor

    public PieChartDataProcessor(IPieChartDataSet iPieChartDataSet)
    Constructor

    Parameters:
    iPieChartDataSet -
    Method Detail

    processData

    public void processData()
    This method should do a single pass through the data set and calculate all needed values, such as: min, max, sum, etc... so that we can do this in one pass through the data. Rather than once for each.


    getPercentageOfPie

    public double getPercentageOfPie(int index)
    Returns percentage of pie(360 degrees) data point at specified index.

    Parameters:
    index -
    Returns:
    double


    jcharts-0.7.5/javadocs/org/jCharts/chartData/processors/ScatterPlotDataProcessor.html0000644000175000001440000004241107751071400030115 0ustar onkarusers ScatterPlotDataProcessor (jCharts-0.7.5 API)

    org.jCharts.chartData.processors
    Class ScatterPlotDataProcessor

    java.lang.Object
      |
      +--org.jCharts.chartData.processors.AxisChartDataProcessor
            |
            +--org.jCharts.chartData.processors.ScatterPlotDataProcessor
    

    public final class ScatterPlotDataProcessor
    extends AxisChartDataProcessor


    Field Summary
    private  double yMax
               
    private  double yMin
               
     
    Fields inherited from class org.jCharts.chartData.processors.AxisChartDataProcessor
     
    Constructor Summary
    ScatterPlotDataProcessor()
              Constructor
     
    Method Summary
     double getyMax()
               
     double getyMin()
               
     void processData(AxisChart axisChart, java.awt.font.FontRenderContext fontRenderContext)
              Method to perform all chart data processing.
    private  void processDataSet(IScatterPlotDataSeries iScatterPlotDataSeries)
              Processes the numeric values in the chart data.
     void setyMax(double yMax)
               
     void setyMin(double yMin)
               
     java.lang.String toString()
               
     
    Methods inherited from class org.jCharts.chartData.processors.AxisChartDataProcessor
    getMaxValue, getMinValue, getNumberOfElementsInADataSet, setMaxValue, setMinValue
     
    Methods inherited from class java.lang.Object
    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
     

    Field Detail

    yMax

    private double yMax

    yMin

    private double yMin
    Constructor Detail

    ScatterPlotDataProcessor

    public ScatterPlotDataProcessor()
    Constructor

    Method Detail

    processData

    public void processData(AxisChart axisChart,
                            java.awt.font.FontRenderContext fontRenderContext)
    Method to perform all chart data processing.

    Overrides:
    processData in class AxisChartDataProcessor
    Parameters:
    axisChart -

    processDataSet

    private void processDataSet(IScatterPlotDataSeries iScatterPlotDataSeries)
    Processes the numeric values in the chart data. If there is a user defined scale there is no need to call this.

    Parameters:
    iScatterPlotDataSeries -

    getyMax

    public double getyMax()

    setyMax

    public void setyMax(double yMax)

    getyMin

    public double getyMin()

    setyMin

    public void setyMin(double yMin)

    toString

    public java.lang.String toString()
    Overrides:
    toString in class java.lang.Object


    jcharts-0.7.5/javadocs/org/jCharts/chartData/processors/StackedDataProcessor.html0000644000175000001440000002515007751071400027230 0ustar onkarusers StackedDataProcessor (jCharts-0.7.5 API)

    org.jCharts.chartData.processors
    Class StackedDataProcessor

    java.lang.Object
      |
      +--org.jCharts.chartData.processors.StackedDataProcessor
    

    abstract class StackedDataProcessor
    extends java.lang.Object

    Notes: 1) Stacked data cannot have any negative values. I don't think i have ever seen a stacked bar chart with negative values just as a side observation. ---->There has been one request for this though...


    Constructor Summary
    (package private) StackedDataProcessor()
               
     
    Method Summary
    static void processData(IAxisChartDataSet iAxisChartDataSet, AxisChartDataProcessor axisChartDataProcessor)
              This method should do a single pass through the data set and calculate all needed values, such as: min, max, sum, etc...
     
    Methods inherited from class java.lang.Object
    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
     

    Constructor Detail

    StackedDataProcessor

    StackedDataProcessor()
    Method Detail

    processData

    public static final void processData(IAxisChartDataSet iAxisChartDataSet,
                                         AxisChartDataProcessor axisChartDataProcessor)
    This method should do a single pass through the data set and calculate all needed values,
      such as: min, max, sum, etc... so that we can do this in one pass through the data.
      Rather than once for each.

    Parameters:
    iAxisChartDataSet -
    axisChartDataProcessor -


    jcharts-0.7.5/javadocs/org/jCharts/chartData/processors/StockDataProcessor.html0000644000175000001440000002434407751071400026741 0ustar onkarusers StockDataProcessor (jCharts-0.7.5 API)

    org.jCharts.chartData.processors
    Class StockDataProcessor

    java.lang.Object
      |
      +--org.jCharts.chartData.processors.StockDataProcessor
    

    abstract class StockDataProcessor
    extends java.lang.Object

    Custom processor for the Stock Chart as data is semi-processed by default.


    Constructor Summary
    (package private) StockDataProcessor()
               
     
    Method Summary
    static void processData(IStockChartDataSet iStockChartDataSet, AxisChartDataProcessor axisChartDataProcessor)
              Only need to loop through the 'high' to find MAX and 'low' to find MIN.
     
    Methods inherited from class java.lang.Object
    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
     

    Constructor Detail

    StockDataProcessor

    StockDataProcessor()
    Method Detail

    processData

    public static final void processData(IStockChartDataSet iStockChartDataSet,
                                         AxisChartDataProcessor axisChartDataProcessor)
    Only need to loop through the 'high' to find MAX and 'low' to find MIN.

    Parameters:
    iStockChartDataSet -
    axisChartDataProcessor -


    jcharts-0.7.5/javadocs/org/jCharts/chartData/processors/TextProcessor.html0000644000175000001440000004233107751071400026004 0ustar onkarusers TextProcessor (jCharts-0.7.5 API)

    org.jCharts.chartData.processors
    Class TextProcessor

    java.lang.Object
      |
      +--org.jCharts.chartData.processors.TextProcessor
    

    public class TextProcessor
    extends java.lang.Object


    Field Summary
    private  float tallestLabel
               
    private  java.util.ArrayList textTags
               
    private  float totalLabelWidths
               
    private  float widestLabel
               
     
    Constructor Summary
    TextProcessor()
              Constructor
     
    Method Summary
     void addLabel(java.lang.String label, java.awt.Font font, java.awt.font.FontRenderContext fontRenderContext)
               
     float getTallestLabel()
               
     TextTag getTextTag(int index)
               
     float getTotalLabelWidths()
               
     float getWidestLabel()
              Calculates the width and height needed by the passed String when rendered // * @param iDataSeries / * @param font // * @param fontRenderContext public void processLabels( IDataSeries iDataSeries) { //LOOP for( int i = 0; i < iDataSeries.getNumberOfXAxisLabels(); i++ ) { this.axisLabelProcessor.processLabel( iDataSeries.getXAxisLabel( i ), axisLabelFont, fontRenderContext ); } TextLayout textLayout = new TextLayout( label, font, fontRenderContext ); //---WIDTH this.labelWidths[ counter ] = textLayout.getAdvance(); this.widestLabel = Math.max( this.labelWidths[ counter ], this.widestLabel ); this.totalLabelWidths += this.labelWidths[ counter ]; //---HEIGHT this.labelHeights[ counter ] = textLayout.getAscent() + textLayout.getDescent(); this.tallestLabel = Math.max( this.labelHeights[ counter ], this.tallestLabel ); //---need this to offset font rendering, as rendering is at the baseline not bottom or top, this.fontDescent = textLayout.getDescent(); this.counter++; } /******************************************************************************************
     int size()
              Returns the number of labels
     
    Methods inherited from class java.lang.Object
    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
     

    Field Detail

    widestLabel

    private float widestLabel

    tallestLabel

    private float tallestLabel

    totalLabelWidths

    private float totalLabelWidths

    textTags

    private java.util.ArrayList textTags
    Constructor Detail

    TextProcessor

    public TextProcessor()
    Constructor

    Method Detail

    addLabel

    public void addLabel(java.lang.String label,
                         java.awt.Font font,
                         java.awt.font.FontRenderContext fontRenderContext)
    Parameters:
    label -
    font -
    fontRenderContext -

    size

    public int size()
    Returns the number of labels

    Returns:
    int

    getWidestLabel

    public float getWidestLabel()
    Calculates the width and height needed by the passed String when rendered // * @param iDataSeries / * @param font // * @param fontRenderContext public void processLabels( IDataSeries iDataSeries) { //LOOP for( int i = 0; i < iDataSeries.getNumberOfXAxisLabels(); i++ ) { this.axisLabelProcessor.processLabel( iDataSeries.getXAxisLabel( i ), axisLabelFont, fontRenderContext ); } TextLayout textLayout = new TextLayout( label, font, fontRenderContext ); //---WIDTH this.labelWidths[ counter ] = textLayout.getAdvance(); this.widestLabel = Math.max( this.labelWidths[ counter ], this.widestLabel ); this.totalLabelWidths += this.labelWidths[ counter ]; //---HEIGHT this.labelHeights[ counter ] = textLayout.getAscent() + textLayout.getDescent(); this.tallestLabel = Math.max( this.labelHeights[ counter ], this.tallestLabel ); //---need this to offset font rendering, as rendering is at the baseline not bottom or top, this.fontDescent = textLayout.getDescent(); this.counter++; } /******************************************************************************************


    getTallestLabel

    public float getTallestLabel()

    getTotalLabelWidths

    public float getTotalLabelWidths()

    getTextTag

    public TextTag getTextTag(int index)
    Parameters:
    index -
    Returns:
    TextTag


    jcharts-0.7.5/javadocs/org/jCharts/chartData/AxisChartDataSet.html0000644000175000001440000005157307751071400024122 0ustar onkarusers AxisChartDataSet (jCharts-0.7.5 API)

    org.jCharts.chartData
    Class AxisChartDataSet

    java.lang.Object
      |
      +--org.jCharts.chartData.DataSet
            |
            +--org.jCharts.chartData.AxisChartDataSet
    
    All Implemented Interfaces:
    HTMLTestable, IAxisChartDataSet, IAxisPlotDataSet, IData, IDataSet, java.io.Serializable

    public final class AxisChartDataSet
    extends DataSet
    implements IAxisChartDataSet, HTMLTestable

    See Also:
    Serialized Form

    Field Summary
    private  ChartType chartType
               
     
    Fields inherited from class org.jCharts.chartData.DataSet
    data, legendLabels, paints
     
    Constructor Summary
    AxisChartDataSet(double[][] data, java.lang.String[] legendLabels, java.awt.Paint[] paints, ChartType chartType, ChartTypeProperties chartTypeProperties)
              Constructor
     
    Method Summary
     ChartType getChartType()
              Returns the type constant that this data set should be plotted as.
     int getNumberOfDataSets()
              Returns the number of IAxisChartDataSet Objects in this series
     double getValue(int dataset, int index)
              Returns the value in the data set at the specified position.
     void toHTML(HTMLGenerator htmlGenerator)
              Enables the testing routines to display the contents of this Object.
     void validate()
              Performs a limited validation of data.
     
    Methods inherited from class org.jCharts.chartData.DataSet
    getChartTypeProperties, getLegendLabel, getNumberOfDataItems, getNumberOfLegendLabels, getPaint
     
    Methods inherited from class java.lang.Object
    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
     
    Methods inherited from interface org.jCharts.chartData.interfaces.IDataSet
    getChartTypeProperties, getLegendLabel, getNumberOfDataItems, getNumberOfLegendLabels, getPaint
     

    Field Detail

    chartType

    private ChartType chartType
    Constructor Detail

    AxisChartDataSet

    public AxisChartDataSet(double[][] data,
                            java.lang.String[] legendLabels,
                            java.awt.Paint[] paints,
                            ChartType chartType,
                            ChartTypeProperties chartTypeProperties)
                     throws ChartDataException
    Constructor

    Parameters:
    data - the data sets to be displayed in the chart.
    legendLabels - if this is: NULL there will be no Legend. Otherwise, there must be an one to one mapping of labels to data sets.
    paints - paints to use for the data sets. There must be an one to one mapping of labels to data sets.
    chartType - constant defining how this data should be rendered
    chartTypeProperties - properties Object specific to the type of chart you are rendering.
    Throws:
    ChartDataException - if data is not in correct form.
    Method Detail

    validate

    public void validate()
                  throws ChartDataException,
                         PropertyException
    Performs a limited validation of data. This is static and not called by the rendering engine so as to avoid the, albeit small, cost of validation checking during deployment; this is viewed more so as a development time test.

    Specified by:
    validate in interface IAxisPlotDataSet
    Throws:
    ChartDataException
    PropertyException

    getValue

    public final double getValue(int dataset,
                                 int index)
                          throws java.lang.ArrayIndexOutOfBoundsException
    Returns the value in the data set at the specified position.

    Specified by:
    getValue in interface IAxisChartDataSet
    Parameters:
    dataset -
    index -
    Returns:
    double
    Throws:
    java.lang.ArrayIndexOutOfBoundsException

    getChartType

    public final ChartType getChartType()
    Returns the type constant that this data set should be plotted as.

    Specified by:
    getChartType in interface IAxisPlotDataSet
    Returns:
    ChartType
    See Also:
    ChartType

    getNumberOfDataSets

    public final int getNumberOfDataSets()
    Returns the number of IAxisChartDataSet Objects in this series

    Specified by:
    getNumberOfDataSets in interface IAxisPlotDataSet
    Returns:
    int

    toHTML

    public void toHTML(HTMLGenerator htmlGenerator)
    Enables the testing routines to display the contents of this Object.

    Specified by:
    toHTML in interface HTMLTestable
    Overrides:
    toHTML in class DataSet
    Parameters:
    htmlGenerator -


    jcharts-0.7.5/javadocs/org/jCharts/chartData/AxisDataSeries.html0000644000175000001440000006423307751071400023634 0ustar onkarusers AxisDataSeries (jCharts-0.7.5 API)

    org.jCharts.chartData
    Class AxisDataSeries

    java.lang.Object
      |
      +--org.jCharts.chartData.AxisDataSeries
    
    All Implemented Interfaces:
    HTMLTestable, IAxisDataSeries, IData, java.io.Serializable
    Direct Known Subclasses:
    DataSeries, ScatterPlotDataSeries

    public abstract class AxisDataSeries
    extends java.lang.Object
    implements IAxisDataSeries, HTMLTestable

    Collection of all IAxisChartDataSets to display in an AxisChart

    See Also:
    Serialized Form

    Field Summary
    private  java.lang.String chartTitle
               
    protected  java.util.HashMap dataSets
               
    private  int sizeOfEachDataSet
               
    protected  int totalNumberOfDataSets
               
    private  java.lang.String xAxisTitle
               
    private  java.lang.String yAxisTitle
               
     
    Constructor Summary
    AxisDataSeries(java.lang.String xAxisTitle, java.lang.String yAxisTitle, java.lang.String chartTitle)
              Constructor
     
    Method Summary
     void addIAxisPlotDataSet(IAxisPlotDataSet iAxisPlotDataSet)
              Adds the passed IAxisPlotDataSet to the series
     java.lang.String getChartTitle()
              Returns the chart title.
     IAxisPlotDataSet getIAxisPlotDataSet(ChartType chartType)
              Returns the IAxisPlotDataSet for the passed chart type constant.
     java.util.Iterator getIAxisPlotDataSetIterator()
              Returns an Iterator over a List of IAxisPlotDataSet Objects
     int getSizeOfEachDataSet()
              Returns number of elements in each data set dimension, so i can validate a that all IAxisPlotDataSets on a ComboChart have the same number of elements, as well as the number of Axis Labels equal the number of data elements other charts.
     int getTotalNumberOfDataSets()
              Returns the total number data dimensions in all of the IAxisChartDataSets contained in this collection.
     java.lang.String getXAxisTitle()
              Returns the x-axis title
     java.lang.String getYAxisTitle()
              Returns the y-axis title
     int size()
              Returns the number of IAxisPlotDataSet Objects in this series
     void toHTML(HTMLGenerator htmlGenerator)
              Enables the testing routines to display the contents of this Object.
     void validate()
              Validates the DataSeries implementation.
     
    Methods inherited from class java.lang.Object
    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
     

    Field Detail

    chartTitle

    private java.lang.String chartTitle

    xAxisTitle

    private java.lang.String xAxisTitle

    yAxisTitle

    private java.lang.String yAxisTitle

    dataSets

    protected java.util.HashMap dataSets

    totalNumberOfDataSets

    protected int totalNumberOfDataSets

    sizeOfEachDataSet

    private int sizeOfEachDataSet
    Constructor Detail

    AxisDataSeries

    public AxisDataSeries(java.lang.String xAxisTitle,
                          java.lang.String yAxisTitle,
                          java.lang.String chartTitle)
    Constructor

    Parameters:
    xAxisTitle - if this is NULL, no title will be displayed
    yAxisTitle - if this is NULL, no title will be displayed
    chartTitle - if this is NULL, no title will be displayed
    Method Detail

    getXAxisTitle

    public java.lang.String getXAxisTitle()
    Returns the x-axis title

    Specified by:
    getXAxisTitle in interface IAxisDataSeries
    Returns:
    String

    getYAxisTitle

    public java.lang.String getYAxisTitle()
    Returns the y-axis title

    Specified by:
    getYAxisTitle in interface IAxisDataSeries
    Returns:
    String

    getChartTitle

    public java.lang.String getChartTitle()
    Returns the chart title.

    Specified by:
    getChartTitle in interface IAxisDataSeries
    Returns:
    String the chart title. If this returns NULL, no title will be displayed.

    getIAxisPlotDataSet

    public IAxisPlotDataSet getIAxisPlotDataSet(ChartType chartType)
    Returns the IAxisPlotDataSet for the passed chart type constant. Will return NULL if if no data set exists for the passed type.

    Specified by:
    getIAxisPlotDataSet in interface IAxisDataSeries
    Parameters:
    chartType -
    Returns:
    IAxisPlotDataSet

    getIAxisPlotDataSetIterator

    public java.util.Iterator getIAxisPlotDataSetIterator()
    Returns an Iterator over a List of IAxisPlotDataSet Objects

    Specified by:
    getIAxisPlotDataSetIterator in interface IAxisDataSeries
    Returns:
    Iterator over a List of IAxisPlotDataSet Objects

    getTotalNumberOfDataSets

    public int getTotalNumberOfDataSets()
    Returns the total number data dimensions in all of the IAxisChartDataSets contained in this collection. For example, if this contains two IAxisChartDataSets and each one contains 3 dimensions ( 3 lines and 3 sets of points ), this should return six. This provides a means to avoid looping the contents of the series each time i need the value.

    Specified by:
    getTotalNumberOfDataSets in interface IAxisDataSeries
    Returns:
    int

    addIAxisPlotDataSet

    public void addIAxisPlotDataSet(IAxisPlotDataSet iAxisPlotDataSet)
    Adds the passed IAxisPlotDataSet to the series

    Specified by:
    addIAxisPlotDataSet in interface IAxisDataSeries
    Parameters:
    iAxisPlotDataSet -

    validate

    public void validate()
                  throws ChartDataException,
                         PropertyException
    Description copied from interface: IAxisDataSeries
    Validates the DataSeries implementation. This will only get called if the ChartProperties flag to validate is true.

    Specified by:
    validate in interface IAxisDataSeries
    Throws:
    ChartDataException
    PropertyException
    See Also:
    ChartProperties.setValidate( boolean )

    getSizeOfEachDataSet

    public int getSizeOfEachDataSet()
    Returns number of elements in each data set dimension, so i can validate a that all IAxisPlotDataSets on a ComboChart have the same number of elements, as well as the number of Axis Labels equal the number of data elements other charts.

    Returns:
    int

    toHTML

    public void toHTML(HTMLGenerator htmlGenerator)
    Enables the testing routines to display the contents of this Object.

    Specified by:
    toHTML in interface HTMLTestable
    Parameters:
    htmlGenerator -

    size

    public int size()
    Returns the number of IAxisPlotDataSet Objects in this series

    Specified by:
    size in interface IAxisDataSeries
    Returns:
    int


    jcharts-0.7.5/javadocs/org/jCharts/chartData/ChartDataException.html0000644000175000001440000002565407751071400024501 0ustar onkarusers ChartDataException (jCharts-0.7.5 API)

    org.jCharts.chartData
    Class ChartDataException

    java.lang.Object
      |
      +--java.lang.Throwable
            |
            +--java.lang.Exception
                  |
                  +--org.jCharts.chartData.ChartDataException
    
    All Implemented Interfaces:
    java.io.Serializable

    public class ChartDataException
    extends java.lang.Exception

    See Also:
    Serialized Form

    Field Summary
    private  java.lang.Throwable throwable
               
     
    Fields inherited from class java.lang.Exception
     
    Fields inherited from class java.lang.Throwable
     
    Constructor Summary
    ChartDataException(java.lang.String message)
               
    ChartDataException(java.lang.String message, java.lang.Throwable throwable)
               
     
    Methods inherited from class java.lang.Throwable
    fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
     
    Methods inherited from class java.lang.Object
    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
     

    Field Detail

    throwable

    private java.lang.Throwable throwable
    Constructor Detail

    ChartDataException

    public ChartDataException(java.lang.String message)

    ChartDataException

    public ChartDataException(java.lang.String message,
                              java.lang.Throwable throwable)


    jcharts-0.7.5/javadocs/org/jCharts/chartData/DataSeries.html0000644000175000001440000004735007751071400023010 0ustar onkarusers DataSeries (jCharts-0.7.5 API)

    org.jCharts.chartData
    Class DataSeries

    java.lang.Object
      |
      +--org.jCharts.chartData.AxisDataSeries
            |
            +--org.jCharts.chartData.DataSeries
    
    All Implemented Interfaces:
    HTMLTestable, IAxisDataSeries, IData, IDataSeries, java.io.Serializable

    public class DataSeries
    extends AxisDataSeries
    implements IDataSeries, HTMLTestable

    Collection of all IAxisPlotDataSets to display in an AxisChart

    See Also:
    Serialized Form

    Field Summary
    private  java.lang.String[] axisLabels
               
     
    Fields inherited from class org.jCharts.chartData.AxisDataSeries
    dataSets, totalNumberOfDataSets
     
    Constructor Summary
    DataSeries(java.lang.String[] axisLabels, java.lang.String xAxisTitle, java.lang.String yAxisTitle, java.lang.String chartTitle)
              Constructor
     
    Method Summary
     java.lang.String getAxisLabel(int index)
              Returns the x-axis label corresponding to the passed index
     int getNumberOfAxisLabels()
              Returns the number of labels on the x-axis
     void toHTML(HTMLGenerator htmlGenerator)
              Enables the testing routines to display the contents of this Object.
     void validate()
              Validates the DataSeries implementation.
     
    Methods inherited from class org.jCharts.chartData.AxisDataSeries
    addIAxisPlotDataSet, getChartTitle, getIAxisPlotDataSet, getIAxisPlotDataSetIterator, getSizeOfEachDataSet, getTotalNumberOfDataSets, getXAxisTitle, getYAxisTitle, size
     
    Methods inherited from class java.lang.Object
    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
     
    Methods inherited from interface org.jCharts.chartData.interfaces.IAxisDataSeries
    addIAxisPlotDataSet, getChartTitle, getIAxisPlotDataSet, getIAxisPlotDataSetIterator, getTotalNumberOfDataSets, getXAxisTitle, getYAxisTitle, size
     

    Field Detail

    axisLabels

    private java.lang.String[] axisLabels
    Constructor Detail

    DataSeries

    public DataSeries(java.lang.String[] axisLabels,
                      java.lang.String xAxisTitle,
                      java.lang.String yAxisTitle,
                      java.lang.String chartTitle)
    Constructor

    Parameters:
    axisLabels -
    xAxisTitle - if this is NULL, no title will be displayed
    yAxisTitle - if this is NULL, no title will be displayed
    chartTitle - if this is NULL, no title will be displayed
    Method Detail

    getAxisLabel

    public java.lang.String getAxisLabel(int index)
    Returns the x-axis label corresponding to the passed index

    Specified by:
    getAxisLabel in interface IDataSeries
    Parameters:
    index -
    Returns:
    String

    getNumberOfAxisLabels

    public int getNumberOfAxisLabels()
    Returns the number of labels on the x-axis

    Specified by:
    getNumberOfAxisLabels in interface IDataSeries
    Returns:
    int

    validate

    public void validate()
                  throws ChartDataException,
                         PropertyException
    Description copied from interface: IAxisDataSeries
    Validates the DataSeries implementation. This will only get called if the ChartProperties flag to validate is true.

    Specified by:
    validate in interface IAxisDataSeries
    Overrides:
    validate in class AxisDataSeries
    Throws:
    ChartDataException
    PropertyException
    See Also:
    ChartProperties.setValidate( boolean )

    toHTML

    public void toHTML(HTMLGenerator htmlGenerator)
    Enables the testing routines to display the contents of this Object.

    Specified by:
    toHTML in interface HTMLTestable
    Overrides:
    toHTML in class AxisDataSeries
    Parameters:
    htmlGenerator -


    jcharts-0.7.5/javadocs/org/jCharts/chartData/DataSet.html0000644000175000001440000004623207751071400022307 0ustar onkarusers DataSet (jCharts-0.7.5 API)

    org.jCharts.chartData
    Class DataSet

    java.lang.Object
      |
      +--org.jCharts.chartData.DataSet
    
    All Implemented Interfaces:
    HTMLTestable, IData, IDataSet, java.io.Serializable
    Direct Known Subclasses:
    AxisChartDataSet, PieChartDataSet

    public class DataSet
    extends java.lang.Object
    implements IDataSet, HTMLTestable

    See Also:
    Serialized Form

    Field Summary
    private  ChartTypeProperties chartTypeProperties
               
    protected  double[][] data
               
    protected  java.lang.String[] legendLabels
               
    protected  java.awt.Paint[] paints
               
     
    Constructor Summary
    DataSet(double[][] data, java.lang.String[] legendLabels, java.awt.Paint[] paints, ChartTypeProperties chartTypeProperties)
              Constructor
     
    Method Summary
     ChartTypeProperties getChartTypeProperties()
              Returns ChartTypeProperties Object for the data set which will be typed into the specific chart type class.
     java.lang.String getLegendLabel(int index)
              Returns the legend label for the passed index.
     int getNumberOfDataItems()
              Returns the number of elements in the data set.
     int getNumberOfLegendLabels()
              Returns the number of Legend Labels to display.
     java.awt.Paint getPaint(int index)
              Returns the legend label for the passed index.
     void toHTML(HTMLGenerator htmlGenerator)
              Enables the testing routines to display the contents of this Object.
     
    Methods inherited from class java.lang.Object
    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
     

    Field Detail

    chartTypeProperties

    private ChartTypeProperties chartTypeProperties

    data

    protected double[][] data

    legendLabels

    protected java.lang.String[] legendLabels

    paints

    protected java.awt.Paint[] paints
    Constructor Detail

    DataSet

    public DataSet(double[][] data,
                   java.lang.String[] legendLabels,
                   java.awt.Paint[] paints,
                   ChartTypeProperties chartTypeProperties)
    Constructor

    Parameters:
    data -
    legendLabels - will be NULL if no Legend.
    paints -
    chartTypeProperties -
    Method Detail

    getLegendLabel

    public final java.lang.String getLegendLabel(int index)
    Returns the legend label for the passed index. This index corresponds to the DataSet for which label you want.

    Specified by:
    getLegendLabel in interface IDataSet
    Parameters:
    index -
    Returns:
    String

    getNumberOfLegendLabels

    public int getNumberOfLegendLabels()
    Returns the number of Legend Labels to display. This may not be the same as the number of Data Items, as in AxisCharts, or Data Sets, as in Pie Charts.

    Specified by:
    getNumberOfLegendLabels in interface IDataSet
    Returns:
    int

    getPaint

    public java.awt.Paint getPaint(int index)
    Returns the legend label for the passed index. This index corresponds to the DataSet for which label you want.

    Specified by:
    getPaint in interface IDataSet
    Parameters:
    index -
    Returns:
    Paint

    getChartTypeProperties

    public ChartTypeProperties getChartTypeProperties()
    Description copied from interface: IDataSet
    Returns ChartTypeProperties Object for the data set which will be typed into the specific chart type class.

    Specified by:
    getChartTypeProperties in interface IDataSet
    Returns:
    ChartTypeProperties

    getNumberOfDataItems

    public int getNumberOfDataItems()
    Returns the number of elements in the data set. All data sets must be of the same length so just look at the first one.

    Specified by:
    getNumberOfDataItems in interface IDataSet
    Returns:
    int

    toHTML

    public void toHTML(HTMLGenerator htmlGenerator)
    Enables the testing routines to display the contents of this Object.

    Specified by:
    toHTML in interface HTMLTestable
    Parameters:
    htmlGenerator -


    jcharts-0.7.5/javadocs/org/jCharts/chartData/package-frame.html0000644000175000001440000000342307751071376023454 0ustar onkarusers org.jCharts.chartData (jCharts-0.7.5 API) org.jCharts.chartData
    Classes 
    AxisChartDataSet
    AxisDataSeries
    DataSeries
    DataSet
    PieChartDataSet
    ScatterPlotDataSeries
    ScatterPlotDataSet
    StockChartDataSet
    Exceptions 
    ChartDataException
    jcharts-0.7.5/javadocs/org/jCharts/chartData/package-summary.html0000644000175000001440000001602607751071376024062 0ustar onkarusers org.jCharts.chartData (jCharts-0.7.5 API)

    Package org.jCharts.chartData

    Class Summary
    AxisChartDataSet  
    AxisDataSeries Collection of all IAxisChartDataSets to display in an AxisChart
    DataSeries Collection of all IAxisPlotDataSets to display in an AxisChart
    DataSet  
    PieChartDataSet Implementation of the IPieChartDataSet Interface for use with the PieChart2D Object.
    ScatterPlotDataSeries Collection of all IAxisPlotDataSets to display in an AxisChart
    ScatterPlotDataSet  
    StockChartDataSet  
     

    Exception Summary
    ChartDataException  
     



    jcharts-0.7.5/javadocs/org/jCharts/chartData/package-tree.html0000644000175000001440000002044507751071376023324 0ustar onkarusers org.jCharts.chartData Class Hierarchy (jCharts-0.7.5 API)

    Hierarchy For Package org.jCharts.chartData

    Package Hierarchies:
    All Packages

    Class Hierarchy



    jcharts-0.7.5/javadocs/org/jCharts/chartData/PieChartDataSet.html0000644000175000001440000004331107751071400023722 0ustar onkarusers PieChartDataSet (jCharts-0.7.5 API)

    org.jCharts.chartData
    Class PieChartDataSet

    java.lang.Object
      |
      +--org.jCharts.chartData.DataSet
            |
            +--org.jCharts.chartData.PieChartDataSet
    
    All Implemented Interfaces:
    HTMLTestable, IData, IDataSet, IPieChartDataSet, java.io.Serializable

    public final class PieChartDataSet
    extends DataSet
    implements IPieChartDataSet

    Implementation of the IPieChartDataSet Interface for use with the PieChart2D Object.

    See Also:
    Serialized Form

    Field Summary
    private  java.lang.String chartTitle
               
     
    Fields inherited from class org.jCharts.chartData.DataSet
    data, legendLabels, paints
     
    Constructor Summary
    PieChartDataSet(java.lang.String chartTitle, double[] data, java.lang.String[] legendLabels, java.awt.Paint[] paints, PieChart2DProperties pieChart2DProperties)
              Constructor
     
    Method Summary
     java.lang.String getChartTitle()
              Returns the chart title.
     double getValue(int index)
              Returns the value in the data set at the specified position.
    private  void validateData(double[] data, java.lang.String[] legendLabels, java.awt.Paint[] paints)
              Perform some limited validation of the structure of the passed data.
     
    Methods inherited from class org.jCharts.chartData.DataSet
    getChartTypeProperties, getLegendLabel, getNumberOfDataItems, getNumberOfLegendLabels, getPaint, toHTML
     
    Methods inherited from class java.lang.Object
    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
     
    Methods inherited from interface org.jCharts.chartData.interfaces.IDataSet
    getChartTypeProperties, getLegendLabel, getNumberOfDataItems, getNumberOfLegendLabels, getPaint
     

    Field Detail

    chartTitle

    private java.lang.String chartTitle
    Constructor Detail

    PieChartDataSet

    public PieChartDataSet(java.lang.String chartTitle,
                           double[] data,
                           java.lang.String[] legendLabels,
                           java.awt.Paint[] paints,
                           PieChart2DProperties pieChart2DProperties)
                    throws ChartDataException
    Constructor

    Parameters:
    chartTitle - if the title is NULL, no title will be drawn
    data -
    legendLabels -
    paints -
    pieChart2DProperties -
    Throws:
    ChartDataException - if fails a limited validation check
    Method Detail

    validateData

    private void validateData(double[] data,
                              java.lang.String[] legendLabels,
                              java.awt.Paint[] paints)
                       throws ChartDataException
    Perform some limited validation of the structure of the passed data. This is useful for development.

    Parameters:
    data -
    legendLabels -
    paints -
    Throws:
    ChartDataException

    getChartTitle

    public java.lang.String getChartTitle()
    Returns the chart title.

    Specified by:
    getChartTitle in interface IPieChartDataSet
    Returns:
    String the chart title. If this returns NULL, no title will be displayed.

    getValue

    public double getValue(int index)
                    throws java.lang.ArrayIndexOutOfBoundsException
    Returns the value in the data set at the specified position.

    Specified by:
    getValue in interface IPieChartDataSet
    Parameters:
    index -
    Returns:
    double
    Throws:
    java.lang.ArrayIndexOutOfBoundsException


    jcharts-0.7.5/javadocs/org/jCharts/chartData/ScatterPlotDataSeries.html0000644000175000001440000004110407751071400025164 0ustar onkarusers ScatterPlotDataSeries (jCharts-0.7.5 API)

    org.jCharts.chartData
    Class ScatterPlotDataSeries

    java.lang.Object
      |
      +--org.jCharts.chartData.AxisDataSeries
            |
            +--org.jCharts.chartData.ScatterPlotDataSeries
    
    All Implemented Interfaces:
    HTMLTestable, IAxisDataSeries, IData, IScatterPlotDataSeries, java.io.Serializable

    public class ScatterPlotDataSeries
    extends AxisDataSeries
    implements IScatterPlotDataSeries, HTMLTestable

    Collection of all IAxisPlotDataSets to display in an AxisChart

    See Also:
    Serialized Form

    Field Summary
     
    Fields inherited from class org.jCharts.chartData.AxisDataSeries
    dataSets, totalNumberOfDataSets
     
    Constructor Summary
    ScatterPlotDataSeries(IScatterPlotDataSet iScatterPlotDataSet, java.lang.String xAxisTitle, java.lang.String yAxisTitle, java.lang.String chartTitle)
              Constructor
     
    Method Summary
     void toHTML(HTMLGenerator htmlGenerator)
              Returns the total number data dimensions in all of the IAxisChartDataSets contained in this collection.
     
    Methods inherited from class org.jCharts.chartData.AxisDataSeries
    addIAxisPlotDataSet, getChartTitle, getIAxisPlotDataSet, getIAxisPlotDataSetIterator, getSizeOfEachDataSet, getTotalNumberOfDataSets, getXAxisTitle, getYAxisTitle, size, validate
     
    Methods inherited from class java.lang.Object
    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
     
    Methods inherited from interface org.jCharts.chartData.interfaces.IAxisDataSeries
    addIAxisPlotDataSet, getChartTitle, getIAxisPlotDataSet, getIAxisPlotDataSetIterator, getTotalNumberOfDataSets, getXAxisTitle, getYAxisTitle, size, validate
     

    Constructor Detail

    ScatterPlotDataSeries

    public ScatterPlotDataSeries(IScatterPlotDataSet iScatterPlotDataSet,
                                 java.lang.String xAxisTitle,
                                 java.lang.String yAxisTitle,
                                 java.lang.String chartTitle)
    Constructor

    Parameters:
    xAxisTitle - if this is NULL, no title will be displayed
    yAxisTitle - if this is NULL, no title will be displayed
    chartTitle - if this is NULL, no title will be displayed
    Method Detail

    toHTML

    public void toHTML(HTMLGenerator htmlGenerator)
    Returns the total number data dimensions in all of the IAxisChartDataSets contained in this collection. For example, if this contains two IAxisChartDataSets and each one contains 3 dimensions ( 3 lines and 3 sets of points ), this should return six. This provides a means to avoid looping the contents of the series each time i need the value. // * @return int public int getTotalNumberOfDataSets() { return this.totalNumberOfDataSets; } /********************************************************************************************* Enables the testing routines to display the contents of this Object.

    Specified by:
    toHTML in interface HTMLTestable
    Overrides:
    toHTML in class AxisDataSeries
    Parameters:
    htmlGenerator -


    jcharts-0.7.5/javadocs/org/jCharts/chartData/ScatterPlotDataSet.html0000644000175000001440000006433007751071400024473 0ustar onkarusers ScatterPlotDataSet (jCharts-0.7.5 API)

    org.jCharts.chartData
    Class ScatterPlotDataSet

    java.lang.Object
      |
      +--org.jCharts.chartData.ScatterPlotDataSet
    
    All Implemented Interfaces:
    HTMLTestable, IAxisPlotDataSet, IData, IDataSet, IScatterPlotDataSet, java.io.Serializable

    public class ScatterPlotDataSet
    extends java.lang.Object
    implements IScatterPlotDataSet, HTMLTestable

    See Also:
    Serialized Form

    Field Summary
    private  java.util.ArrayList data
               
    private  java.util.ArrayList legendLabels
               
    private  int numDataItems
               
    private  java.util.ArrayList paints
               
    private static java.awt.geom.Point2D.Double POINT
               
    private  ScatterPlotProperties scatterPlotProperties
               
     
    Constructor Summary
    ScatterPlotDataSet(ScatterPlotProperties scatterPlotProperties)
              Constructor
     
    Method Summary
     void addDataPoints(java.awt.geom.Point2D.Double[] points, java.awt.Paint paint, java.lang.String legendLabel)
               
    static java.awt.geom.Point2D.Double createPoint2DDouble()
              Take advantage of the face Cloning performs better than creating new for highly used Objects.
     ChartType getChartType()
              Returns the type constant that this data set should be plotted as.
     ChartTypeProperties getChartTypeProperties()
              Returns ChartTypeProperties Object for the data set which will be typed into the specific chart type class.
     java.lang.String getLegendLabel(int index)
              Returns the legend label for the passed index.
     int getNumberOfDataItems()
              Returns the number of elements in the data set.
     int getNumberOfDataSets()
              Returns the number of elements in the data set.
     int getNumberOfLegendLabels()
              Returns the number of Legend Labels to display.
     java.awt.Paint getPaint(int index)
              Returns the legend label for the passed index.
     java.awt.geom.Point2D.Double getValue(int dataset, int index)
              Returns the value in the data set at the specified position.
     void toHTML(HTMLGenerator htmlGenerator)
              Enables the testing routines to display the contents of this Object.
     void validate()
              Performs a limited validation of data.
     
    Methods inherited from class java.lang.Object
    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
     

    Field Detail

    POINT

    private static java.awt.geom.Point2D.Double POINT

    data

    private java.util.ArrayList data

    legendLabels

    private java.util.ArrayList legendLabels

    paints

    private java.util.ArrayList paints

    scatterPlotProperties

    private ScatterPlotProperties scatterPlotProperties

    numDataItems

    private int numDataItems
    Constructor Detail

    ScatterPlotDataSet

    public ScatterPlotDataSet(ScatterPlotProperties scatterPlotProperties)
    Constructor

    Parameters:
    scatterPlotProperties -
    Method Detail

    getChartType

    public final ChartType getChartType()
    Returns the type constant that this data set should be plotted as.

    Specified by:
    getChartType in interface IAxisPlotDataSet
    Returns:
    ChartType
    See Also:
    ChartType

    addDataPoints

    public void addDataPoints(java.awt.geom.Point2D.Double[] points,
                              java.awt.Paint paint,
                              java.lang.String legendLabel)
    Parameters:
    points -
    paint -
    legendLabel -

    validate

    public void validate()
                  throws ChartDataException
    Performs a limited validation of data.

    Specified by:
    validate in interface IAxisPlotDataSet
    Throws:
    ChartDataException

    getValue

    public java.awt.geom.Point2D.Double getValue(int dataset,
                                                 int index)
    Returns the value in the data set at the specified position.

    Specified by:
    getValue in interface IScatterPlotDataSet
    Parameters:
    dataset -
    index -
    Returns:
    Point.Double

    getLegendLabel

    public final java.lang.String getLegendLabel(int index)
    Returns the legend label for the passed index. This index corresponds to the DataSet for which label you want.

    Specified by:
    getLegendLabel in interface IDataSet
    Parameters:
    index -
    Returns:
    String

    getNumberOfLegendLabels

    public int getNumberOfLegendLabels()
    Returns the number of Legend Labels to display. This may not be the same as the number of Data Items, as in AxisCharts, or Data Sets, as in Pie Charts.

    Specified by:
    getNumberOfLegendLabels in interface IDataSet
    Returns:
    int

    getPaint

    public java.awt.Paint getPaint(int index)
    Returns the legend label for the passed index. This index corresponds to the DataSet for which label you want.

    Specified by:
    getPaint in interface IDataSet
    Parameters:
    index -
    Returns:
    Paint

    getChartTypeProperties

    public ChartTypeProperties getChartTypeProperties()
    Description copied from interface: IDataSet
    Returns ChartTypeProperties Object for the data set which will be typed into the specific chart type class.

    Specified by:
    getChartTypeProperties in interface IDataSet
    Returns:
    ChartTypeProperties

    getNumberOfDataSets

    public int getNumberOfDataSets()
    Returns the number of elements in the data set.

    Specified by:
    getNumberOfDataSets in interface IAxisPlotDataSet
    Returns:
    int

    getNumberOfDataItems

    public int getNumberOfDataItems()
    Returns the number of elements in the data set.

    Specified by:
    getNumberOfDataItems in interface IDataSet
    Returns:
    int

    createPoint2DDouble

    public static final java.awt.geom.Point2D.Double createPoint2DDouble()
    Take advantage of the face Cloning performs better than creating new for highly used Objects.

    Returns:
    Point2D.Double

    toHTML

    public void toHTML(HTMLGenerator htmlGenerator)
    Enables the testing routines to display the contents of this Object.

    Specified by:
    toHTML in interface HTMLTestable
    Parameters:
    htmlGenerator -


    jcharts-0.7.5/javadocs/org/jCharts/chartData/StockChartDataSet.html0000644000175000001440000010123307751071400024266 0ustar onkarusers StockChartDataSet (jCharts-0.7.5 API)

    org.jCharts.chartData
    Class StockChartDataSet

    java.lang.Object
      |
      +--org.jCharts.chartData.StockChartDataSet
    
    All Implemented Interfaces:
    HTMLTestable, IAxisPlotDataSet, IData, IDataSet, IStockChartDataSet, java.io.Serializable

    public class StockChartDataSet
    extends java.lang.Object
    implements IStockChartDataSet, HTMLTestable

    See Also:
    Serialized Form

    Field Summary
    private  ChartType chartType
               
    private  double[] close
               
    private  double[] high
               
    private  java.lang.String[] legendLabels
               
    private  double[] low
               
    private  int numberOfDataSets
               
    private  double[] open
               
    private  java.awt.Paint[] paints
               
    private  StockChartProperties stockChartProperties
               
     
    Constructor Summary
    StockChartDataSet(double[] high, java.lang.String highLegendLabel, double[] low, java.lang.String lowLegendLabel, java.awt.Paint highLowPaint, StockChartProperties stockChartProperties)
              Constructor
     
    Method Summary
     ChartType getChartType()
              Returns the type constant that this data set should be plotted as.
     ChartTypeProperties getChartTypeProperties()
              Returns the chart specific properties
     double getCloseValue(int index)
               
     double getHighValue(int index)
               
     java.lang.String getLegendLabel(int index)
              Returns the legend label for the passed index.
     double getLowValue(int index)
               
     int getNumberOfDataItems()
              Returns the number of elements in the data set.
     int getNumberOfDataSets()
              Returns the number of IAxisChartDataSet Objects in this series
     int getNumberOfLegendLabels()
              Returns the number of Legend Labels to display.
     double getOpenValue(int index)
               
     java.awt.Paint getPaint(int index)
              Returns the number of IAxisChartDataSet Objects in this series
     boolean hasCloseValues()
               
     boolean hasOpenValues()
               
     void setCloseValues(double[] data, java.lang.String legendLabel, java.awt.Paint paint)
              Sets the 'Close' values
     void setOpenValues(double[] data, java.lang.String legendLabel, java.awt.Paint paint)
              Sets the 'Open' values
     void toHTML(HTMLGenerator htmlGenerator)
              Enables the testing routines to display the contents of this Object.
     void validate()
              Performs a limited validation of data passed to Constructor.
     
    Methods inherited from class java.lang.Object
    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
     

    Field Detail

    chartType

    private ChartType chartType

    high

    private double[] high

    low

    private double[] low

    open

    private double[] open

    close

    private double[] close

    numberOfDataSets

    private int numberOfDataSets

    legendLabels

    private java.lang.String[] legendLabels

    paints

    private java.awt.Paint[] paints

    stockChartProperties

    private StockChartProperties stockChartProperties
    Constructor Detail

    StockChartDataSet

    public StockChartDataSet(double[] high,
                             java.lang.String highLegendLabel,
                             double[] low,
                             java.lang.String lowLegendLabel,
                             java.awt.Paint highLowPaint,
                             StockChartProperties stockChartProperties)
                      throws ChartDataException
    Constructor

    Parameters:
    high -
    highLegendLabel -
    low -
    lowLegendLabel -
    stockChartProperties - properties Object specific to the type of chart you are rendering.
    Throws:
    ChartDataException - performs a limited validation of the data
    Method Detail

    validate

    public void validate()
                  throws ChartDataException,
                         PropertyException
    Performs a limited validation of data passed to Constructor.

    Specified by:
    validate in interface IAxisPlotDataSet
    Throws:
    ChartDataException
    PropertyException

    getLegendLabel

    public java.lang.String getLegendLabel(int index)
    Returns the legend label for the passed index. This index corresponds to the DataSet for which label you want.

    Specified by:
    getLegendLabel in interface IDataSet
    Parameters:
    index -
    Returns:
    String

    getNumberOfLegendLabels

    public int getNumberOfLegendLabels()
    Returns the number of Legend Labels to display.

    Specified by:
    getNumberOfLegendLabels in interface IDataSet
    Returns:
    int

    getNumberOfDataItems

    public int getNumberOfDataItems()
    Returns the number of elements in the data set. All data sets must be of the same length so just look at the first one.

    Specified by:
    getNumberOfDataItems in interface IDataSet
    Returns:
    int

    setCloseValues

    public void setCloseValues(double[] data,
                               java.lang.String legendLabel,
                               java.awt.Paint paint)
    Sets the 'Close' values

    Parameters:
    data -
    legendLabel -
    paint -

    setOpenValues

    public void setOpenValues(double[] data,
                              java.lang.String legendLabel,
                              java.awt.Paint paint)
    Sets the 'Open' values

    Parameters:
    data -
    legendLabel -
    paint -

    getHighValue

    public double getHighValue(int index)
    Specified by:
    getHighValue in interface IStockChartDataSet
    Parameters:
    index -
    Returns:
    double

    getLowValue

    public double getLowValue(int index)
    Specified by:
    getLowValue in interface IStockChartDataSet
    Parameters:
    index -
    Returns:
    double

    getCloseValue

    public double getCloseValue(int index)
    Specified by:
    getCloseValue in interface IStockChartDataSet
    Parameters:
    index -
    Returns:
    double

    hasCloseValues

    public boolean hasCloseValues()
    Specified by:
    hasCloseValues in interface IStockChartDataSet
    Returns:
    boolean

    getOpenValue

    public double getOpenValue(int index)
    Specified by:
    getOpenValue in interface IStockChartDataSet
    Parameters:
    index -
    Returns:
    double

    hasOpenValues

    public boolean hasOpenValues()
    Specified by:
    hasOpenValues in interface IStockChartDataSet
    Returns:
    boolean

    getChartType

    public ChartType getChartType()
    Returns the type constant that this data set should be plotted as.

    Specified by:
    getChartType in interface IStockChartDataSet
    Returns:
    ChartType
    See Also:
    ChartType

    getChartTypeProperties

    public ChartTypeProperties getChartTypeProperties()
    Returns the chart specific properties

    Specified by:
    getChartTypeProperties in interface IDataSet
    Returns:
    ChartTypeProperties

    getNumberOfDataSets

    public int getNumberOfDataSets()
    Returns the number of IAxisChartDataSet Objects in this series

    Specified by:
    getNumberOfDataSets in interface IAxisPlotDataSet
    Returns:
    int

    getPaint

    public java.awt.Paint getPaint(int index)
    Returns the number of IAxisChartDataSet Objects in this series

    Specified by:
    getPaint in interface IDataSet
    Parameters:
    index -
    Returns:
    int

    toHTML

    public void toHTML(HTMLGenerator htmlGenerator)
    Enables the testing routines to display the contents of this Object.

    Specified by:
    toHTML in interface HTMLTestable
    Parameters:
    htmlGenerator -


    jcharts-0.7.5/javadocs/org/jCharts/chartText/0000755000175000001440000000000007751071404020144 5ustar onkarusersjcharts-0.7.5/javadocs/org/jCharts/chartText/BarValueGroup.BarValue.html0000644000175000001440000004267607751071400025263 0ustar onkarusers BarValueGroup.BarValue (jCharts-0.7.5 API)

    org.jCharts.chartText
    Class BarValueGroup.BarValue

    java.lang.Object
      |
      +--org.jCharts.chartText.TextTag
            |
            +--org.jCharts.chartText.BarValueGroup.BarValue
    
    All Implemented Interfaces:
    HTMLTestable, java.io.Serializable
    Enclosing class:
    BarValueGroup

    protected class BarValueGroup.BarValue
    extends TextTag

    Helper class to handle a barValue - wraps TextTag Meant to be called only by BarValueGroup class.

    See Also:
    Serialized Form

    Field Summary
    private  java.awt.geom.Rectangle2D.Float barRect
               
    private  boolean isNegative
               
    private  int startPosition
               
    private  java.lang.String text
               
     
    Fields inherited from class org.jCharts.chartText.TextTag
     
    Constructor Summary
    BarValueGroup.BarValue(java.lang.String text, java.awt.Font font, java.awt.font.FontRenderContext fontRenderContext, java.awt.geom.Rectangle2D.Float barRect, int startPosition, boolean isNegative)
               
     
    Method Summary
     java.awt.geom.Rectangle2D.Float getBarRect()
               
     boolean getIsNegative()
               
     int getStartPosition()
               
     java.lang.String getText()
               
     
    Methods inherited from class org.jCharts.chartText.TextTag
    addAttribute, getAttribute, getBottomSide, getFontAscent, getFontDescent, getHeight, getHidden, getRectangle, getRightSide, getWidth, getXPosition, getYPosition, render, render, setHidden, setPosition, setXPosition, setYPosition, toHTML, toString
     
    Methods inherited from class java.lang.Object
    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
     

    Field Detail

    barRect

    private java.awt.geom.Rectangle2D.Float barRect

    startPosition

    private int startPosition

    isNegative

    private boolean isNegative

    text

    private java.lang.String text
    Constructor Detail

    BarValueGroup.BarValue

    public BarValueGroup.BarValue(java.lang.String text,
                                  java.awt.Font font,
                                  java.awt.font.FontRenderContext fontRenderContext,
                                  java.awt.geom.Rectangle2D.Float barRect,
                                  int startPosition,
                                  boolean isNegative)
    Method Detail

    getBarRect

    public java.awt.geom.Rectangle2D.Float getBarRect()

    getStartPosition

    public int getStartPosition()

    getIsNegative

    public boolean getIsNegative()

    getText

    public java.lang.String getText()
    Overrides:
    getText in class TextTag


    jcharts-0.7.5/javadocs/org/jCharts/chartText/BarValueGroup.html0000644000175000001440000006150707751071400023555 0ustar onkarusers BarValueGroup (jCharts-0.7.5 API)

    org.jCharts.chartText
    Class BarValueGroup

    java.lang.Object
      |
      +--org.jCharts.chartText.BarValueGroup
    

    public class BarValueGroup
    extends java.lang.Object


    Nested Class Summary
    protected  class BarValueGroup.BarValue
              Helper class to handle a barValue - wraps TextTag Meant to be called only by BarValueGroup class.
     
    Field Summary
    private  AxisChart axisChart
               
    private  AxisProperties axisProperties
               
    private  BarChartProperties barChartProperties
               
    private  java.awt.Font barValueFont
               
    private  java.awt.Paint barValueFontColor
               
    private  int barValueItem
               
    private  int barValuePosition
               
    private  float centerChart
               
    private  java.awt.font.FontRenderContext fontRenderContext
               
    private  float horizontalPadding
               
    private  boolean isVertical
               
    private  java.text.NumberFormat numberFormat
               
    private  boolean showBarValues
               
    private  java.util.ArrayList textTagList
               
    private  double totalDataValue
               
    private  float verticalPadding
               
     
    Constructor Summary
    BarValueGroup(AxisChart axisChart, IAxisChartDataSet iAxisChartDataSet)
               
     
    Method Summary
     void addBarValue(int i, double dataValue, java.awt.geom.Rectangle2D.Float barRect)
              Adds a bar value for the given data item, if barValues are on
    private  java.lang.String getBarValueAt(int i, double dataValue)
              Gets the text associated (by the user) for the given bar value.
    private  java.awt.geom.Rectangle2D.Float getBarValueRectangleCoordinates(int position, BarValueGroup.BarValue barValue)
              Gets the rectangle coords associated (by the user) for the given bar value.
    private  float getBottom(java.awt.geom.Rectangle2D.Float r)
              Not sure why this was left out of Rectangle2D...
    private  float getRight(java.awt.geom.Rectangle2D.Float r)
              Not sure why this was left out of Rectangle2D...
     void render(java.awt.Graphics2D g2d)
              renders any barValues
    private  void setBarValuePosition(BarValueGroup.BarValue barValue, java.awt.geom.Rectangle2D.Float bounds)
              Gets the rectangle associated (by the user) for the given bar value.
     
    Methods inherited from class java.lang.Object
    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
     

    Field Detail

    axisChart

    private AxisChart axisChart

    fontRenderContext

    private java.awt.font.FontRenderContext fontRenderContext

    isVertical

    private boolean isVertical

    barChartProperties

    private BarChartProperties barChartProperties

    axisProperties

    private AxisProperties axisProperties

    numberFormat

    private java.text.NumberFormat numberFormat

    showBarValues

    private boolean showBarValues

    barValuePosition

    private int barValuePosition

    barValueItem

    private int barValueItem

    barValueFont

    private java.awt.Font barValueFont

    barValueFontColor

    private java.awt.Paint barValueFontColor

    horizontalPadding

    private float horizontalPadding

    verticalPadding

    private float verticalPadding

    totalDataValue

    private double totalDataValue

    centerChart

    private float centerChart

    textTagList

    private java.util.ArrayList textTagList
    Constructor Detail

    BarValueGroup

    public BarValueGroup(AxisChart axisChart,
                         IAxisChartDataSet iAxisChartDataSet)
    Method Detail

    getBarValueAt

    private java.lang.String getBarValueAt(int i,
                                           double dataValue)
    Gets the text associated (by the user) for the given bar value. Meant only to be called by BarChart.render()


    getBarValueRectangleCoordinates

    private java.awt.geom.Rectangle2D.Float getBarValueRectangleCoordinates(int position,
                                                                            BarValueGroup.BarValue barValue)
    Gets the rectangle coords associated (by the user) for the given bar value. Meant only to be called by BarChart.render()


    getRight

    private float getRight(java.awt.geom.Rectangle2D.Float r)
    Not sure why this was left out of Rectangle2D...


    getBottom

    private float getBottom(java.awt.geom.Rectangle2D.Float r)
    Not sure why this was left out of Rectangle2D...


    setBarValuePosition

    private void setBarValuePosition(BarValueGroup.BarValue barValue,
                                     java.awt.geom.Rectangle2D.Float bounds)
    Gets the rectangle associated (by the user) for the given bar value. Meant only to be called by BarChart.render()


    addBarValue

    public void addBarValue(int i,
                            double dataValue,
                            java.awt.geom.Rectangle2D.Float barRect)
    Adds a bar value for the given data item, if barValues are on


    render

    public void render(java.awt.Graphics2D g2d)
    renders any barValues



    jcharts-0.7.5/javadocs/org/jCharts/chartText/NumericTagGroup.html0000644000175000001440000003744607751071400024117 0ustar onkarusers NumericTagGroup (jCharts-0.7.5 API)

    org.jCharts.chartText
    Class NumericTagGroup

    java.lang.Object
      |
      +--org.jCharts.chartText.TextTagGroup
            |
            +--org.jCharts.chartText.NumericTagGroup
    
    All Implemented Interfaces:
    HTMLTestable, java.io.Serializable

    public class NumericTagGroup
    extends TextTagGroup

    See Also:
    Serialized Form

    Field Summary
    private  java.text.NumberFormat numberFormat
               
     
    Fields inherited from class org.jCharts.chartText.TextTagGroup
     
    Constructor Summary
    NumericTagGroup(ChartFont chartFont, java.awt.font.FontRenderContext fontRenderContext, boolean isCurrency, boolean isPercent, boolean showCommas, int roundingPowerOfTen)
               
     
    Method Summary
     void addLabel(double value)
               
     void createAxisScaleLabels(ScaleCalculator scaleCalculator)
              Creates the axis labels for the passed ScaleCalculator instance.
    static java.text.NumberFormat getNumberFormatInstance(boolean isCurrency, boolean isPercent, boolean showCommas, int roundingPowerOfTen)
              Allow use of this logic to not only this class but to the chart label values.
     
    Methods inherited from class org.jCharts.chartText.TextTagGroup
    addLabel, getTallestLabel, getTextTag, getTotalLabelWidths, getWidestLabel, render, reverse, size, toHTML
     
    Methods inherited from class java.lang.Object
    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
     

    Field Detail

    numberFormat

    private java.text.NumberFormat numberFormat
    Constructor Detail

    NumericTagGroup

    public NumericTagGroup(ChartFont chartFont,
                           java.awt.font.FontRenderContext fontRenderContext,
                           boolean isCurrency,
                           boolean isPercent,
                           boolean showCommas,
                           int roundingPowerOfTen)
    Parameters:
    chartFont -
    fontRenderContext -
    isCurrency -
    isPercent -
    showCommas -
    roundingPowerOfTen - the exponent of ten to round to: 1=10, -1=.1, 3=1000, etc...
    Method Detail

    getNumberFormatInstance

    public static final java.text.NumberFormat getNumberFormatInstance(boolean isCurrency,
                                                                       boolean isPercent,
                                                                       boolean showCommas,
                                                                       int roundingPowerOfTen)
    Allow use of this logic to not only this class but to the chart label values.

    Parameters:
    isCurrency -
    isPercent -
    showCommas -
    roundingPowerOfTen -
    Returns:
    NumberFormat

    addLabel

    public void addLabel(double value)
    Parameters:
    value -

    createAxisScaleLabels

    public void createAxisScaleLabels(ScaleCalculator scaleCalculator)
    Creates the axis labels for the passed ScaleCalculator instance.

    Parameters:
    scaleCalculator -


    jcharts-0.7.5/javadocs/org/jCharts/chartText/package-frame.html0000644000175000001440000000227507751071376023533 0ustar onkarusers org.jCharts.chartText (jCharts-0.7.5 API) org.jCharts.chartText
    Classes 
    BarValueGroup
    NumericTagGroup
    TextTag
    TextTagGroup
    jcharts-0.7.5/javadocs/org/jCharts/chartText/package-summary.html0000644000175000001440000001337307751071376024137 0ustar onkarusers org.jCharts.chartText (jCharts-0.7.5 API)

    Package org.jCharts.chartText

    Class Summary
    BarValueGroup  
    NumericTagGroup  
    TextTag  
    TextTagGroup  
     



    jcharts-0.7.5/javadocs/org/jCharts/chartText/package-tree.html0000644000175000001440000001407007751071376023374 0ustar onkarusers org.jCharts.chartText Class Hierarchy (jCharts-0.7.5 API)

    Hierarchy For Package org.jCharts.chartText

    Package Hierarchies:
    All Packages

    Class Hierarchy



    jcharts-0.7.5/javadocs/org/jCharts/chartText/TextTag.html0000644000175000001440000007423707751071400022423 0ustar onkarusers TextTag (jCharts-0.7.5 API)

    org.jCharts.chartText
    Class TextTag

    java.lang.Object
      |
      +--org.jCharts.chartText.TextTag
    
    All Implemented Interfaces:
    HTMLTestable, java.io.Serializable
    Direct Known Subclasses:
    BarValueGroup.BarValue

    public class TextTag
    extends java.lang.Object
    implements HTMLTestable, java.io.Serializable

    See Also:
    Serialized Form

    Field Summary
    private  java.util.Hashtable attributes
               
    private  java.awt.Font derivedFont
               
    private  java.awt.Font font
               
    private  float fontAscent
               
    private  float fontDescent
               
    private  float height
               
    private  boolean isDerived
               
    private  boolean isHidden
               
    private  java.lang.String text
               
    private  java.awt.font.TextLayout textLayout
               
    private  float width
               
    private  float xPosition
               
    private  float yPosition
               
     
    Constructor Summary
    TextTag(java.lang.String text, java.awt.Font baseFont, java.awt.Font derivedFont, java.awt.font.FontRenderContext fontRenderContext)
              Constructor when using transformed (derived) fonts The need for this arises because the java metrics classes return either 0 or very strange values for the width and height of a string (TextLayout, LineMetrics, etc..) when the font is derived
    TextTag(java.lang.String text, java.awt.Font baseFont, java.awt.font.FontRenderContext fontRenderContext)
              Default constructor - for untransformed fonts.
     
    Method Summary
     void addAttribute(java.lang.String name, java.lang.Object o)
               
     java.lang.Object getAttribute(java.lang.String name)
               
     float getBottomSide()
               
     float getFontAscent()
               
     float getFontDescent()
               
     float getHeight()
               
     boolean getHidden()
               
     java.awt.geom.Rectangle2D.Float getRectangle()
               
     float getRightSide()
               
     java.lang.String getText()
               
     float getWidth()
               
     float getXPosition()
               
     float getYPosition()
               
     void render(java.awt.Graphics2D g2d, float x, float y)
              Renders the text, at the position - renders from the top (instead of baseline)
     void render(java.awt.Graphics2D g2d, java.awt.Paint fontColor)
              Renders the text, at the position - renders from the top (instead of baseline)
     void setHidden(boolean b)
               
     void setPosition(float x, float y)
               
     void setXPosition(float x)
               
     void setYPosition(float y)
               
     void toHTML(HTMLGenerator htmlGenerator)
              Enables the testing routines to display the contents of this Object.
     java.lang.String toString()
               
     
    Methods inherited from class java.lang.Object
    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
     

    Field Detail

    xPosition

    private float xPosition

    yPosition

    private float yPosition

    textLayout

    private java.awt.font.TextLayout textLayout

    attributes

    private java.util.Hashtable attributes

    isHidden

    private boolean isHidden

    width

    private float width

    height

    private float height

    fontAscent

    private float fontAscent

    fontDescent

    private float fontDescent

    isDerived

    private boolean isDerived

    derivedFont

    private java.awt.Font derivedFont

    text

    private java.lang.String text

    font

    private java.awt.Font font
    Constructor Detail

    TextTag

    public TextTag(java.lang.String text,
                   java.awt.Font baseFont,
                   java.awt.font.FontRenderContext fontRenderContext)
    Default constructor - for untransformed fonts.


    TextTag

    public TextTag(java.lang.String text,
                   java.awt.Font baseFont,
                   java.awt.Font derivedFont,
                   java.awt.font.FontRenderContext fontRenderContext)
    Constructor when using transformed (derived) fonts The need for this arises because the java metrics classes return either 0 or very strange values for the width and height of a string (TextLayout, LineMetrics, etc..) when the font is derived

    Parameters:
    text -
    baseFont - is the original (untransformed) font.
    derivedFont - is the transformed font
    fontRenderContext -
    Method Detail

    getWidth

    public float getWidth()

    getHeight

    public float getHeight()

    getFontAscent

    public float getFontAscent()

    getFontDescent

    public float getFontDescent()

    setPosition

    public void setPosition(float x,
                            float y)

    setXPosition

    public void setXPosition(float x)

    setYPosition

    public void setYPosition(float y)

    getXPosition

    public float getXPosition()

    getYPosition

    public float getYPosition()

    getRightSide

    public float getRightSide()

    getBottomSide

    public float getBottomSide()

    getRectangle

    public java.awt.geom.Rectangle2D.Float getRectangle()

    setHidden

    public void setHidden(boolean b)

    getHidden

    public boolean getHidden()

    getText

    public java.lang.String getText()

    addAttribute

    public void addAttribute(java.lang.String name,
                             java.lang.Object o)

    getAttribute

    public java.lang.Object getAttribute(java.lang.String name)

    render

    public void render(java.awt.Graphics2D g2d,
                       java.awt.Paint fontColor)
    Renders the text, at the position - renders from the top (instead of baseline)

    Parameters:
    g2d -
    fontColor -

    render

    public void render(java.awt.Graphics2D g2d,
                       float x,
                       float y)
    Renders the text, at the position - renders from the top (instead of baseline)

    Parameters:
    g2d -

    toHTML

    public void toHTML(HTMLGenerator htmlGenerator)
    Enables the testing routines to display the contents of this Object.

    Specified by:
    toHTML in interface HTMLTestable
    Parameters:
    htmlGenerator -

    toString

    public java.lang.String toString()
    Overrides:
    toString in class java.lang.Object
    Returns:


    jcharts-0.7.5/javadocs/org/jCharts/chartText/TextTagGroup.html0000644000175000001440000005525607751071400023440 0ustar onkarusers TextTagGroup (jCharts-0.7.5 API)

    org.jCharts.chartText
    Class TextTagGroup

    java.lang.Object
      |
      +--org.jCharts.chartText.TextTagGroup
    
    All Implemented Interfaces:
    HTMLTestable, java.io.Serializable
    Direct Known Subclasses:
    NumericTagGroup

    public class TextTagGroup
    extends java.lang.Object
    implements HTMLTestable, java.io.Serializable

    See Also:
    Serialized Form

    Field Summary
    private  ChartFont chartFont
               
    private  java.awt.font.FontRenderContext fontRenderContext
               
    private  float tallestLabel
               
    private  java.util.ArrayList textTags
               
    private  float totalLabelWidths
               
    private  float widestLabel
               
     
    Constructor Summary
    TextTagGroup(ChartFont chartFont, java.awt.font.FontRenderContext fontRenderContext)
              Constructor
     
    Method Summary
     void addLabel(java.lang.String label)
               
     float getTallestLabel()
               
     TextTag getTextTag(int index)
               
     float getTotalLabelWidths()
               
     float getWidestLabel()
              Calculates the width and height needed by the passed String when rendered // * @param iDataSeries / * @param font // * @param fontRenderContext public void processLabels( IDataSeries iDataSeries) { //LOOP for( int i = 0; i < iDataSeries.getNumberOfXAxisLabels(); i++ ) { this.axisLabelProcessor.processLabel( iDataSeries.getXAxisLabel( i ), axisLabelFont, fontRenderContext ); } TextLayout textLayout = new TextLayout( label, font, fontRenderContext ); //---WIDTH this.labelWidths[ counter ] = textLayout.getAdvance(); this.widestLabel = Math.max( this.labelWidths[ counter ], this.widestLabel ); this.totalLabelWidths += this.labelWidths[ counter ]; //---HEIGHT this.labelHeights[ counter ] = textLayout.getAscent() + textLayout.getDescent(); this.tallestLabel = Math.max( this.labelHeights[ counter ], this.tallestLabel ); //---need this to offset font rendering, as rendering is at the baseline not bottom or top, this.fontDescent = textLayout.getDescent(); this.counter++; } /******************************************************************************************
     void render(int index, java.awt.Graphics2D g2d, float x, float y)
              Renders the text, at the position - renders from the top (instead of baseline)
     void reverse()
              Horizontal plots render the data from top down so rendering alogorithm needs to get the labels in reverse order to make things easier.
     int size()
              Returns the number of labels
     void toHTML(HTMLGenerator htmlGenerator)
              Renders all the text in this group.
     
    Methods inherited from class java.lang.Object
    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
     

    Field Detail

    widestLabel

    private float widestLabel

    tallestLabel

    private float tallestLabel

    totalLabelWidths

    private float totalLabelWidths

    textTags

    private java.util.ArrayList textTags

    chartFont

    private ChartFont chartFont

    fontRenderContext

    private java.awt.font.FontRenderContext fontRenderContext
    Constructor Detail

    TextTagGroup

    public TextTagGroup(ChartFont chartFont,
                        java.awt.font.FontRenderContext fontRenderContext)
    Constructor

    Parameters:
    chartFont -
    fontRenderContext -
    Method Detail

    addLabel

    public void addLabel(java.lang.String label)
    Parameters:
    label -

    size

    public int size()
    Returns the number of labels

    Returns:
    int

    reverse

    public void reverse()
    Horizontal plots render the data from top down so rendering alogorithm needs to get the labels in reverse order to make things easier.


    getWidestLabel

    public float getWidestLabel()
    Calculates the width and height needed by the passed String when rendered // * @param iDataSeries / * @param font // * @param fontRenderContext public void processLabels( IDataSeries iDataSeries) { //LOOP for( int i = 0; i < iDataSeries.getNumberOfXAxisLabels(); i++ ) { this.axisLabelProcessor.processLabel( iDataSeries.getXAxisLabel( i ), axisLabelFont, fontRenderContext ); } TextLayout textLayout = new TextLayout( label, font, fontRenderContext ); //---WIDTH this.labelWidths[ counter ] = textLayout.getAdvance(); this.widestLabel = Math.max( this.labelWidths[ counter ], this.widestLabel ); this.totalLabelWidths += this.labelWidths[ counter ]; //---HEIGHT this.labelHeights[ counter ] = textLayout.getAscent() + textLayout.getDescent(); this.tallestLabel = Math.max( this.labelHeights[ counter ], this.tallestLabel ); //---need this to offset font rendering, as rendering is at the baseline not bottom or top, this.fontDescent = textLayout.getDescent(); this.counter++; } /******************************************************************************************


    getTallestLabel

    public float getTallestLabel()

    getTotalLabelWidths

    public float getTotalLabelWidths()

    getTextTag

    public TextTag getTextTag(int index)
    Parameters:
    index -
    Returns:
    TextTag

    render

    public void render(int index,
                       java.awt.Graphics2D g2d,
                       float x,
                       float y)
    Renders the text, at the position - renders from the top (instead of baseline)

    Parameters:
    index -
    g2d -
    x -
    y -

    toHTML

    public void toHTML(HTMLGenerator htmlGenerator)
    Renders all the text in this group. public void renderTag( int index, Graphics2D g2d ) { TextTag tag; //Paint p = this.fontColor; g2d.setPaint( this. ); //g2d.setFont( (this.derivedFont == null) ? baseFont : derivedFont ); for( int i = 0; i < group.size(); i++ ) { tag = ( TextTag ) group.get( i ); tag.render( g2d, p ); // Text tag sets the Paint every time if not null // So, we might save a small bit of time by changing // this to null after first time. p = null; } } /********************************************************************************************* Enables the testing routines to display the contents of this Object.

    Specified by:
    toHTML in interface HTMLTestable
    Parameters:
    htmlGenerator -


    jcharts-0.7.5/javadocs/org/jCharts/encoders/0000755000175000001440000000000007751071404020000 5ustar onkarusersjcharts-0.7.5/javadocs/org/jCharts/encoders/BinaryEncoderUtil.html0000644000175000001440000002324207751071400024247 0ustar onkarusers BinaryEncoderUtil (jCharts-0.7.5 API)

    org.jCharts.encoders
    Class BinaryEncoderUtil

    java.lang.Object
      |
      +--org.jCharts.encoders.BinaryEncoderUtil
    

    public final class BinaryEncoderUtil
    extends java.lang.Object


    Constructor Summary
    private BinaryEncoderUtil()
               
     
    Method Summary
    (package private) static java.awt.image.BufferedImage render(Chart chart)
               
     
    Methods inherited from class java.lang.Object
    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
     

    Constructor Detail

    BinaryEncoderUtil

    private BinaryEncoderUtil()
                       throws java.lang.Exception
    Method Detail

    render

    static final java.awt.image.BufferedImage render(Chart chart)
                                              throws ChartDataException,
                                                     PropertyException,
                                                     java.io.IOException
    Parameters:
    chart -
    Throws:
    ChartDataException
    PropertyException
    java.io.IOException


    jcharts-0.7.5/javadocs/org/jCharts/encoders/JPEGEncoder.html0000644000175000001440000002661107751071400022715 0ustar onkarusers JPEGEncoder (jCharts-0.7.5 API)

    org.jCharts.encoders
    Class JPEGEncoder

    java.lang.Object
      |
      +--org.jCharts.encoders.JPEGEncoder
    

    public final class JPEGEncoder
    extends java.lang.Object

    This class REQUIRES the jdk 1.4


    Field Summary
    private static java.lang.String JPEG
               
     
    Constructor Summary
    private JPEGEncoder()
               
     
    Method Summary
    static void encode(Chart chart, float quality, java.io.OutputStream outputStream)
              Encodes the chart to a JPEG format.
     
    Methods inherited from class java.lang.Object
    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
     

    Field Detail

    JPEG

    private static final java.lang.String JPEG
    See Also:
    Constant Field Values
    Constructor Detail

    JPEGEncoder

    private JPEGEncoder()
                 throws java.lang.Exception
    Method Detail

    encode

    public static final void encode(Chart chart,
                                    float quality,
                                    java.io.OutputStream outputStream)
                             throws ChartDataException,
                                    PropertyException,
                                    java.io.IOException
    Encodes the chart to a JPEG format. If you are generating large dimension images, the file size can get quite large. You can try decreasing the quality to decrease the file size.

    Parameters:
    outputStream -
    quality - float value from 0.0f(worst image quality) - 1.0f(best image quality)
    Throws:
    ChartDataException
    PropertyException
    java.io.IOException


    jcharts-0.7.5/javadocs/org/jCharts/encoders/JPEGEncoder13.html0000644000175000001440000002437007751071400023061 0ustar onkarusers JPEGEncoder13 (jCharts-0.7.5 API)

    org.jCharts.encoders
    Class JPEGEncoder13

    java.lang.Object
      |
      +--org.jCharts.encoders.JPEGEncoder13
    

    public final class JPEGEncoder13
    extends java.lang.Object

    Provided for backwards compatibility for jdk 1.3


    Constructor Summary
    private JPEGEncoder13()
               
     
    Method Summary
    static void encode(Chart chart, float quality, java.io.OutputStream outputStream)
              Encodes the chart to a JPEG format.
     
    Methods inherited from class java.lang.Object
    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
     

    Constructor Detail

    JPEGEncoder13

    private JPEGEncoder13()
                   throws java.lang.Exception
    Method Detail

    encode

    public static final void encode(Chart chart,
                                    float quality,
                                    java.io.OutputStream outputStream)
                             throws ChartDataException,
                                    PropertyException,
                                    java.io.IOException
    Encodes the chart to a JPEG format. If you are generating large dimension images, the file size can get quite large. You can try decreasing the quality to decrease the file size.

    Parameters:
    outputStream -
    quality - float value from 0.0f(worst image quality) - 1.0f(best image quality)
    Throws:
    ChartDataException
    PropertyException
    java.io.IOException


    jcharts-0.7.5/javadocs/org/jCharts/encoders/package-frame.html0000644000175000001440000000253407751071376023365 0ustar onkarusers org.jCharts.encoders (jCharts-0.7.5 API) org.jCharts.encoders
    Classes 
    BinaryEncoderUtil
    JPEGEncoder
    JPEGEncoder13
    PNGEncoder
    ServletEncoderHelper
    SVGEncoder
    jcharts-0.7.5/javadocs/org/jCharts/encoders/package-summary.html0000644000175000001440000001424107751071376023766 0ustar onkarusers org.jCharts.encoders (jCharts-0.7.5 API)

    Package org.jCharts.encoders

    Class Summary
    BinaryEncoderUtil  
    JPEGEncoder This class REQUIRES the jdk 1.4
    JPEGEncoder13 Provided for backwards compatibility for jdk 1.3
    PNGEncoder This class REQUIRES the jdk 1.4
    ServletEncoderHelper  
    SVGEncoder This class REQUIRES the Apache XML Batik libraries to run.
     



    jcharts-0.7.5/javadocs/org/jCharts/encoders/package-tree.html0000644000175000001440000001357707751071376023243 0ustar onkarusers org.jCharts.encoders Class Hierarchy (jCharts-0.7.5 API)

    Hierarchy For Package org.jCharts.encoders

    Package Hierarchies:
    All Packages

    Class Hierarchy



    jcharts-0.7.5/javadocs/org/jCharts/encoders/PNGEncoder.html0000644000175000001440000002630007751071400022607 0ustar onkarusers PNGEncoder (jCharts-0.7.5 API)

    org.jCharts.encoders
    Class PNGEncoder

    java.lang.Object
      |
      +--org.jCharts.encoders.PNGEncoder
    

    public final class PNGEncoder
    extends java.lang.Object

    This class REQUIRES the jdk 1.4


    Field Summary
    private static java.lang.String PNG
               
     
    Constructor Summary
    private PNGEncoder()
               
     
    Method Summary
    static void encode(Chart chart, java.io.OutputStream outputStream)
              Encodes the Chart to an OutputStream which can be a file or any other OutputStream implementation.
     
    Methods inherited from class java.lang.Object
    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
     

    Field Detail

    PNG

    private static final java.lang.String PNG
    See Also:
    Constant Field Values
    Constructor Detail

    PNGEncoder

    private PNGEncoder()
                throws java.lang.Exception
    Method Detail

    encode

    public static final void encode(Chart chart,
                                    java.io.OutputStream outputStream)
                             throws ChartDataException,
                                    PropertyException,
                                    java.io.IOException
    Encodes the Chart to an OutputStream which can be a file or any other OutputStream implementation.

    Parameters:
    chart -
    outputStream -
    Throws:
    ChartDataException
    PropertyException
    java.io.IOException


    jcharts-0.7.5/javadocs/org/jCharts/encoders/ServletEncoderHelper.html0000644000175000001440000004531407751071400024755 0ustar onkarusers ServletEncoderHelper (jCharts-0.7.5 API)

    org.jCharts.encoders
    Class ServletEncoderHelper

    java.lang.Object
      |
      +--org.jCharts.encoders.ServletEncoderHelper
    

    public class ServletEncoderHelper
    extends java.lang.Object


    Field Summary
    static java.lang.String JPEG_MIME_TYPE
               
    static java.lang.String PNG_MIME_TYPE
               
    static java.lang.String SVG_MIME_TYPE
               
     
    Constructor Summary
    ServletEncoderHelper()
               
     
    Method Summary
    static void encodeJPEG(Chart chart, float quality, javax.servlet.http.HttpServletResponse httpServletResponse)
              Convenience method to call from a Servlet or JSP.
    static void encodeJPEG13(Chart chart, float quality, javax.servlet.http.HttpServletResponse httpServletResponse)
              Convenience method to call from a Servlet or JSP.
    static void encodePNG(Chart chart, javax.servlet.http.HttpServletResponse httpServletResponse)
              Convenience method to call from a Servlet or JSP.
    static void encodeServlet(Chart chart, javax.servlet.http.HttpServletResponse httpServletResponse)
              Convenience method to call from a Servlet or JSP.
     
    Methods inherited from class java.lang.Object
    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
     

    Field Detail

    SVG_MIME_TYPE

    public static final java.lang.String SVG_MIME_TYPE
    See Also:
    Constant Field Values

    PNG_MIME_TYPE

    public static final java.lang.String PNG_MIME_TYPE
    See Also:
    Constant Field Values

    JPEG_MIME_TYPE

    public static final java.lang.String JPEG_MIME_TYPE
    See Also:
    Constant Field Values
    Constructor Detail

    ServletEncoderHelper

    public ServletEncoderHelper()
    Method Detail

    encodeServlet

    public static final void encodeServlet(Chart chart,
                                           javax.servlet.http.HttpServletResponse httpServletResponse)
                                    throws ChartDataException,
                                           PropertyException,
                                           java.io.IOException
    Convenience method to call from a Servlet or JSP. This method will set the appropriate mime type and then export the chart as the response. We cannot overload encode(...) as it will create a compile time dependency with the HttpServletResponse Class which will require the J2EE libraries.

    Parameters:
    chart -
    httpServletResponse -
    Throws:
    ChartDataException
    PropertyException
    java.io.IOException
    Since:
    0.7

    encodeJPEG13

    public static final void encodeJPEG13(Chart chart,
                                          float quality,
                                          javax.servlet.http.HttpServletResponse httpServletResponse)
                                   throws ChartDataException,
                                          PropertyException,
                                          java.io.IOException
    Convenience method to call from a Servlet or JSP. This method will set the appropriate mime type and then export the chart as the response. We cannot overload encode(...) as it will create a compile time dependency with the HttpServletResponse Class which will require the J2EE libraries.

    Parameters:
    chart -
    quality - float value from 0.0f(worst image quality) - 1.0f(best image quality)
    httpServletResponse -
    Throws:
    ChartDataException
    PropertyException
    java.io.IOException
    Since:
    0.7

    encodeJPEG

    public static final void encodeJPEG(Chart chart,
                                        float quality,
                                        javax.servlet.http.HttpServletResponse httpServletResponse)
                                 throws ChartDataException,
                                        PropertyException,
                                        java.io.IOException
    Convenience method to call from a Servlet or JSP. This method will set the appropriate mime type and then export the chart as the response.

    Parameters:
    chart -
    quality - float value from 0.0f(worst image quality) - 1.0f(best image quality)
    httpServletResponse -
    Throws:
    ChartDataException
    PropertyException
    java.io.IOException

    encodePNG

    public static final void encodePNG(Chart chart,
                                       javax.servlet.http.HttpServletResponse httpServletResponse)
                                throws ChartDataException,
                                       PropertyException,
                                       java.io.IOException
    Convenience method to call from a Servlet or JSP. This method will set the appropriate mime type and then export the chart as the response.

    Parameters:
    chart -
    httpServletResponse -
    Throws:
    ChartDataException
    PropertyException
    java.io.IOException


    jcharts-0.7.5/javadocs/org/jCharts/encoders/SVGEncoder.html0000644000175000001440000002364507751071400022633 0ustar onkarusers SVGEncoder (jCharts-0.7.5 API)

    org.jCharts.encoders
    Class SVGEncoder

    java.lang.Object
      |
      +--org.jCharts.encoders.SVGEncoder
    

    public final class SVGEncoder
    extends java.lang.Object

    This class REQUIRES the Apache XML Batik libraries to run.


    Constructor Summary
    private SVGEncoder()
               
     
    Method Summary
    static void encode(Chart chart, java.io.OutputStream outputStream)
              Encodes the Chart to an OutputStream which can be a file or any other OutputStream implementation.
     
    Methods inherited from class java.lang.Object
    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
     

    Constructor Detail

    SVGEncoder

    private SVGEncoder()
                throws java.lang.Exception
    Method Detail

    encode

    public static final void encode(Chart chart,
                                    java.io.OutputStream outputStream)
                             throws ChartDataException,
                                    PropertyException,
                                    java.io.IOException
    Encodes the Chart to an OutputStream which can be a file or any other OutputStream implementation.

    Parameters:
    chart -
    outputStream -
    Throws:
    ChartDataException
    PropertyException
    java.io.IOException


    jcharts-0.7.5/javadocs/org/jCharts/imageMap/0000755000175000001440000000000007751071404017716 5ustar onkarusersjcharts-0.7.5/javadocs/org/jCharts/imageMap/AreaShape.html0000644000175000001440000002760307751071400022441 0ustar onkarusers AreaShape (jCharts-0.7.5 API)

    org.jCharts.imageMap
    Class AreaShape

    java.lang.Object
      |
      +--org.jCharts.imageMap.AreaShape
    
    All Implemented Interfaces:
    java.io.Serializable

    public class AreaShape
    extends java.lang.Object
    implements java.io.Serializable

    See Also:
    Serialized Form

    Field Summary
    static AreaShape CIRCLE
               
    static AreaShape POLYGON
               
    static AreaShape RECTANGLE
               
    private  java.lang.String value
               
     
    Constructor Summary
    private AreaShape(java.lang.String value)
               
     
    Method Summary
     java.lang.String getValue()
               
     
    Methods inherited from class java.lang.Object
    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
     

    Field Detail

    RECTANGLE

    public static final AreaShape RECTANGLE

    CIRCLE

    public static final AreaShape CIRCLE

    POLYGON

    public static final AreaShape POLYGON

    value

    private java.lang.String value
    Constructor Detail

    AreaShape

    private AreaShape(java.lang.String value)
    Parameters:
    value -
    Method Detail

    getValue

    public java.lang.String getValue()
    Returns:
    value


    jcharts-0.7.5/javadocs/org/jCharts/imageMap/CircleMapArea.html0000644000175000001440000003737007751071400023242 0ustar onkarusers CircleMapArea (jCharts-0.7.5 API)

    org.jCharts.imageMap
    Class CircleMapArea

    java.lang.Object
      |
      +--org.jCharts.imageMap.ImageMapArea
            |
            +--org.jCharts.imageMap.CircleMapArea
    
    All Implemented Interfaces:
    java.io.Serializable

    public final class CircleMapArea
    extends ImageMapArea
    implements java.io.Serializable

    See Also:
    Serialized Form

    Field Summary
    private  int radius
               
     
    Fields inherited from class org.jCharts.imageMap.ImageMapArea
    x, y
     
    Constructor Summary
    CircleMapArea(float x, float y, double value, java.lang.String xAxisLabel, java.lang.String legendLabel)
               
    CircleMapArea(float x, float y, java.awt.geom.Point2D.Double value, java.lang.String legendLabel)
               
     
    Method Summary
     AreaShape getAreaShape()
               
    protected  void getCoordinates(java.lang.StringBuffer html)
              Appends the coordinates to the passed html buffer.
     void setRadius(int radius)
              Allows user to specify the radius for each circle
     
    Methods inherited from class org.jCharts.imageMap.ImageMapArea
    getLengendLabel, getNumberOfCoordinates, getValue, getXAxisLabel, getXCoordinate, getYCoordinate, toHTML
     
    Methods inherited from class java.lang.Object
    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
     

    Field Detail

    radius

    private int radius
    Constructor Detail

    CircleMapArea

    public CircleMapArea(float x,
                         float y,
                         double value,
                         java.lang.String xAxisLabel,
                         java.lang.String legendLabel)
    Parameters:
    x -
    y -
    value -
    xAxisLabel -
    legendLabel -

    CircleMapArea

    public CircleMapArea(float x,
                         float y,
                         java.awt.geom.Point2D.Double value,
                         java.lang.String legendLabel)
    Parameters:
    x -
    y -
    value -
    legendLabel -
    Method Detail

    getAreaShape

    public AreaShape getAreaShape()
    Specified by:
    getAreaShape in class ImageMapArea
    Returns:
    AreaShape

    setRadius

    public void setRadius(int radius)
    Allows user to specify the radius for each circle

    Parameters:
    radius -

    getCoordinates

    protected void getCoordinates(java.lang.StringBuffer html)
    Description copied from class: ImageMapArea
    Appends the coordinates to the passed html buffer. This is needed to facilitate the 'circle' map areas 'radius' value.

    Overrides:
    getCoordinates in class ImageMapArea
    Parameters:
    html - pass a reference to the StringBuffer so I can minimize Object creation


    jcharts-0.7.5/javadocs/org/jCharts/imageMap/ImageMap.html0000644000175000001440000002666407751071400022276 0ustar onkarusers ImageMap (jCharts-0.7.5 API)

    org.jCharts.imageMap
    Class ImageMap

    java.lang.Object
      |
      +--org.jCharts.imageMap.ImageMap
    
    All Implemented Interfaces:
    java.io.Serializable

    public final class ImageMap
    extends java.lang.Object
    implements java.io.Serializable

    See Also:
    Serialized Form

    Field Summary
    private  java.util.ArrayList areas
               
     
    Constructor Summary
    ImageMap(int size)
               
     
    Method Summary
     void addImageMapArea(ImageMapArea imageMapArea)
               
     java.util.Iterator getIterator()
               
     java.lang.String toHTML()
               
     
    Methods inherited from class java.lang.Object
    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
     

    Field Detail

    areas

    private java.util.ArrayList areas
    Constructor Detail

    ImageMap

    public ImageMap(int size)
    Parameters:
    size - the number of areas
    Method Detail

    addImageMapArea

    public void addImageMapArea(ImageMapArea imageMapArea)
    Parameters:
    imageMapArea -

    getIterator

    public java.util.Iterator getIterator()

    toHTML

    public java.lang.String toHTML()


    jcharts-0.7.5/javadocs/org/jCharts/imageMap/ImageMapArea.html0000644000175000001440000005050607751071400023057 0ustar onkarusers ImageMapArea (jCharts-0.7.5 API)

    org.jCharts.imageMap
    Class ImageMapArea

    java.lang.Object
      |
      +--org.jCharts.imageMap.ImageMapArea
    
    All Implemented Interfaces:
    java.io.Serializable
    Direct Known Subclasses:
    CircleMapArea, PolyMapArea, RectMapArea

    public abstract class ImageMapArea
    extends java.lang.Object
    implements java.io.Serializable

    See Also:
    Serialized Form

    Field Summary
    private  java.lang.String legendLabel
               
    private  double value
               
    (package private)  int[] x
               
    private  java.lang.String xAxisLabel
               
    (package private)  int[] y
               
     
    Constructor Summary
    (package private) ImageMapArea(int numberOfPoints, double value, java.lang.String xAxisLabel, java.lang.String legendLabel)
               
    (package private) ImageMapArea(int numberOfPoints, java.awt.geom.Point2D.Double point, java.lang.String legendLabel)
               
     
    Method Summary
    (package private) abstract  AreaShape getAreaShape()
               
    protected  void getCoordinates(java.lang.StringBuffer html)
              Appends the coordinates to the passed html buffer.
     java.lang.String getLengendLabel()
              Returns the legend label represented by this map area.
     int getNumberOfCoordinates()
              Returns the number of x,y coordinate pairs stored for the area
     double getValue()
              Returns the data set value represented by this map.
     java.lang.String getXAxisLabel()
              Rather than create an AxisChart specifc map area class just for this field, i put it here.
     int getXCoordinate(int index)
              Returns the x coordinate at the specified index.
     int getYCoordinate(int index)
              Returns the y coordinate at the specified index.
     java.lang.String toHTML(java.lang.String mapElementAttributes)
              Returns a
     
    Methods inherited from class java.lang.Object
    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
     

    Field Detail

    x

    int[] x

    y

    int[] y

    value

    private double value

    xAxisLabel

    private java.lang.String xAxisLabel

    legendLabel

    private java.lang.String legendLabel
    Constructor Detail

    ImageMapArea

    ImageMapArea(int numberOfPoints,
                 double value,
                 java.lang.String xAxisLabel,
                 java.lang.String legendLabel)
    Parameters:
    numberOfPoints -
    value -
    xAxisLabel -
    legendLabel -

    ImageMapArea

    ImageMapArea(int numberOfPoints,
                 java.awt.geom.Point2D.Double point,
                 java.lang.String legendLabel)
    Parameters:
    numberOfPoints -
    point -
    legendLabel -
    Method Detail

    getAreaShape

    abstract AreaShape getAreaShape()
    Returns:
    AreaShape

    getNumberOfCoordinates

    public final int getNumberOfCoordinates()
    Returns the number of x,y coordinate pairs stored for the area

    Returns:
    int

    getXCoordinate

    public final int getXCoordinate(int index)
    Returns the x coordinate at the specified index. Not returned as a Point Object so we can avoid uneeded Object creation/destruction overhead.

    Returns:
    int

    getYCoordinate

    public final int getYCoordinate(int index)
    Returns the y coordinate at the specified index. Not returned as a Point Object so we can avoid uneeded Object creation/destruction overhead.

    Returns:
    int

    getValue

    public final double getValue()
    Returns the data set value represented by this map.

    Returns:
    double

    getXAxisLabel

    public final java.lang.String getXAxisLabel()
    Rather than create an AxisChart specifc map area class just for this field, i put it here. This is not applicable for PieCharts.

    Returns:
    String will return NULL for PieCharts

    getLengendLabel

    public final java.lang.String getLengendLabel()
    Returns the legend label represented by this map area. Will be NULL if you did not pass a name to the data set constructor.

    Returns:
    String

    getCoordinates

    protected void getCoordinates(java.lang.StringBuffer html)
    Appends the coordinates to the passed html buffer. This is needed to facilitate the 'circle' map areas 'radius' value.

    Parameters:
    html - pass a reference to the StringBuffer so I can minimize Object creation

    toHTML

    public final java.lang.String toHTML(java.lang.String mapElementAttributes)
    Returns a
    HTML element. The mapElementAttributes frees this method from having to declare all attributes of the HTML map element.

    Parameters:
    mapElementAttributes - allows you to place any map attributes you want: href, alt, onClick, onMouseOver, etc...
    Returns:
    String the HTML


    jcharts-0.7.5/javadocs/org/jCharts/imageMap/ImageMapNotSupportedException.html0000644000175000001440000002361007751071400026530 0ustar onkarusers ImageMapNotSupportedException (jCharts-0.7.5 API)

    org.jCharts.imageMap
    Class ImageMapNotSupportedException

    java.lang.Object
      |
      +--java.lang.Throwable
            |
            +--java.lang.Exception
                  |
                  +--java.lang.RuntimeException
                        |
                        +--org.jCharts.imageMap.ImageMapNotSupportedException
    
    All Implemented Interfaces:
    java.io.Serializable

    public class ImageMapNotSupportedException
    extends java.lang.RuntimeException

    See Also:
    Serialized Form

    Field Summary
     
    Fields inherited from class java.lang.RuntimeException
     
    Fields inherited from class java.lang.Throwable
     
    Constructor Summary
    ImageMapNotSupportedException(java.lang.String message)
               
     
    Methods inherited from class java.lang.Throwable
    fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
     
    Methods inherited from class java.lang.Object
    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
     

    Constructor Detail

    ImageMapNotSupportedException

    public ImageMapNotSupportedException(java.lang.String message)
    Parameters:
    message -


    jcharts-0.7.5/javadocs/org/jCharts/imageMap/package-frame.html0000644000175000001440000000313007751071376023274 0ustar onkarusers org.jCharts.imageMap (jCharts-0.7.5 API) org.jCharts.imageMap
    Classes 
    AreaShape
    CircleMapArea
    ImageMap
    ImageMapArea
    PolyMapArea
    RectMapArea
    Exceptions 
    ImageMapNotSupportedException
    jcharts-0.7.5/javadocs/org/jCharts/imageMap/package-summary.html0000644000175000001440000001457707751071376023720 0ustar onkarusers org.jCharts.imageMap (jCharts-0.7.5 API)

    Package org.jCharts.imageMap

    Class Summary
    AreaShape  
    CircleMapArea  
    ImageMap  
    ImageMapArea  
    PolyMapArea  
    RectMapArea  
     

    Exception Summary
    ImageMapNotSupportedException  
     



    jcharts-0.7.5/javadocs/org/jCharts/imageMap/package-tree.html0000644000175000001440000001467307751071376023157 0ustar onkarusers org.jCharts.imageMap Class Hierarchy (jCharts-0.7.5 API)

    Hierarchy For Package org.jCharts.imageMap

    Package Hierarchies:
    All Packages

    Class Hierarchy



    jcharts-0.7.5/javadocs/org/jCharts/imageMap/PolyMapArea.html0000644000175000001440000003224207751071400022755 0ustar onkarusers PolyMapArea (jCharts-0.7.5 API)

    org.jCharts.imageMap
    Class PolyMapArea

    java.lang.Object
      |
      +--org.jCharts.imageMap.ImageMapArea
            |
            +--org.jCharts.imageMap.PolyMapArea
    
    All Implemented Interfaces:
    java.io.Serializable

    public final class PolyMapArea
    extends ImageMapArea
    implements java.io.Serializable

    See Also:
    Serialized Form

    Field Summary
     
    Fields inherited from class org.jCharts.imageMap.ImageMapArea
    x, y
     
    Constructor Summary
    PolyMapArea(int numberOfPoints, double value, java.lang.String xAxisLabel, java.lang.String legendLabel)
               
     
    Method Summary
     void addCoordinate(int index, float x, float y)
              Adds the x, y coordinate at the specified index.
     AreaShape getAreaShape()
               
     
    Methods inherited from class org.jCharts.imageMap.ImageMapArea
    getCoordinates, getLengendLabel, getNumberOfCoordinates, getValue, getXAxisLabel, getXCoordinate, getYCoordinate, toHTML
     
    Methods inherited from class java.lang.Object
    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
     

    Constructor Detail

    PolyMapArea

    public PolyMapArea(int numberOfPoints,
                       double value,
                       java.lang.String xAxisLabel,
                       java.lang.String legendLabel)
    Parameters:
    numberOfPoints -
    value -
    Method Detail

    addCoordinate

    public void addCoordinate(int index,
                              float x,
                              float y)
    Adds the x, y coordinate at the specified index. Not added as a Point Object so we can avoid uneeded Object creation/destruction overhead.

    Parameters:
    index -
    x -
    y -

    getAreaShape

    public AreaShape getAreaShape()
    Specified by:
    getAreaShape in class ImageMapArea
    Returns:
    AreaShape


    jcharts-0.7.5/javadocs/org/jCharts/imageMap/RectMapArea.html0000644000175000001440000003030607751071400022726 0ustar onkarusers RectMapArea (jCharts-0.7.5 API)

    org.jCharts.imageMap
    Class RectMapArea

    java.lang.Object
      |
      +--org.jCharts.imageMap.ImageMapArea
            |
            +--org.jCharts.imageMap.RectMapArea
    
    All Implemented Interfaces:
    java.io.Serializable

    public final class RectMapArea
    extends ImageMapArea
    implements java.io.Serializable

    See Also:
    Serialized Form

    Field Summary
     
    Fields inherited from class org.jCharts.imageMap.ImageMapArea
    x, y
     
    Constructor Summary
    RectMapArea(java.awt.geom.Rectangle2D.Float rectangle, double value, java.lang.String xAxisLabel, java.lang.String legendLabel)
               
     
    Method Summary
     AreaShape getAreaShape()
               
     
    Methods inherited from class org.jCharts.imageMap.ImageMapArea
    getCoordinates, getLengendLabel, getNumberOfCoordinates, getValue, getXAxisLabel, getXCoordinate, getYCoordinate, toHTML
     
    Methods inherited from class java.lang.Object
    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
     

    Constructor Detail

    RectMapArea

    public RectMapArea(java.awt.geom.Rectangle2D.Float rectangle,
                       double value,
                       java.lang.String xAxisLabel,
                       java.lang.String legendLabel)
    Parameters:
    rectangle -
    value -
    xAxisLabel -
    legendLabel -
    Method Detail

    getAreaShape

    public AreaShape getAreaShape()
    Specified by:
    getAreaShape in class ImageMapArea
    Returns:
    AreaShape


    jcharts-0.7.5/javadocs/org/jCharts/nonAxisChart/0000755000175000001440000000000007751071404020577 5ustar onkarusersjcharts-0.7.5/javadocs/org/jCharts/nonAxisChart/package-frame.html0000644000175000001440000000176207751071376024166 0ustar onkarusers org.jCharts.nonAxisChart (jCharts-0.7.5 API) org.jCharts.nonAxisChart
    Classes 
    PieChart2D
    jcharts-0.7.5/javadocs/org/jCharts/nonAxisChart/package-summary.html0000644000175000001440000001250707751071376024570 0ustar onkarusers org.jCharts.nonAxisChart (jCharts-0.7.5 API)

    Package org.jCharts.nonAxisChart

    Class Summary
    PieChart2D  
     



    jcharts-0.7.5/javadocs/org/jCharts/nonAxisChart/package-tree.html0000644000175000001440000001301107751071376024021 0ustar onkarusers org.jCharts.nonAxisChart Class Hierarchy (jCharts-0.7.5 API)

    Hierarchy For Package org.jCharts.nonAxisChart

    Package Hierarchies:
    All Packages

    Class Hierarchy



    jcharts-0.7.5/javadocs/org/jCharts/nonAxisChart/PieChart2D.html0000644000175000001440000004634507751071400023362 0ustar onkarusers PieChart2D (jCharts-0.7.5 API)

    org.jCharts.nonAxisChart
    Class PieChart2D

    java.lang.Object
      |
      +--org.jCharts.Chart
            |
            +--org.jCharts.nonAxisChart.PieChart2D
    
    All Implemented Interfaces:
    HTMLChartTestable, java.io.Serializable

    public final class PieChart2D
    extends Chart
    implements HTMLChartTestable

    See Also:
    Serialized Form

    Field Summary
    private  float diameter
               
    private  IPieChartDataSet iPieChartDataSet
               
    private  PieChartDataProcessor pieChartDataProcessor
               
    private  float pieX
               
    private  float pieY
               
    private  TextTagGroup textTagGroup
               
     
    Fields inherited from class org.jCharts.Chart
     
    Constructor Summary
    PieChart2D(IPieChartDataSet iPieChartDataSet, LegendProperties legendProperties, ChartProperties chartProperties, int pixelWidth, int pixelHeight)
              Constructor
     
    Method Summary
    (package private) static void render(PieChart2D pieChart2D)
              Implement the method to render the Chart.
    protected  void renderChart()
              Draws the chart
     void toHTML(HTMLGenerator htmlGenerator, java.lang.String imageFileName)
              Enables the testing routines to display the contents of this Object.
     
    Methods inherited from class org.jCharts.Chart
    getBufferedImage, getChartProperties, getGenerateImageMapFlag, getGraphics2D, getImageHeight, getImageMap, getImageWidth, getLegend, hasLegend, render, renderChartTitle, renderWithImageMap, setGraphics2D, setImageMap, toHTML
     
    Methods inherited from class java.lang.Object
    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
     
    Methods inherited from interface org.jCharts.test.HTMLChartTestable
    toHTML
     

    Field Detail

    pieX

    private float pieX

    pieY

    private float pieY

    diameter

    private float diameter

    iPieChartDataSet

    private IPieChartDataSet iPieChartDataSet

    pieChartDataProcessor

    private PieChartDataProcessor pieChartDataProcessor

    textTagGroup

    private TextTagGroup textTagGroup
    Constructor Detail

    PieChart2D

    public PieChart2D(IPieChartDataSet iPieChartDataSet,
                      LegendProperties legendProperties,
                      ChartProperties chartProperties,
                      int pixelWidth,
                      int pixelHeight)
    Constructor

    Parameters:
    iPieChartDataSet -
    legendProperties -
    chartProperties - general chart properties
    pixelWidth -
    pixelHeight -
    Method Detail

    renderChart

    protected void renderChart()
    Draws the chart

    Specified by:
    renderChart in class Chart

    render

    static void render(PieChart2D pieChart2D)
    Implement the method to render the Chart.

    Parameters:
    pieChart2D -

    toHTML

    public void toHTML(HTMLGenerator htmlGenerator,
                       java.lang.String imageFileName)
    Enables the testing routines to display the contents of this Object. Override Chart implementation as PieCharts use AreaProperties directly rather than a child.

    Parameters:
    htmlGenerator -
    imageFileName -


    jcharts-0.7.5/javadocs/org/jCharts/properties/0000755000175000001440000000000007751071404020372 5ustar onkarusersjcharts-0.7.5/javadocs/org/jCharts/properties/util/0000755000175000001440000000000007751071404021347 5ustar onkarusersjcharts-0.7.5/javadocs/org/jCharts/properties/util/ChartFont.html0000644000175000001440000004262007751071400024125 0ustar onkarusers ChartFont (jCharts-0.7.5 API)

    org.jCharts.properties.util
    Class ChartFont

    java.lang.Object
      |
      +--org.jCharts.properties.util.ChartItem
            |
            +--org.jCharts.properties.util.ChartFont
    

    public class ChartFont
    extends ChartItem


    Field Summary
    private  java.awt.geom.AffineTransform affineTransform
               
    static ChartFont DEFAULT_AXIS_SCALE
               
    static ChartFont DEFAULT_AXIS_TITLE
               
    static ChartFont DEFAULT_AXIS_VALUE
               
    static ChartFont DEFAULT_CHART_TITLE
               
    static ChartFont DEFAULT_PIE_VALUE
               
    private  java.awt.Font font
               
    static java.awt.geom.AffineTransform VERTICAL_ROTATION
               
     
    Fields inherited from class org.jCharts.properties.util.ChartItem
     
    Constructor Summary
    ChartFont(java.awt.Font font, java.awt.Paint paint)
               
     
    Method Summary
     java.awt.Font deriveFont()
               
     java.awt.Font getFont()
               
     void setupGraphics2D(java.awt.Graphics2D graphics2D)
              Sets the Paint and Stroke implementations on the Graphics2D Object
     
    Methods inherited from class org.jCharts.properties.util.ChartItem
    getPaint
     
    Methods inherited from class java.lang.Object
    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
     

    Field Detail

    DEFAULT_AXIS_TITLE

    public static final ChartFont DEFAULT_AXIS_TITLE

    DEFAULT_AXIS_VALUE

    public static final ChartFont DEFAULT_AXIS_VALUE

    DEFAULT_AXIS_SCALE

    public static final ChartFont DEFAULT_AXIS_SCALE

    DEFAULT_PIE_VALUE

    public static final ChartFont DEFAULT_PIE_VALUE

    DEFAULT_CHART_TITLE

    public static final ChartFont DEFAULT_CHART_TITLE

    VERTICAL_ROTATION

    public static final java.awt.geom.AffineTransform VERTICAL_ROTATION

    font

    private java.awt.Font font

    affineTransform

    private java.awt.geom.AffineTransform affineTransform
    Constructor Detail

    ChartFont

    public ChartFont(java.awt.Font font,
                     java.awt.Paint paint)
    Parameters:
    font -
    paint -
    Method Detail

    setupGraphics2D

    public void setupGraphics2D(java.awt.Graphics2D graphics2D)
    Sets the Paint and Stroke implementations on the Graphics2D Object

    Overrides:
    setupGraphics2D in class ChartItem
    Parameters:
    graphics2D -

    getFont

    public java.awt.Font getFont()
    Returns:
    font

    deriveFont

    public java.awt.Font deriveFont()
    Returns:
    boolean public boolean isAntiAliased() { return isAntiAliased; } /**************************************************************************************


    jcharts-0.7.5/javadocs/org/jCharts/properties/util/ChartItem.html0000644000175000001440000002752107751071400024120 0ustar onkarusers ChartItem (jCharts-0.7.5 API)

    org.jCharts.properties.util
    Class ChartItem

    java.lang.Object
      |
      +--org.jCharts.properties.util.ChartItem
    
    Direct Known Subclasses:
    ChartFont, ChartStroke

    public abstract class ChartItem
    extends java.lang.Object


    Field Summary
    private static java.awt.Paint DEFAULT_PAINT
               
    private  java.awt.Paint paint
               
     
    Constructor Summary
    ChartItem()
               
    ChartItem(java.awt.Paint paint)
               
     
    Method Summary
     java.awt.Paint getPaint()
               
     void setupGraphics2D(java.awt.Graphics2D graphics2D)
              Sets the Paint and Stroke implementations on the Graphics2D Object
     
    Methods inherited from class java.lang.Object
    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
     

    Field Detail

    DEFAULT_PAINT

    private static final java.awt.Paint DEFAULT_PAINT

    paint

    private java.awt.Paint paint
    Constructor Detail

    ChartItem

    public ChartItem()

    ChartItem

    public ChartItem(java.awt.Paint paint)
    Method Detail

    getPaint

    public java.awt.Paint getPaint()

    setupGraphics2D

    public void setupGraphics2D(java.awt.Graphics2D graphics2D)
    Sets the Paint and Stroke implementations on the Graphics2D Object

    Parameters:
    graphics2D -


    jcharts-0.7.5/javadocs/org/jCharts/properties/util/ChartStroke.html0000644000175000001440000004620707751071400024473 0ustar onkarusers ChartStroke (jCharts-0.7.5 API)

    org.jCharts.properties.util
    Class ChartStroke

    java.lang.Object
      |
      +--org.jCharts.properties.util.ChartItem
            |
            +--org.jCharts.properties.util.ChartStroke
    

    public class ChartStroke
    extends ChartItem

    Immutable Class to simplify the use of Strokes in Charts


    Field Summary
    static ChartStroke DEFAULT_AXIS
               
    static ChartStroke DEFAULT_BAR_OUTLINE
               
    static ChartStroke DEFAULT_CHART_OUTLINE
               
    static ChartStroke DEFAULT_GRIDLINES
               
    static ChartStroke DEFAULT_LEGEND_OUTLINE
               
    private static java.awt.Stroke DEFAULT_STROKE
               
    private static java.awt.Stroke DEFAULT_STROKE_1_5
               
    static ChartStroke DEFAULT_TICKS
               
    static ChartStroke DEFAULT_ZERO_LINE
               
    private  java.awt.Stroke stroke
               
     
    Fields inherited from class org.jCharts.properties.util.ChartItem
     
    Constructor Summary
    ChartStroke(java.awt.Stroke stroke, java.awt.Paint paint)
               
     
    Method Summary
     void draw(java.awt.Graphics2D graphics2D, java.awt.Shape shape)
               
     void fill(java.awt.Graphics2D graphics2D, java.awt.Shape shape)
               
     void setupGraphics2D(java.awt.Graphics2D graphics2D)
              Sets the Paint and Stroke implementations on the Graphics2D Object
     
    Methods inherited from class org.jCharts.properties.util.ChartItem
    getPaint
     
    Methods inherited from class java.lang.Object
    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
     

    Field Detail

    DEFAULT_STROKE

    private static final java.awt.Stroke DEFAULT_STROKE

    DEFAULT_STROKE_1_5

    private static final java.awt.Stroke DEFAULT_STROKE_1_5

    DEFAULT_AXIS

    public static final ChartStroke DEFAULT_AXIS

    DEFAULT_GRIDLINES

    public static final ChartStroke DEFAULT_GRIDLINES

    DEFAULT_TICKS

    public static final ChartStroke DEFAULT_TICKS

    DEFAULT_ZERO_LINE

    public static final ChartStroke DEFAULT_ZERO_LINE

    DEFAULT_BAR_OUTLINE

    public static final ChartStroke DEFAULT_BAR_OUTLINE

    DEFAULT_CHART_OUTLINE

    public static final ChartStroke DEFAULT_CHART_OUTLINE

    DEFAULT_LEGEND_OUTLINE

    public static final ChartStroke DEFAULT_LEGEND_OUTLINE

    stroke

    private java.awt.Stroke stroke
    Constructor Detail

    ChartStroke

    public ChartStroke(java.awt.Stroke stroke,
                       java.awt.Paint paint)
    Parameters:
    stroke -
    paint -
    Method Detail

    setupGraphics2D

    public void setupGraphics2D(java.awt.Graphics2D graphics2D)
    Sets the Paint and Stroke implementations on the Graphics2D Object

    Overrides:
    setupGraphics2D in class ChartItem
    Parameters:
    graphics2D -

    draw

    public void draw(java.awt.Graphics2D graphics2D,
                     java.awt.Shape shape)
    Parameters:
    graphics2D -
    shape -

    fill

    public void fill(java.awt.Graphics2D graphics2D,
                     java.awt.Shape shape)
    Parameters:
    graphics2D -
    shape -


    jcharts-0.7.5/javadocs/org/jCharts/properties/util/package-frame.html0000644000175000001440000000221507751071376024730 0ustar onkarusers org.jCharts.properties.util (jCharts-0.7.5 API) org.jCharts.properties.util
    Classes 
    ChartFont
    ChartItem
    ChartStroke
    jcharts-0.7.5/javadocs/org/jCharts/properties/util/package-summary.html0000644000175000001440000001331007751071376025331 0ustar onkarusers org.jCharts.properties.util (jCharts-0.7.5 API)

    Package org.jCharts.properties.util

    Class Summary
    ChartFont  
    ChartItem  
    ChartStroke Immutable Class to simplify the use of Strokes in Charts
     



    jcharts-0.7.5/javadocs/org/jCharts/properties/util/package-tree.html0000644000175000001440000001316007751071376024576 0ustar onkarusers org.jCharts.properties.util Class Hierarchy (jCharts-0.7.5 API)

    Hierarchy For Package org.jCharts.properties.util

    Package Hierarchies:
    All Packages

    Class Hierarchy



    jcharts-0.7.5/javadocs/org/jCharts/properties/AreaChartProperties.html0000644000175000001440000003252207751071400025167 0ustar onkarusers AreaChartProperties (jCharts-0.7.5 API)

    org.jCharts.properties
    Class AreaChartProperties

    java.lang.Object
      |
      +--org.jCharts.properties.ChartTypeProperties
            |
            +--org.jCharts.properties.AxisChartTypeProperties
                  |
                  +--org.jCharts.properties.AreaChartProperties
    
    All Implemented Interfaces:
    HTMLTestable
    Direct Known Subclasses:
    StackedAreaChartProperties

    public class AreaChartProperties
    extends AxisChartTypeProperties


    Field Summary
     
    Fields inherited from class org.jCharts.properties.AxisChartTypeProperties
     
    Constructor Summary
    AreaChartProperties()
               
     
    Method Summary
     void toHTML(HTMLGenerator htmlGenerator)
              Enables the testing routines to display the contents of this Object.
     void validate(IAxisPlotDataSet iAxisPlotDataSet)
              Validates the properties.
     
    Methods inherited from class org.jCharts.properties.AxisChartTypeProperties
    addPostRenderEventListener, addPreRenderEventListener, firePostRender, firePreRender
     
    Methods inherited from class java.lang.Object
    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
     

    Constructor Detail

    AreaChartProperties

    public AreaChartProperties()
    Method Detail

    validate

    public void validate(IAxisPlotDataSet iAxisPlotDataSet)
                  throws PropertyException
    Validates the properties.

    Specified by:
    validate in class AxisChartTypeProperties
    Parameters:
    iAxisPlotDataSet -
    Throws:
    PropertyException

    toHTML

    public void toHTML(HTMLGenerator htmlGenerator)
    Enables the testing routines to display the contents of this Object.

    Parameters:
    htmlGenerator -


    jcharts-0.7.5/javadocs/org/jCharts/properties/AreaProperties.html0000644000175000001440000004074107751071400024207 0ustar onkarusers AreaProperties (jCharts-0.7.5 API)

    org.jCharts.properties
    Class AreaProperties

    java.lang.Object
      |
      +--org.jCharts.properties.Properties
            |
            +--org.jCharts.properties.AreaProperties
    
    All Implemented Interfaces:
    HTMLTestable, java.io.Serializable
    Direct Known Subclasses:
    ChartProperties, LegendAreaProperties

    public class AreaProperties
    extends Properties
    implements HTMLTestable

    See Also:
    Serialized Form

    Field Summary
    private  ChartStroke borderStroke
               
    private  float edgePadding
               
     
    Fields inherited from class org.jCharts.properties.Properties
    DEFAULT_BACKGROUND_PAINT
     
    Constructor Summary
    AreaProperties()
               
     
    Method Summary
     ChartStroke getBorderStroke()
              Returns the border Stroke
     float getEdgePadding()
              Returns the number of pixels to pad the edges of the image
     void setBorderStroke(ChartStroke chartStroke)
              Sets the border Stroke.
     void setEdgePadding(float edgePadding)
              Sets the number of pixels to pad the edges of the image
     void toHTML(HTMLGenerator htmlGenerator)
              Enables the testing routines to display the contents of this Object.
     
    Methods inherited from class org.jCharts.properties.Properties
    getBackgroundPaint, setBackgroundPaint
     
    Methods inherited from class java.lang.Object
    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
     

    Field Detail

    edgePadding

    private float edgePadding

    borderStroke

    private ChartStroke borderStroke
    Constructor Detail

    AreaProperties

    public AreaProperties()
    Method Detail

    getEdgePadding

    public float getEdgePadding()
    Returns the number of pixels to pad the edges of the image

    Returns:
    float

    setEdgePadding

    public void setEdgePadding(float edgePadding)
    Sets the number of pixels to pad the edges of the image

    Parameters:
    edgePadding -

    setBorderStroke

    public void setBorderStroke(ChartStroke chartStroke)
    Sets the border Stroke. If NULL is passed, there will be no border.

    Parameters:
    chartStroke -

    getBorderStroke

    public ChartStroke getBorderStroke()
    Returns the border Stroke

    Returns:
    ChartStroke

    toHTML

    public void toHTML(HTMLGenerator htmlGenerator)
    Enables the testing routines to display the contents of this Object.

    Specified by:
    toHTML in interface HTMLTestable
    Overrides:
    toHTML in class Properties
    Parameters:
    htmlGenerator -


    jcharts-0.7.5/javadocs/org/jCharts/properties/AxisChartTypeProperties.html0000644000175000001440000004317107751071400026067 0ustar onkarusers AxisChartTypeProperties (jCharts-0.7.5 API)

    org.jCharts.properties
    Class AxisChartTypeProperties

    java.lang.Object
      |
      +--org.jCharts.properties.ChartTypeProperties
            |
            +--org.jCharts.properties.AxisChartTypeProperties
    
    All Implemented Interfaces:
    HTMLTestable
    Direct Known Subclasses:
    AreaChartProperties, BarChartProperties, LineChartProperties, PointChartProperties, ScatterPlotProperties, StockChartProperties

    public abstract class AxisChartTypeProperties
    extends ChartTypeProperties
    implements HTMLTestable

    Common parent for all Chart type specific properties Objects.


    Field Summary
    private  java.util.ArrayList postRenderEventListeners
               
    private  java.util.ArrayList preRenderEventListeners
               
     
    Constructor Summary
    AxisChartTypeProperties()
               
     
    Method Summary
     void addPostRenderEventListener(PostAxisValueRenderListener postRenderListener)
              Allows you to get callbacks for custom implementations to render on the axis and to control the renderering on the axis after a value is drawn.
     void addPreRenderEventListener(PreAxisValueRenderListener preRenderListener)
              Allows you to get callbacks for custom implementations to render on the axis and to control the renderering on the axis before a value is drawn.
     void firePostRender(AxisValueRenderEvent axisValueRenderEvent)
               
     void firePreRender(AxisValueRenderEvent axisValueRenderEvent)
               
    abstract  void validate(IAxisPlotDataSet iAxisPlotDataSet)
               
     
    Methods inherited from class java.lang.Object
    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
     
    Methods inherited from interface org.jCharts.test.HTMLTestable
    toHTML
     

    Field Detail

    preRenderEventListeners

    private java.util.ArrayList preRenderEventListeners

    postRenderEventListeners

    private java.util.ArrayList postRenderEventListeners
    Constructor Detail

    AxisChartTypeProperties

    public AxisChartTypeProperties()
    Method Detail

    validate

    public abstract void validate(IAxisPlotDataSet iAxisPlotDataSet)
                           throws PropertyException
    PropertyException

    addPreRenderEventListener

    public void addPreRenderEventListener(PreAxisValueRenderListener preRenderListener)
    Allows you to get callbacks for custom implementations to render on the axis and to control the renderering on the axis before a value is drawn.

    Parameters:
    preRenderListener -

    firePreRender

    public void firePreRender(AxisValueRenderEvent axisValueRenderEvent)
    Parameters:
    axisValueRenderEvent -

    addPostRenderEventListener

    public void addPostRenderEventListener(PostAxisValueRenderListener postRenderListener)
    Allows you to get callbacks for custom implementations to render on the axis and to control the renderering on the axis after a value is drawn.

    Parameters:
    postRenderListener -

    firePostRender

    public void firePostRender(AxisValueRenderEvent axisValueRenderEvent)
    Parameters:
    axisValueRenderEvent -


    jcharts-0.7.5/javadocs/org/jCharts/properties/AxisProperties.html0000644000175000001440000004621307751071400024243 0ustar onkarusers AxisProperties (jCharts-0.7.5 API)

    org.jCharts.properties
    Class AxisProperties

    java.lang.Object
      |
      +--org.jCharts.properties.Properties
            |
            +--org.jCharts.properties.AxisProperties
    
    All Implemented Interfaces:
    HTMLTestable, java.io.Serializable

    public final class AxisProperties
    extends Properties
    implements HTMLTestable

    See Also:
    Serialized Form

    Field Summary
    private  boolean isPlotHorizontal
               
    private  boolean xAxisLabelsAreVertical
               
    private  AxisTypeProperties xAxisProperties
               
    private  AxisTypeProperties yAxisProperties
               
     
    Fields inherited from class org.jCharts.properties.Properties
    DEFAULT_BACKGROUND_PAINT
     
    Constructor Summary
    AxisProperties()
               
    AxisProperties(boolean isHorizontalPlot)
               
    AxisProperties(LabelAxisProperties xAxis, LabelAxisProperties yAxis)
               
     
    Method Summary
     AxisTypeProperties getXAxisProperties()
               
     AxisTypeProperties getYAxisProperties()
               
     boolean isPlotHorizontal()
               
     void setXAxisLabelsAreVertical(boolean xAxisLabelsAreVertical)
               
     void toHTML(HTMLGenerator htmlGenerator)
              Enables the testing routines to display the contents of this Object.
     boolean xAxisLabelsAreVertical()
               
     
    Methods inherited from class org.jCharts.properties.Properties
    getBackgroundPaint, setBackgroundPaint
     
    Methods inherited from class java.lang.Object
    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
     

    Field Detail

    xAxisProperties

    private AxisTypeProperties xAxisProperties

    yAxisProperties

    private AxisTypeProperties yAxisProperties

    isPlotHorizontal

    private boolean isPlotHorizontal

    xAxisLabelsAreVertical

    private boolean xAxisLabelsAreVertical
    Constructor Detail

    AxisProperties

    public AxisProperties(LabelAxisProperties xAxis,
                          LabelAxisProperties yAxis)
    Parameters:
    xAxis -
    yAxis -

    AxisProperties

    public AxisProperties(boolean isHorizontalPlot)
    Parameters:
    isHorizontalPlot -

    AxisProperties

    public AxisProperties()
    Method Detail

    getXAxisProperties

    public AxisTypeProperties getXAxisProperties()

    getYAxisProperties

    public AxisTypeProperties getYAxisProperties()

    isPlotHorizontal

    public boolean isPlotHorizontal()

    xAxisLabelsAreVertical

    public boolean xAxisLabelsAreVertical()

    setXAxisLabelsAreVertical

    public void setXAxisLabelsAreVertical(boolean xAxisLabelsAreVertical)

    toHTML

    public void toHTML(HTMLGenerator htmlGenerator)
    Enables the testing routines to display the contents of this Object.

    Specified by:
    toHTML in interface HTMLTestable
    Overrides:
    toHTML in class Properties
    Parameters:
    htmlGenerator -


    jcharts-0.7.5/javadocs/org/jCharts/properties/AxisTypeProperties.html0000644000175000001440000013155407751071400025110 0ustar onkarusers AxisTypeProperties (jCharts-0.7.5 API)

    org.jCharts.properties
    Class AxisTypeProperties

    java.lang.Object
      |
      +--org.jCharts.properties.Properties
            |
            +--org.jCharts.properties.AxisTypeProperties
    
    All Implemented Interfaces:
    HTMLTestable, java.io.Serializable
    Direct Known Subclasses:
    LabelAxisProperties

    public class AxisTypeProperties
    extends Properties
    implements HTMLTestable

    See Also:
    Serialized Form

    Field Summary
    private  ChartStroke axisStroke
               
    private  float axisTickMarkPixelLength
               
    private  ChartFont axisTitleChartFont
               
    static int GRID_LINES_ALL
               
    static int GRID_LINES_NONE
               
    static int GRID_LINES_ONLY_WITH_LABELS
               
    private  ChartStroke gridLineChartStroke
               
    private  float paddingBetweenAxisAndLabels
               
    private  float paddingBetweenAxisLabels
               
    private  float paddingBetweenAxisTitleAndLabels
               
    private  float paddingBetweenLabelsAndTicks
               
    private  ChartFont scaleChartFont
               
    private  boolean showAxisLabels
               
    private  boolean showEndBorder
               
    private  int showGridLines
               
    private  int showTicks
               
    private  ChartStroke tickChartStroke
               
    static int TICKS_ALL
               
    static int TICKS_NONE
               
    static int TICKS_ONLY_WITH_LABELS
               
    private  ChartFont titleChartFont
               
     
    Fields inherited from class org.jCharts.properties.Properties
    DEFAULT_BACKGROUND_PAINT
     
    Constructor Summary
    AxisTypeProperties()
               
     
    Method Summary
     ChartStroke getAxisStroke()
               
     float getAxisTickMarkPixelLength()
               
     ChartFont getAxisTitleChartFont()
               
     ChartStroke getGridLineChartStroke()
               
     float getPaddingBetweenAxisAndLabels()
               
     float getPaddingBetweenAxisLabels()
               
     float getPaddingBetweenAxisTitleAndLabels()
               
     float getPaddingBetweenLabelsAndTicks()
               
     ChartFont getScaleChartFont()
               
     boolean getShowEndBorder()
               
     int getShowGridLines()
               
     int getShowTicks()
               
     ChartStroke getTickChartStroke()
               
     ChartFont getTitleChartFont()
               
     void setAxisStroke(ChartStroke axisStroke)
               
     void setAxisTickMarkPixelLength(float axisTickMarkPixelLength)
               
     void setAxisTitleChartFont(ChartFont axisTitleChartFont)
               
     void setGridLineChartStroke(ChartStroke gridLineChartStroke)
               
     void setPaddingBetweenAxisAndLabels(float paddingBetweenAxisAndLabels)
               
     void setPaddingBetweenAxisTitleAndLabels(float paddingBetweenAxisTitleAndLabels)
               
     void setPaddingBetweenLabelsAndTicks(float paddingBetweenLabelsAndTicks)
               
     void setPaddingBetweenXAxisLabels(float paddingBetweenAxisLabels)
               
     void setScaleChartFont(ChartFont scaleChartFont)
               
     void setShowAxisLabels(boolean showAxisLabels)
               
     void setShowEndBorder(boolean showEndBorder)
               
     void setShowGridLines(int showGridLines)
               
     void setShowTicks(int showTicks)
               
     void setTickChartStroke(ChartStroke tickChartStroke)
               
     void setTitleChartFont(ChartFont titleChartFont)
               
     boolean showAxisLabels()
               
     void toHTML(HTMLGenerator htmlGenerator)
              Enables the testing routines to display the contents of this Object.
     
    Methods inherited from class org.jCharts.properties.Properties
    getBackgroundPaint, setBackgroundPaint
     
    Methods inherited from class java.lang.Object
    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
     

    Field Detail

    TICKS_NONE

    public static final int TICKS_NONE
    See Also:
    Constant Field Values

    TICKS_ALL

    public static final int TICKS_ALL
    See Also:
    Constant Field Values

    TICKS_ONLY_WITH_LABELS

    public static final int TICKS_ONLY_WITH_LABELS
    See Also:
    Constant Field Values

    GRID_LINES_NONE

    public static final int GRID_LINES_NONE
    See Also:
    Constant Field Values

    GRID_LINES_ALL

    public static final int GRID_LINES_ALL
    See Also:
    Constant Field Values

    GRID_LINES_ONLY_WITH_LABELS

    public static final int GRID_LINES_ONLY_WITH_LABELS
    See Also:
    Constant Field Values

    showTicks

    private int showTicks

    tickChartStroke

    private ChartStroke tickChartStroke

    showGridLines

    private int showGridLines

    gridLineChartStroke

    private ChartStroke gridLineChartStroke

    scaleChartFont

    private ChartFont scaleChartFont

    axisTitleChartFont

    private ChartFont axisTitleChartFont

    axisStroke

    private ChartStroke axisStroke

    paddingBetweenAxisTitleAndLabels

    private float paddingBetweenAxisTitleAndLabels

    axisTickMarkPixelLength

    private float axisTickMarkPixelLength

    paddingBetweenLabelsAndTicks

    private float paddingBetweenLabelsAndTicks

    paddingBetweenAxisAndLabels

    private float paddingBetweenAxisAndLabels

    paddingBetweenAxisLabels

    private float paddingBetweenAxisLabels

    showEndBorder

    private boolean showEndBorder

    showAxisLabels

    private boolean showAxisLabels

    titleChartFont

    private ChartFont titleChartFont
    Constructor Detail

    AxisTypeProperties

    public AxisTypeProperties()
    Method Detail

    getTitleChartFont

    public ChartFont getTitleChartFont()

    setTitleChartFont

    public void setTitleChartFont(ChartFont titleChartFont)

    showAxisLabels

    public boolean showAxisLabels()

    setShowAxisLabels

    public void setShowAxisLabels(boolean showAxisLabels)

    getShowTicks

    public int getShowTicks()

    setShowTicks

    public void setShowTicks(int showTicks)

    getTickChartStroke

    public ChartStroke getTickChartStroke()

    setTickChartStroke

    public void setTickChartStroke(ChartStroke tickChartStroke)

    getShowGridLines

    public int getShowGridLines()

    setShowGridLines

    public void setShowGridLines(int showGridLines)

    getGridLineChartStroke

    public ChartStroke getGridLineChartStroke()

    setGridLineChartStroke

    public void setGridLineChartStroke(ChartStroke gridLineChartStroke)

    getPaddingBetweenAxisTitleAndLabels

    public float getPaddingBetweenAxisTitleAndLabels()

    setPaddingBetweenAxisTitleAndLabels

    public void setPaddingBetweenAxisTitleAndLabels(float paddingBetweenAxisTitleAndLabels)

    getAxisTickMarkPixelLength

    public float getAxisTickMarkPixelLength()

    setAxisTickMarkPixelLength

    public void setAxisTickMarkPixelLength(float axisTickMarkPixelLength)

    getPaddingBetweenLabelsAndTicks

    public float getPaddingBetweenLabelsAndTicks()

    setPaddingBetweenLabelsAndTicks

    public void setPaddingBetweenLabelsAndTicks(float paddingBetweenLabelsAndTicks)

    getPaddingBetweenAxisAndLabels

    public float getPaddingBetweenAxisAndLabels()

    setPaddingBetweenAxisAndLabels

    public void setPaddingBetweenAxisAndLabels(float paddingBetweenAxisAndLabels)

    getAxisStroke

    public ChartStroke getAxisStroke()

    setAxisStroke

    public void setAxisStroke(ChartStroke axisStroke)

    getScaleChartFont

    public ChartFont getScaleChartFont()

    setScaleChartFont

    public void setScaleChartFont(ChartFont scaleChartFont)

    getAxisTitleChartFont

    public ChartFont getAxisTitleChartFont()

    setAxisTitleChartFont

    public void setAxisTitleChartFont(ChartFont axisTitleChartFont)

    getShowEndBorder

    public boolean getShowEndBorder()

    setShowEndBorder

    public void setShowEndBorder(boolean showEndBorder)

    getPaddingBetweenAxisLabels

    public float getPaddingBetweenAxisLabels()

    setPaddingBetweenXAxisLabels

    public void setPaddingBetweenXAxisLabels(float paddingBetweenAxisLabels)

    toHTML

    public void toHTML(HTMLGenerator htmlGenerator)
    Enables the testing routines to display the contents of this Object.

    Specified by:
    toHTML in interface HTMLTestable
    Overrides:
    toHTML in class Properties
    Parameters:
    htmlGenerator -


    jcharts-0.7.5/javadocs/org/jCharts/properties/BarChartProperties.html0000644000175000001440000004615607751071400025033 0ustar onkarusers BarChartProperties (jCharts-0.7.5 API)

    org.jCharts.properties
    Class BarChartProperties

    java.lang.Object
      |
      +--org.jCharts.properties.ChartTypeProperties
            |
            +--org.jCharts.properties.AxisChartTypeProperties
                  |
                  +--org.jCharts.properties.BarChartProperties
    
    All Implemented Interfaces:
    HTMLTestable
    Direct Known Subclasses:
    ClusteredBarChartProperties, StackedBarChartProperties

    public class BarChartProperties
    extends AxisChartTypeProperties


    Field Summary
    private  ChartStroke barOutlineStroke
               
    private  boolean showOutlines
               
    private  float widthPercentage
               
     
    Fields inherited from class org.jCharts.properties.AxisChartTypeProperties
     
    Constructor Summary
    BarChartProperties()
              Constructor
     
    Method Summary
     ChartStroke getBarOutlineStroke()
               
     float getPercentage()
               
     boolean getShowOutlinesFlag()
               
     void setBarOutlineStroke(ChartStroke barOutlineStroke)
               
     void setShowOutlinesFlag(boolean showOutlines)
               
     void setWidthPercentage(float widthPercentage)
               
     void toHTML(HTMLGenerator htmlGenerator)
              Enables the testing routines to display the contents of this Object.
     void validate(IAxisPlotDataSet iAxisPlotDataSet)
              Validates the properties.
     
    Methods inherited from class org.jCharts.properties.AxisChartTypeProperties
    addPostRenderEventListener, addPreRenderEventListener, firePostRender, firePreRender
     
    Methods inherited from class java.lang.Object
    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
     

    Field Detail

    widthPercentage

    private float widthPercentage

    showOutlines

    private boolean showOutlines

    barOutlineStroke

    private ChartStroke barOutlineStroke
    Constructor Detail

    BarChartProperties

    public BarChartProperties()
    Constructor

    Method Detail

    setShowOutlinesFlag

    public void setShowOutlinesFlag(boolean showOutlines)

    getShowOutlinesFlag

    public boolean getShowOutlinesFlag()

    setWidthPercentage

    public void setWidthPercentage(float widthPercentage)

    getPercentage

    public float getPercentage()

    getBarOutlineStroke

    public ChartStroke getBarOutlineStroke()

    setBarOutlineStroke

    public void setBarOutlineStroke(ChartStroke barOutlineStroke)

    toHTML

    public void toHTML(HTMLGenerator htmlGenerator)
    Enables the testing routines to display the contents of this Object.

    Parameters:
    htmlGenerator -

    validate

    public void validate(IAxisPlotDataSet iAxisPlotDataSet)
                  throws PropertyException
    Validates the properties.

    Specified by:
    validate in class AxisChartTypeProperties
    Parameters:
    iAxisPlotDataSet -
    Throws:
    PropertyException


    jcharts-0.7.5/javadocs/org/jCharts/properties/ChartProperties.html0000644000175000001440000004642707751071400024407 0ustar onkarusers ChartProperties (jCharts-0.7.5 API)

    org.jCharts.properties
    Class ChartProperties

    java.lang.Object
      |
      +--org.jCharts.properties.Properties
            |
            +--org.jCharts.properties.AreaProperties
                  |
                  +--org.jCharts.properties.ChartProperties
    
    All Implemented Interfaces:
    HTMLTestable, java.io.Serializable

    public class ChartProperties
    extends AreaProperties
    implements HTMLTestable

    See Also:
    Serialized Form

    Field Summary
     ChartFont titleChartFont
               
    private  float titlePadding
               
    private  boolean validate
               
     
    Fields inherited from class org.jCharts.properties.AreaProperties
     
    Fields inherited from class org.jCharts.properties.Properties
    DEFAULT_BACKGROUND_PAINT
     
    Constructor Summary
    ChartProperties()
               
     
    Method Summary
     ChartFont getTitleFont()
               
     float getTitlePadding()
              Returns the number of pixels between the Chart Title and the axis plot area
     void setTitleFont(ChartFont titleFont)
               
     void setTitlePadding(float pixels)
               
     void setValidate(boolean validate)
              Toggles the validation of data and properties for the charts.
     void toHTML(HTMLGenerator htmlGenerator)
              Enables the testing routines to display the contents of this Object.
     boolean validate()
               
     
    Methods inherited from class org.jCharts.properties.AreaProperties
    getBorderStroke, getEdgePadding, setBorderStroke, setEdgePadding
     
    Methods inherited from class org.jCharts.properties.Properties
    getBackgroundPaint, setBackgroundPaint
     
    Methods inherited from class java.lang.Object
    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
     

    Field Detail

    titleChartFont

    public ChartFont titleChartFont

    titlePadding

    private float titlePadding

    validate

    private boolean validate
    Constructor Detail

    ChartProperties

    public ChartProperties()
    Method Detail

    getTitleFont

    public ChartFont getTitleFont()
    Returns:
    ChartFont

    setTitleFont

    public void setTitleFont(ChartFont titleFont)

    getTitlePadding

    public float getTitlePadding()
    Returns the number of pixels between the Chart Title and the axis plot area

    Returns:
    float

    setTitlePadding

    public void setTitlePadding(float pixels)

    validate

    public boolean validate()
    Returns:
    boolean
    Since:
    0.7.0

    setValidate

    public void setValidate(boolean validate)
    Toggles the validation of data and properties for the charts. This should be false for production systems as it will run slightly faster. Anything for speed, right? ;)

    Parameters:
    validate -
    Since:
    0.7.0

    toHTML

    public void toHTML(HTMLGenerator htmlGenerator)
    Enables the testing routines to display the contents of this Object.

    Specified by:
    toHTML in interface HTMLTestable
    Overrides:
    toHTML in class AreaProperties
    Parameters:
    htmlGenerator -


    jcharts-0.7.5/javadocs/org/jCharts/properties/ChartTypeProperties.html0000644000175000001440000002200507751071400025233 0ustar onkarusers ChartTypeProperties (jCharts-0.7.5 API)

    org.jCharts.properties
    Class ChartTypeProperties

    java.lang.Object
      |
      +--org.jCharts.properties.ChartTypeProperties
    
    All Implemented Interfaces:
    HTMLTestable
    Direct Known Subclasses:
    AxisChartTypeProperties, PieChart2DProperties

    public abstract class ChartTypeProperties
    extends java.lang.Object
    implements HTMLTestable

    Common parent for all Chart type specific properties Objects.


    Constructor Summary
    ChartTypeProperties()
               
     
    Methods inherited from class java.lang.Object
    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
     
    Methods inherited from interface org.jCharts.test.HTMLTestable
    toHTML
     

    Constructor Detail

    ChartTypeProperties

    public ChartTypeProperties()


    jcharts-0.7.5/javadocs/org/jCharts/properties/ClusteredBarChartProperties.html0000644000175000001440000003127607751071400026703 0ustar onkarusers ClusteredBarChartProperties (jCharts-0.7.5 API)

    org.jCharts.properties
    Class ClusteredBarChartProperties

    java.lang.Object
      |
      +--org.jCharts.properties.ChartTypeProperties
            |
            +--org.jCharts.properties.AxisChartTypeProperties
                  |
                  +--org.jCharts.properties.BarChartProperties
                        |
                        +--org.jCharts.properties.ClusteredBarChartProperties
    
    All Implemented Interfaces:
    HTMLTestable

    public final class ClusteredBarChartProperties
    extends BarChartProperties


    Field Summary
     
    Fields inherited from class org.jCharts.properties.BarChartProperties
     
    Fields inherited from class org.jCharts.properties.AxisChartTypeProperties
     
    Constructor Summary
    ClusteredBarChartProperties()
               
     
    Methods inherited from class org.jCharts.properties.BarChartProperties
    getBarOutlineStroke, getPercentage, getShowOutlinesFlag, setBarOutlineStroke, setShowOutlinesFlag, setWidthPercentage, toHTML, validate
     
    Methods inherited from class org.jCharts.properties.AxisChartTypeProperties
    addPostRenderEventListener, addPreRenderEventListener, firePostRender, firePreRender
     
    Methods inherited from class java.lang.Object
    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
     

    Constructor Detail

    ClusteredBarChartProperties

    public ClusteredBarChartProperties()


    jcharts-0.7.5/javadocs/org/jCharts/properties/DataAxisProperties.html0000644000175000001440000011131007751071400025024 0ustar onkarusers DataAxisProperties (jCharts-0.7.5 API)

    org.jCharts.properties
    Class DataAxisProperties

    java.lang.Object
      |
      +--org.jCharts.properties.Properties
            |
            +--org.jCharts.properties.AxisTypeProperties
                  |
                  +--org.jCharts.properties.LabelAxisProperties
                        |
                        +--org.jCharts.properties.DataAxisProperties
    
    All Implemented Interfaces:
    HTMLTestable, java.io.Serializable

    public final class DataAxisProperties
    extends LabelAxisProperties
    implements HTMLTestable

    See Also:
    Serialized Form

    Field Summary
    private  int numItems
               
    private  int roundToNearest
               
    private  ScaleCalculator scaleCalculator
               
    private  boolean showZeroLine
               
    private  boolean useCommas
               
    private  boolean useDollarSigns
               
    private  boolean usePercentSigns
               
    private  double userDefinedIncrement
               
    private  double userDefinedMinimumValue
               
    private  boolean userDefinedScale
               
    private  ChartStroke zeroLineChartStroke
               
     
    Fields inherited from class org.jCharts.properties.AxisTypeProperties
    GRID_LINES_ALL, GRID_LINES_NONE, GRID_LINES_ONLY_WITH_LABELS, TICKS_ALL, TICKS_NONE, TICKS_ONLY_WITH_LABELS
     
    Fields inherited from class org.jCharts.properties.Properties
    DEFAULT_BACKGROUND_PAINT
     
    Constructor Summary
    DataAxisProperties()
               
     
    Method Summary
     int getNumItems()
               
     int getRoundToNearest()
               
     ScaleCalculator getScaleCalculator()
               
     double getUserDefinedIncrement()
               
     double getUserDefinedMinimumValue()
               
     ChartStroke getZeroLineChartStroke()
               
     boolean hasUserDefinedScale()
               
     void setNumItems(int numItems)
               
     void setRoundToNearest(int roundToNearest)
               
     void setScaleCalculator(ScaleCalculator scaleCalculator)
              You do not have to explicitly set a ScaleCalculator implementation as jCharts will create one, but if you do not like the way Scale ranges are created, you could create your own implementation of ScaleCalculator and jCharts will use it!
     void setShowZeroLine(boolean showZeroLine)
               
     void setUseCommas(boolean useCommas)
               
     void setUseDollarSigns(boolean useDollarSigns)
               
     void setUsePercentSigns(boolean usePercentSigns)
               
     void setUserDefinedScale(double axisMinimum, double axisIncrement)
               
     void setZeroLineChartStroke(ChartStroke zeroLine)
               
     boolean showZeroLine()
               
     void toHTML(HTMLGenerator htmlGenerator)
              Enables the testing routines to display the contents of this Object.
     boolean useCommas()
               
     boolean useDollarSigns()
               
     boolean usePercentSigns()
               
     
    Methods inherited from class org.jCharts.properties.AxisTypeProperties
    getAxisStroke, getAxisTickMarkPixelLength, getAxisTitleChartFont, getGridLineChartStroke, getPaddingBetweenAxisAndLabels, getPaddingBetweenAxisLabels, getPaddingBetweenAxisTitleAndLabels, getPaddingBetweenLabelsAndTicks, getScaleChartFont, getShowEndBorder, getShowGridLines, getShowTicks, getTickChartStroke, getTitleChartFont, setAxisStroke, setAxisTickMarkPixelLength, setAxisTitleChartFont, setGridLineChartStroke, setPaddingBetweenAxisAndLabels, setPaddingBetweenAxisTitleAndLabels, setPaddingBetweenLabelsAndTicks, setPaddingBetweenXAxisLabels, setScaleChartFont, setShowAxisLabels, setShowEndBorder, setShowGridLines, setShowTicks, setTickChartStroke, setTitleChartFont, showAxisLabels
     
    Methods inherited from class org.jCharts.properties.Properties
    getBackgroundPaint, setBackgroundPaint
     
    Methods inherited from class java.lang.Object
    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
     

    Field Detail

    roundToNearest

    private int roundToNearest

    showZeroLine

    private boolean showZeroLine

    zeroLineChartStroke

    private ChartStroke zeroLineChartStroke

    userDefinedScale

    private boolean userDefinedScale

    userDefinedMinimumValue

    private double userDefinedMinimumValue

    userDefinedIncrement

    private double userDefinedIncrement

    numItems

    private int numItems

    useDollarSigns

    private boolean useDollarSigns

    useCommas

    private boolean useCommas

    usePercentSigns

    private boolean usePercentSigns

    scaleCalculator

    private ScaleCalculator scaleCalculator
    Constructor Detail

    DataAxisProperties

    public DataAxisProperties()
    Method Detail

    setUserDefinedScale

    public void setUserDefinedScale(double axisMinimum,
                                    double axisIncrement)
                             throws PropertyException
    Parameters:
    axisMinimum -
    axisIncrement -
    Throws:
    PropertyException

    getRoundToNearest

    public int getRoundToNearest()

    setRoundToNearest

    public void setRoundToNearest(int roundToNearest)

    showZeroLine

    public boolean showZeroLine()

    setShowZeroLine

    public void setShowZeroLine(boolean showZeroLine)

    getZeroLineChartStroke

    public ChartStroke getZeroLineChartStroke()

    setZeroLineChartStroke

    public void setZeroLineChartStroke(ChartStroke zeroLine)

    hasUserDefinedScale

    public boolean hasUserDefinedScale()

    getUserDefinedMinimumValue

    public double getUserDefinedMinimumValue()

    getUserDefinedIncrement

    public double getUserDefinedIncrement()

    getNumItems

    public int getNumItems()

    setNumItems

    public void setNumItems(int numItems)

    useDollarSigns

    public boolean useDollarSigns()

    setUseDollarSigns

    public void setUseDollarSigns(boolean useDollarSigns)

    useCommas

    public boolean useCommas()

    setUseCommas

    public void setUseCommas(boolean useCommas)

    usePercentSigns

    public boolean usePercentSigns()

    setUsePercentSigns

    public void setUsePercentSigns(boolean usePercentSigns)

    getScaleCalculator

    public ScaleCalculator getScaleCalculator()

    setScaleCalculator

    public void setScaleCalculator(ScaleCalculator scaleCalculator)
    You do not have to explicitly set a ScaleCalculator implementation as jCharts will create one, but if you do not like the way Scale ranges are created, you could create your own implementation of ScaleCalculator and jCharts will use it!

    Parameters:
    scaleCalculator -

    toHTML

    public void toHTML(HTMLGenerator htmlGenerator)
    Enables the testing routines to display the contents of this Object.

    Specified by:
    toHTML in interface HTMLTestable
    Overrides:
    toHTML in class AxisTypeProperties
    Parameters:
    htmlGenerator -


    jcharts-0.7.5/javadocs/org/jCharts/properties/LabelAxisProperties.html0000644000175000001440000004044707751071400025206 0ustar onkarusers LabelAxisProperties (jCharts-0.7.5 API)

    org.jCharts.properties
    Class LabelAxisProperties

    java.lang.Object
      |
      +--org.jCharts.properties.Properties
            |
            +--org.jCharts.properties.AxisTypeProperties
                  |
                  +--org.jCharts.properties.LabelAxisProperties
    
    All Implemented Interfaces:
    HTMLTestable, java.io.Serializable
    Direct Known Subclasses:
    DataAxisProperties

    public class LabelAxisProperties
    extends AxisTypeProperties
    implements HTMLTestable

    See Also:
    Serialized Form

    Field Summary
     
    Fields inherited from class org.jCharts.properties.AxisTypeProperties
    GRID_LINES_ALL, GRID_LINES_NONE, GRID_LINES_ONLY_WITH_LABELS, TICKS_ALL, TICKS_NONE, TICKS_ONLY_WITH_LABELS
     
    Fields inherited from class org.jCharts.properties.Properties
    DEFAULT_BACKGROUND_PAINT
     
    Constructor Summary
    LabelAxisProperties()
               
     
    Methods inherited from class org.jCharts.properties.AxisTypeProperties
    getAxisStroke, getAxisTickMarkPixelLength, getAxisTitleChartFont, getGridLineChartStroke, getPaddingBetweenAxisAndLabels, getPaddingBetweenAxisLabels, getPaddingBetweenAxisTitleAndLabels, getPaddingBetweenLabelsAndTicks, getScaleChartFont, getShowEndBorder, getShowGridLines, getShowTicks, getTickChartStroke, getTitleChartFont, setAxisStroke, setAxisTickMarkPixelLength, setAxisTitleChartFont, setGridLineChartStroke, setPaddingBetweenAxisAndLabels, setPaddingBetweenAxisTitleAndLabels, setPaddingBetweenLabelsAndTicks, setPaddingBetweenXAxisLabels, setScaleChartFont, setShowAxisLabels, setShowEndBorder, setShowGridLines, setShowTicks, setTickChartStroke, setTitleChartFont, showAxisLabels, toHTML
     
    Methods inherited from class org.jCharts.properties.Properties
    getBackgroundPaint, setBackgroundPaint
     
    Methods inherited from class java.lang.Object
    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
     
    Methods inherited from interface org.jCharts.test.HTMLTestable
    toHTML
     

    Constructor Detail

    LabelAxisProperties

    public LabelAxisProperties()


    jcharts-0.7.5/javadocs/org/jCharts/properties/LegendAreaProperties.html0000644000175000001440000007221407751071400025326 0ustar onkarusers LegendAreaProperties (jCharts-0.7.5 API)

    org.jCharts.properties
    Class LegendAreaProperties

    java.lang.Object
      |
      +--org.jCharts.properties.Properties
            |
            +--org.jCharts.properties.AreaProperties
                  |
                  +--org.jCharts.properties.LegendAreaProperties
    
    All Implemented Interfaces:
    HTMLTestable, java.io.Serializable
    Direct Known Subclasses:
    LegendProperties

    public abstract class LegendAreaProperties
    extends AreaProperties
    implements HTMLTestable

    See Also:
    Serialized Form

    Field Summary
    static int BOTTOM
               
    private  int chartPadding
               
    private  int columnPadding
               
    static int COLUMNS_AS_MANY_AS_NEEDED
               
    static int COLUMNS_FIT_TO_IMAGE
               
    private  int iconPadding
               
    static int LEFT
               
    private  int numColumns
               
    private  int placement
               
    static int RIGHT
               
    private  int rowPadding
               
    static int TOP
               
     
    Fields inherited from class org.jCharts.properties.AreaProperties
     
    Fields inherited from class org.jCharts.properties.Properties
    DEFAULT_BACKGROUND_PAINT
     
    Constructor Summary
    LegendAreaProperties()
              Constructor for those desiring auto-calculation of the Legend width based on the number of columns.
     
    Method Summary
     int getChartPadding()
              Returns the padding between chart plot and the Legend.
     int getColumnPadding()
              Returns the padding between label columns.
     int getIconPadding()
              Returns the padding between the icon and the Label
     int getNumColumns()
              Gets the number of text columns the legend should display.
     int getPlacement()
              Returns where the Legend should be drawn in relation to the Chart.
     int getRowPadding()
              Returns the padding between labels in each row.
     void setChartPadding(int chartPadding)
              Sets the padding between chart plot and the Legend.
     void setColumnPadding(int columnPadding)
              Sets the padding between label columns, in pixels.
     void setIconPadding(int iconPadding)
              Sets the padding between the icon and the Label, in pixels.
     void setNumColumns(int numColumns)
              Sets the number of text columns the legend should display.
     void setPlacement(int placementConstant)
              Sets where the Legend should be drawn in relation to the Chart.
     void setRowPadding(int rowPadding)
              Sets the padding between labels in each row, in pixels.
     void toHTML(HTMLGenerator htmlGenerator)
              Enables the testing routines to display the contents of this Object.
     
    Methods inherited from class org.jCharts.properties.AreaProperties
    getBorderStroke, getEdgePadding, setBorderStroke, setEdgePadding
     
    Methods inherited from class org.jCharts.properties.Properties
    getBackgroundPaint, setBackgroundPaint
     
    Methods inherited from class java.lang.Object
    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
     

    Field Detail

    COLUMNS_AS_MANY_AS_NEEDED

    public static final int COLUMNS_AS_MANY_AS_NEEDED
    See Also:
    Constant Field Values

    COLUMNS_FIT_TO_IMAGE

    public static final int COLUMNS_FIT_TO_IMAGE
    See Also:
    Constant Field Values

    BOTTOM

    public static final int BOTTOM
    See Also:
    Constant Field Values

    RIGHT

    public static final int RIGHT
    See Also:
    Constant Field Values

    LEFT

    public static final int LEFT
    See Also:
    Constant Field Values

    TOP

    public static final int TOP
    See Also:
    Constant Field Values

    numColumns

    private int numColumns

    rowPadding

    private int rowPadding

    columnPadding

    private int columnPadding

    iconPadding

    private int iconPadding

    chartPadding

    private int chartPadding

    placement

    private int placement
    Constructor Detail

    LegendAreaProperties

    public LegendAreaProperties()
    Constructor for those desiring auto-calculation of the Legend width based on the number of columns. All Labels are on a single row as default number of rows is: COLUMNS_AS_MANY_AS_NEEDED

    Method Detail

    getPlacement

    public int getPlacement()
    Returns where the Legend should be drawn in relation to the Chart.

    Returns:
    int

    setPlacement

    public void setPlacement(int placementConstant)
    Sets where the Legend should be drawn in relation to the Chart.

    Parameters:
    placementConstant -

    getChartPadding

    public int getChartPadding()
    Returns the padding between chart plot and the Legend.

    Returns:
    int

    setChartPadding

    public void setChartPadding(int chartPadding)
    Sets the padding between chart plot and the Legend.

    Parameters:
    chartPadding -

    getColumnPadding

    public int getColumnPadding()
    Returns the padding between label columns.

    Returns:
    int

    getRowPadding

    public int getRowPadding()
    Returns the padding between labels in each row.

    Returns:
    int

    setNumColumns

    public void setNumColumns(int numColumns)
    Sets the number of text columns the legend should display.

    Parameters:
    numColumns -

    getNumColumns

    public int getNumColumns()
    Gets the number of text columns the legend should display.

    Returns:
    int

    getIconPadding

    public int getIconPadding()
    Returns the padding between the icon and the Label

    Returns:
    int

    setRowPadding

    public void setRowPadding(int rowPadding)
    Sets the padding between labels in each row, in pixels.

    Parameters:
    rowPadding -

    setColumnPadding

    public void setColumnPadding(int columnPadding)
    Sets the padding between label columns, in pixels.

    Parameters:
    columnPadding -

    setIconPadding

    public void setIconPadding(int iconPadding)
    Sets the padding between the icon and the Label, in pixels.

    Parameters:
    iconPadding -

    toHTML

    public void toHTML(HTMLGenerator htmlGenerator)
    Enables the testing routines to display the contents of this Object.

    Specified by:
    toHTML in interface HTMLTestable
    Overrides:
    toHTML in class AreaProperties
    Parameters:
    htmlGenerator -


    jcharts-0.7.5/javadocs/org/jCharts/properties/LegendProperties.html0000644000175000001440000007021207751071400024531 0ustar onkarusers LegendProperties (jCharts-0.7.5 API)

    org.jCharts.properties
    Class LegendProperties

    java.lang.Object
      |
      +--org.jCharts.properties.Properties
            |
            +--org.jCharts.properties.AreaProperties
                  |
                  +--org.jCharts.properties.LegendAreaProperties
                        |
                        +--org.jCharts.properties.LegendProperties
    
    All Implemented Interfaces:
    HTMLTestable, java.io.Serializable

    public final class LegendProperties
    extends LegendAreaProperties
    implements HTMLTestable

    See Also:
    Serialized Form

    Field Summary
    static java.awt.Font DEFAULT_FONT
               
    static java.awt.Paint DEFAULT_FONT_PAINT
               
    static java.awt.Paint DEFAULT_ICON_BORDER_PAINT
               
    static java.awt.Stroke DEFAULT_ICON_BORDER_STROKE
               
    private  java.awt.Font font
               
    private  java.awt.Paint fontPaint
               
    private  java.awt.Paint iconBorderPaint
               
    private  java.awt.Stroke iconBorderStroke
               
    private  java.awt.Dimension size
               
     
    Fields inherited from class org.jCharts.properties.LegendAreaProperties
    BOTTOM, COLUMNS_AS_MANY_AS_NEEDED, COLUMNS_FIT_TO_IMAGE, LEFT, RIGHT, TOP
     
    Fields inherited from class org.jCharts.properties.AreaProperties
     
    Fields inherited from class org.jCharts.properties.Properties
    DEFAULT_BACKGROUND_PAINT
     
    Constructor Summary
    LegendProperties()
               
     
    Method Summary
     java.awt.Font getFont()
              Returns the Font used by the Legend.
     java.awt.Paint getFontPaint()
              Returns the Font Paint used by the Legend.
     java.awt.Paint getIconBorderPaint()
              Returns the Icon border Color used by the Legend.
     java.awt.Stroke getIconBorderStroke()
              Returns the icon border Stroke
     java.awt.Dimension getSize()
              Getter for property size.
     void setFont(java.awt.Font legendFont)
              Sets the Font used by the Legend.
     void setFontPaint(java.awt.Paint fontPaint)
              Sets the Font color used by the Legend.
     void setIconBorderPaint(java.awt.Paint iconBorderPaint)
              Sets the Icon border color used by the Legend.
     void setIconBorderStroke(java.awt.Stroke stroke)
              Sets the icon border Stroke.
     void setSize(java.awt.Dimension size)
              Setter for property size.
     void toHTML(HTMLGenerator htmlGenerator)
              Enables the testing routines to display the contents of this Object.
     
    Methods inherited from class org.jCharts.properties.LegendAreaProperties
    getChartPadding, getColumnPadding, getIconPadding, getNumColumns, getPlacement, getRowPadding, setChartPadding, setColumnPadding, setIconPadding, setNumColumns, setPlacement, setRowPadding
     
    Methods inherited from class org.jCharts.properties.AreaProperties
    getBorderStroke, getEdgePadding, setBorderStroke, setEdgePadding
     
    Methods inherited from class org.jCharts.properties.Properties
    getBackgroundPaint, setBackgroundPaint
     
    Methods inherited from class java.lang.Object
    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
     

    Field Detail

    DEFAULT_FONT

    public static final java.awt.Font DEFAULT_FONT

    DEFAULT_FONT_PAINT

    public static final java.awt.Paint DEFAULT_FONT_PAINT

    DEFAULT_ICON_BORDER_STROKE

    public static final java.awt.Stroke DEFAULT_ICON_BORDER_STROKE

    DEFAULT_ICON_BORDER_PAINT

    public static final java.awt.Paint DEFAULT_ICON_BORDER_PAINT

    font

    private java.awt.Font font

    fontPaint

    private java.awt.Paint fontPaint

    iconBorderPaint

    private java.awt.Paint iconBorderPaint

    iconBorderStroke

    private java.awt.Stroke iconBorderStroke

    size

    private java.awt.Dimension size
    Constructor Detail

    LegendProperties

    public LegendProperties()
    Method Detail

    setFont

    public void setFont(java.awt.Font legendFont)
    Sets the Font used by the Legend.

    Parameters:
    legendFont -

    getFont

    public java.awt.Font getFont()
    Returns the Font used by the Legend.

    Returns:
    Font

    setIconBorderPaint

    public void setIconBorderPaint(java.awt.Paint iconBorderPaint)
    Sets the Icon border color used by the Legend. If NULL is passed, there will be no border.

    Parameters:
    iconBorderPaint -

    getIconBorderPaint

    public java.awt.Paint getIconBorderPaint()
    Returns the Icon border Color used by the Legend.

    Returns:
    Paint

    setIconBorderStroke

    public void setIconBorderStroke(java.awt.Stroke stroke)
    Sets the icon border Stroke. If NULL is passed, there will be no border.

    Parameters:
    stroke -

    getIconBorderStroke

    public java.awt.Stroke getIconBorderStroke()
    Returns the icon border Stroke

    Returns:
    Stroke

    setFontPaint

    public void setFontPaint(java.awt.Paint fontPaint)
    Sets the Font color used by the Legend.

    Parameters:
    fontPaint -

    getFontPaint

    public java.awt.Paint getFontPaint()
    Returns the Font Paint used by the Legend.

    Returns:
    Paint

    toHTML

    public void toHTML(HTMLGenerator htmlGenerator)
    Enables the testing routines to display the contents of this Object.

    Specified by:
    toHTML in interface HTMLTestable
    Overrides:
    toHTML in class LegendAreaProperties
    Parameters:
    htmlGenerator -

    getSize

    public java.awt.Dimension getSize()
    Getter for property size.

    Returns:
    Value of property size.

    setSize

    public void setSize(java.awt.Dimension size)
    Setter for property size.

    Parameters:
    size - New value of property size.


    jcharts-0.7.5/javadocs/org/jCharts/properties/LineChartProperties.html0000644000175000001440000004104107751071400025202 0ustar onkarusers LineChartProperties (jCharts-0.7.5 API)

    org.jCharts.properties
    Class LineChartProperties

    java.lang.Object
      |
      +--org.jCharts.properties.ChartTypeProperties
            |
            +--org.jCharts.properties.AxisChartTypeProperties
                  |
                  +--org.jCharts.properties.LineChartProperties
    
    All Implemented Interfaces:
    HTMLTestable

    public final class LineChartProperties
    extends AxisChartTypeProperties


    Field Summary
    static java.awt.Stroke DEFAULT_LINE_STROKE
               
    private  java.awt.Stroke[] lineStrokes
               
    private  java.awt.Shape[] shapes
               
     
    Fields inherited from class org.jCharts.properties.AxisChartTypeProperties
     
    Constructor Summary
    LineChartProperties(java.awt.Stroke[] lineStrokes, java.awt.Shape[] shapes)
              Constructor
     
    Method Summary
     java.awt.Stroke[] getLineStrokes()
               
     java.awt.Shape[] getShapes()
               
     void toHTML(HTMLGenerator htmlGenerator)
              Enables the testing routines to display the contents of this Object.
     void validate(IAxisPlotDataSet iAxisPlotDataSet)
              Validates the properties.
     
    Methods inherited from class org.jCharts.properties.AxisChartTypeProperties
    addPostRenderEventListener, addPreRenderEventListener, firePostRender, firePreRender
     
    Methods inherited from class java.lang.Object
    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
     

    Field Detail

    DEFAULT_LINE_STROKE

    public static final java.awt.Stroke DEFAULT_LINE_STROKE

    lineStrokes

    private java.awt.Stroke[] lineStrokes

    shapes

    private java.awt.Shape[] shapes
    Constructor Detail

    LineChartProperties

    public LineChartProperties(java.awt.Stroke[] lineStrokes,
                               java.awt.Shape[] shapes)
    Constructor

    Parameters:
    lineStrokes -
    shapes - if any of the shapes are NULL, they will not be drawn. If the passed Array is NULL, no shpaes will be drawn. There are some Shapes defined in PointChartProperties Object.
    Method Detail

    getLineStrokes

    public java.awt.Stroke[] getLineStrokes()

    getShapes

    public java.awt.Shape[] getShapes()

    toHTML

    public void toHTML(HTMLGenerator htmlGenerator)
    Enables the testing routines to display the contents of this Object.

    Parameters:
    htmlGenerator -

    validate

    public void validate(IAxisPlotDataSet iAxisPlotDataSet)
                  throws PropertyException
    Validates the properties.

    Specified by:
    validate in class AxisChartTypeProperties
    Throws:
    PropertyException


    jcharts-0.7.5/javadocs/org/jCharts/properties/package-frame.html0000644000175000001440000000567407751071376023767 0ustar onkarusers org.jCharts.properties (jCharts-0.7.5 API) org.jCharts.properties
    Classes 
    AreaChartProperties
    AreaProperties
    AxisChartTypeProperties
    AxisProperties
    AxisTypeProperties
    BarChartProperties
    ChartProperties
    ChartTypeProperties
    ClusteredBarChartProperties
    DataAxisProperties
    LabelAxisProperties
    LegendAreaProperties
    LegendProperties
    LineChartProperties
    PieChart2DProperties
    PointChartProperties
    Properties
    ScatterPlotProperties
    StackedAreaChartProperties
    StackedBarChartProperties
    StockChartProperties
    Exceptions 
    PropertyException
    jcharts-0.7.5/javadocs/org/jCharts/properties/package-summary.html0000644000175000001440000002156707751071376024371 0ustar onkarusers org.jCharts.properties (jCharts-0.7.5 API)

    Package org.jCharts.properties

    Class Summary
    AreaChartProperties  
    AreaProperties  
    AxisChartTypeProperties Common parent for all Chart type specific properties Objects.
    AxisProperties  
    AxisTypeProperties  
    BarChartProperties  
    ChartProperties  
    ChartTypeProperties Common parent for all Chart type specific properties Objects.
    ClusteredBarChartProperties  
    DataAxisProperties  
    LabelAxisProperties  
    LegendAreaProperties  
    LegendProperties  
    LineChartProperties  
    PieChart2DProperties  
    PointChartProperties  
    Properties  
    ScatterPlotProperties  
    StackedAreaChartProperties  
    StackedBarChartProperties  
    StockChartProperties  
     

    Exception Summary
    PropertyException  
     



    jcharts-0.7.5/javadocs/org/jCharts/properties/package-tree.html0000644000175000001440000002334607751071376023630 0ustar onkarusers org.jCharts.properties Class Hierarchy (jCharts-0.7.5 API)

    Hierarchy For Package org.jCharts.properties

    Package Hierarchies:
    All Packages

    Class Hierarchy



    jcharts-0.7.5/javadocs/org/jCharts/properties/PieChart2DProperties.html0000644000175000001440000007270207751071400025226 0ustar onkarusers PieChart2DProperties (jCharts-0.7.5 API)

    org.jCharts.properties
    Class PieChart2DProperties

    java.lang.Object
      |
      +--org.jCharts.properties.ChartTypeProperties
            |
            +--org.jCharts.properties.PieChart2DProperties
    
    All Implemented Interfaces:
    HTMLTestable

    public final class PieChart2DProperties
    extends ChartTypeProperties
    implements HTMLTestable


    Field Summary
    private  java.awt.Paint borderPaint
               
    private  java.awt.Stroke borderStroke
               
    static java.awt.Paint DEFAULT_BORDER_PAINT
               
    static java.awt.Stroke DEFAULT_BORDER_STROKE
               
    private  boolean isCurrency
               
    private  PieLabelType pieLabelType
               
    private  int roundingPowerOfTen
               
    private  boolean showGrouping
               
    private  float tickLength
               
    private  ChartFont valueLabelFont
               
    private  float zeroDegreeOffset
               
     
    Constructor Summary
    PieChart2DProperties()
               
     
    Method Summary
     java.awt.Paint getBorderPaint()
               
     java.awt.Stroke getBorderStroke()
               
     PieLabelType getPieLabelType()
               
     float getTickLength()
               
     ChartFont getValueLabelFont()
               
     int getValueLabelRoundingPowerOfTen()
               
     float getZeroDegreeOffset()
               
     void setBorderPaint(java.awt.Paint paint)
               
     void setBorderStroke(java.awt.Stroke stroke)
               
     void setCurrency(boolean currency)
               
     void setPieLabelType(PieLabelType pieLabelType)
              Sets the type of label to draw on the PieChart.
     void setRoundingPowerOfTen(int roundingPowerOfTen)
               
     void setShowGrouping(boolean showGrouping)
               
     void setTickLength(float tickLength)
               
     void setValueLabelFont(ChartFont valueLabelFont)
              Sets the ChartFont used to draw the chart value labels.
     void setZeroDegreeOffset(float zeroDegreeOffset)
              The offset from zero degrees which the first slice of pie is drawn.
     boolean showValueLabelCurrency()
               
     boolean showValueLabelGrouping()
               
     void toHTML(HTMLGenerator htmlGenerator)
              Enables the testing routines to display the contents of this Object.
     void validate(Chart chart)
              Validates the properties.
     
    Methods inherited from class java.lang.Object
    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
     

    Field Detail

    DEFAULT_BORDER_PAINT

    public static final java.awt.Paint DEFAULT_BORDER_PAINT

    DEFAULT_BORDER_STROKE

    public static final java.awt.Stroke DEFAULT_BORDER_STROKE

    borderPaint

    private java.awt.Paint borderPaint

    borderStroke

    private java.awt.Stroke borderStroke

    zeroDegreeOffset

    private float zeroDegreeOffset

    pieLabelType

    private PieLabelType pieLabelType

    isCurrency

    private boolean isCurrency

    showGrouping

    private boolean showGrouping

    roundingPowerOfTen

    private int roundingPowerOfTen

    valueLabelFont

    private ChartFont valueLabelFont

    tickLength

    private float tickLength
    Constructor Detail

    PieChart2DProperties

    public PieChart2DProperties()
    Method Detail

    setZeroDegreeOffset

    public void setZeroDegreeOffset(float zeroDegreeOffset)
    The offset from zero degrees which the first slice of pie is drawn. Charts look better to my eye when they do not start at zero degrees, but beauty is in the eye of the beholder.

    Parameters:
    zeroDegreeOffset -

    getZeroDegreeOffset

    public float getZeroDegreeOffset()
    Returns:
    double

    getBorderStroke

    public java.awt.Stroke getBorderStroke()
    Returns:
    stroke

    setBorderStroke

    public void setBorderStroke(java.awt.Stroke stroke)
    Parameters:
    stroke -

    getBorderPaint

    public java.awt.Paint getBorderPaint()
    Returns:
    Paint

    setBorderPaint

    public void setBorderPaint(java.awt.Paint paint)
    Parameters:
    paint -

    getPieLabelType

    public PieLabelType getPieLabelType()
    Returns:

    setPieLabelType

    public void setPieLabelType(PieLabelType pieLabelType)
    Sets the type of label to draw on the PieChart. The default value is: PieLabelType.NO_LABELS so no labels will be drawn on chart.

    Parameters:
    pieLabelType -

    getValueLabelFont

    public ChartFont getValueLabelFont()

    setValueLabelFont

    public void setValueLabelFont(ChartFont valueLabelFont)
    Sets the ChartFont used to draw the chart value labels.

    Parameters:
    valueLabelFont -

    setCurrency

    public void setCurrency(boolean currency)

    setShowGrouping

    public void setShowGrouping(boolean showGrouping)

    setRoundingPowerOfTen

    public void setRoundingPowerOfTen(int roundingPowerOfTen)

    setTickLength

    public void setTickLength(float tickLength)

    getTickLength

    public float getTickLength()

    showValueLabelCurrency

    public boolean showValueLabelCurrency()

    showValueLabelGrouping

    public boolean showValueLabelGrouping()

    getValueLabelRoundingPowerOfTen

    public int getValueLabelRoundingPowerOfTen()

    toHTML

    public void toHTML(HTMLGenerator htmlGenerator)
    Enables the testing routines to display the contents of this Object.

    Specified by:
    toHTML in interface HTMLTestable
    Parameters:
    htmlGenerator -

    validate

    public void validate(Chart chart)
                  throws PropertyException
    Validates the properties.

    Parameters:
    chart -
    Throws:
    PropertyException


    jcharts-0.7.5/javadocs/org/jCharts/properties/PointChartProperties.html0000644000175000001440000005104007751071400025404 0ustar onkarusers PointChartProperties (jCharts-0.7.5 API)

    org.jCharts.properties
    Class PointChartProperties

    java.lang.Object
      |
      +--org.jCharts.properties.ChartTypeProperties
            |
            +--org.jCharts.properties.AxisChartTypeProperties
                  |
                  +--org.jCharts.properties.PointChartProperties
    
    All Implemented Interfaces:
    HTMLTestable

    public final class PointChartProperties
    extends AxisChartTypeProperties


    Field Summary
    static java.awt.Stroke DEFAULT_POINT_BORDER_STROKE
               
    private  boolean[] fillPointFlags
               
    private  java.awt.Paint[] outlinePaints
               
    static java.awt.Shape SHAPE_CIRCLE
               
    static java.awt.Shape SHAPE_DIAMOND
               
    static java.awt.Shape SHAPE_SQUARE
               
    static java.awt.Shape SHAPE_TRIANGLE
               
    private  java.awt.Shape[] shapes
               
     
    Fields inherited from class org.jCharts.properties.AxisChartTypeProperties
     
    Constructor Summary
    PointChartProperties(java.awt.Shape[] shapes, boolean[] fillPointFlags, java.awt.Paint[] outlinePaints)
              Constructor
     
    Method Summary
     boolean getFillPointsFlag(int index)
               
     java.awt.Paint getPointOutlinePaints(int index)
               
     java.awt.Shape getShape(int index)
               
     void toHTML(HTMLGenerator htmlGenerator)
              Enables the testing routines to display the contents of this Object.
     void validate(IAxisPlotDataSet iAxisPlotDataSet)
              Validates the properties.
     
    Methods inherited from class org.jCharts.properties.AxisChartTypeProperties
    addPostRenderEventListener, addPreRenderEventListener, firePostRender, firePreRender
     
    Methods inherited from class java.lang.Object
    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
     

    Field Detail

    DEFAULT_POINT_BORDER_STROKE

    public static final java.awt.Stroke DEFAULT_POINT_BORDER_STROKE

    SHAPE_SQUARE

    public static final java.awt.Shape SHAPE_SQUARE

    SHAPE_TRIANGLE

    public static final java.awt.Shape SHAPE_TRIANGLE

    SHAPE_CIRCLE

    public static final java.awt.Shape SHAPE_CIRCLE

    SHAPE_DIAMOND

    public static final java.awt.Shape SHAPE_DIAMOND

    shapes

    private java.awt.Shape[] shapes

    fillPointFlags

    private boolean[] fillPointFlags

    outlinePaints

    private java.awt.Paint[] outlinePaints
    Constructor Detail

    PointChartProperties

    public PointChartProperties(java.awt.Shape[] shapes,
                                boolean[] fillPointFlags,
                                java.awt.Paint[] outlinePaints)
    Constructor

    Parameters:
    shapes - the Shapes to use for each DataSet drawn in this chart. There must be an one to one mapping of Shape objects and DataSets in the chart.
    fillPointFlags - flags indicating whether to fill the point Shapes or to only outline them using the Paint specified on the DataSet object. If this is set to TRUE, the 'outlinePaint' attribute can be used to outline the Shape.
    outlinePaints - Sets the outline Paint to use for each Shape in the chart. This Paint is only used if the 'setFillPointsFlag' is set to TRUE for the Shape.
    Method Detail

    getFillPointsFlag

    public boolean getFillPointsFlag(int index)

    getPointOutlinePaints

    public java.awt.Paint getPointOutlinePaints(int index)
    Parameters:
    index -
    Returns:
    Paint

    getShape

    public java.awt.Shape getShape(int index)
    Parameters:
    index -
    Returns:
    Shape

    toHTML

    public void toHTML(HTMLGenerator htmlGenerator)
    Enables the testing routines to display the contents of this Object.

    Parameters:
    htmlGenerator -

    validate

    public void validate(IAxisPlotDataSet iAxisPlotDataSet)
                  throws PropertyException
    Validates the properties.

    Specified by:
    validate in class AxisChartTypeProperties
    Parameters:
    iAxisPlotDataSet -
    Throws:
    PropertyException


    jcharts-0.7.5/javadocs/org/jCharts/properties/Properties.html0000644000175000001440000003205607751071400023416 0ustar onkarusers Properties (jCharts-0.7.5 API)

    org.jCharts.properties
    Class Properties

    java.lang.Object
      |
      +--org.jCharts.properties.Properties
    
    All Implemented Interfaces:
    HTMLTestable, java.io.Serializable
    Direct Known Subclasses:
    AreaProperties, AxisProperties, AxisTypeProperties

    public abstract class Properties
    extends java.lang.Object
    implements java.io.Serializable, HTMLTestable

    See Also:
    Serialized Form

    Field Summary
    private  java.awt.Paint backgroundPaint
               
    static java.awt.Paint DEFAULT_BACKGROUND_PAINT
               
     
    Constructor Summary
    Properties()
               
     
    Method Summary
     java.awt.Paint getBackgroundPaint()
               
     void setBackgroundPaint(java.awt.Paint backgroundPaint)
               
     void toHTML(HTMLGenerator htmlGenerator)
              Enables the testing routines to display the contents of this Object.
     
    Methods inherited from class java.lang.Object
    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
     

    Field Detail

    DEFAULT_BACKGROUND_PAINT

    public static final java.awt.Paint DEFAULT_BACKGROUND_PAINT

    backgroundPaint

    private java.awt.Paint backgroundPaint
    Constructor Detail

    Properties

    public Properties()
    Method Detail

    setBackgroundPaint

    public void setBackgroundPaint(java.awt.Paint backgroundPaint)
    Parameters:
    backgroundPaint -

    getBackgroundPaint

    public java.awt.Paint getBackgroundPaint()
    Returns:
    Paint

    toHTML

    public void toHTML(HTMLGenerator htmlGenerator)
    Enables the testing routines to display the contents of this Object.

    Specified by:
    toHTML in interface HTMLTestable
    Parameters:
    htmlGenerator -


    jcharts-0.7.5/javadocs/org/jCharts/properties/PropertyException.html0000644000175000001440000002306407751071400024764 0ustar onkarusers PropertyException (jCharts-0.7.5 API)

    org.jCharts.properties
    Class PropertyException

    java.lang.Object
      |
      +--java.lang.Throwable
            |
            +--java.lang.Exception
                  |
                  +--org.jCharts.properties.PropertyException
    
    All Implemented Interfaces:
    java.io.Serializable

    public class PropertyException
    extends java.lang.Exception

    See Also:
    Serialized Form

    Field Summary
     
    Fields inherited from class java.lang.Exception
     
    Fields inherited from class java.lang.Throwable
     
    Constructor Summary
    PropertyException(java.lang.String message)
               
     
    Methods inherited from class java.lang.Throwable
    fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
     
    Methods inherited from class java.lang.Object
    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
     

    Constructor Detail

    PropertyException

    public PropertyException(java.lang.String message)


    jcharts-0.7.5/javadocs/org/jCharts/properties/ScatterPlotProperties.html0000644000175000001440000004121307751071400025576 0ustar onkarusers ScatterPlotProperties (jCharts-0.7.5 API)

    org.jCharts.properties
    Class ScatterPlotProperties

    java.lang.Object
      |
      +--org.jCharts.properties.ChartTypeProperties
            |
            +--org.jCharts.properties.AxisChartTypeProperties
                  |
                  +--org.jCharts.properties.ScatterPlotProperties
    
    All Implemented Interfaces:
    HTMLTestable

    public final class ScatterPlotProperties
    extends AxisChartTypeProperties


    Field Summary
    static java.awt.Stroke DEFAULT_LINE_STROKE
               
    private  java.awt.Stroke[] lineStrokes
               
    private  java.awt.Shape[] shapes
               
     
    Fields inherited from class org.jCharts.properties.AxisChartTypeProperties
     
    Constructor Summary
    ScatterPlotProperties(java.awt.Stroke[] lineStrokes, java.awt.Shape[] shapes)
              Constructor
     
    Method Summary
     java.awt.Stroke[] getLineStrokes()
               
     java.awt.Shape[] getShapes()
               
     void toHTML(HTMLGenerator htmlGenerator)
              Enables the testing routines to display the contents of this Object.
     void validate(IAxisPlotDataSet iAxisPlotDataSet)
              Validates the properties.
     
    Methods inherited from class org.jCharts.properties.AxisChartTypeProperties
    addPostRenderEventListener, addPreRenderEventListener, firePostRender, firePreRender
     
    Methods inherited from class java.lang.Object
    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
     

    Field Detail

    DEFAULT_LINE_STROKE

    public static final java.awt.Stroke DEFAULT_LINE_STROKE

    lineStrokes

    private java.awt.Stroke[] lineStrokes

    shapes

    private java.awt.Shape[] shapes
    Constructor Detail

    ScatterPlotProperties

    public ScatterPlotProperties(java.awt.Stroke[] lineStrokes,
                                 java.awt.Shape[] shapes)
    Constructor

    Parameters:
    lineStrokes -
    shapes - if any of the shapes are NULL, they will not be drawn. If the passed Array is NULL, no shpaes will be drawn. There are some Shapes defined in PointChartProperties Object.
    Method Detail

    getLineStrokes

    public java.awt.Stroke[] getLineStrokes()

    getShapes

    public java.awt.Shape[] getShapes()

    toHTML

    public void toHTML(HTMLGenerator htmlGenerator)
    Enables the testing routines to display the contents of this Object.

    Parameters:
    htmlGenerator -

    validate

    public void validate(IAxisPlotDataSet iAxisPlotDataSet)
                  throws PropertyException
    Validates the properties.

    Specified by:
    validate in class AxisChartTypeProperties
    Parameters:
    iAxisPlotDataSet -
    Throws:
    PropertyException


    jcharts-0.7.5/javadocs/org/jCharts/properties/StackedAreaChartProperties.html0000644000175000001440000002706307751071400026472 0ustar onkarusers StackedAreaChartProperties (jCharts-0.7.5 API)

    org.jCharts.properties
    Class StackedAreaChartProperties

    java.lang.Object
      |
      +--org.jCharts.properties.ChartTypeProperties
            |
            +--org.jCharts.properties.AxisChartTypeProperties
                  |
                  +--org.jCharts.properties.AreaChartProperties
                        |
                        +--org.jCharts.properties.StackedAreaChartProperties
    
    All Implemented Interfaces:
    HTMLTestable

    public class StackedAreaChartProperties
    extends AreaChartProperties


    Field Summary
     
    Fields inherited from class org.jCharts.properties.AxisChartTypeProperties
     
    Constructor Summary
    StackedAreaChartProperties()
               
     
    Methods inherited from class org.jCharts.properties.AreaChartProperties
    toHTML, validate
     
    Methods inherited from class org.jCharts.properties.AxisChartTypeProperties
    addPostRenderEventListener, addPreRenderEventListener, firePostRender, firePreRender
     
    Methods inherited from class java.lang.Object
    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
     

    Constructor Detail

    StackedAreaChartProperties

    public StackedAreaChartProperties()


    jcharts-0.7.5/javadocs/org/jCharts/properties/StackedBarChartProperties.html0000644000175000001440000003126207751071400026322 0ustar onkarusers StackedBarChartProperties (jCharts-0.7.5 API)

    org.jCharts.properties
    Class StackedBarChartProperties

    java.lang.Object
      |
      +--org.jCharts.properties.ChartTypeProperties
            |
            +--org.jCharts.properties.AxisChartTypeProperties
                  |
                  +--org.jCharts.properties.BarChartProperties
                        |
                        +--org.jCharts.properties.StackedBarChartProperties
    
    All Implemented Interfaces:
    HTMLTestable

    public final class StackedBarChartProperties
    extends BarChartProperties


    Field Summary
     
    Fields inherited from class org.jCharts.properties.BarChartProperties
     
    Fields inherited from class org.jCharts.properties.AxisChartTypeProperties
     
    Constructor Summary
    StackedBarChartProperties()
               
     
    Methods inherited from class org.jCharts.properties.BarChartProperties
    getBarOutlineStroke, getPercentage, getShowOutlinesFlag, setBarOutlineStroke, setShowOutlinesFlag, setWidthPercentage, toHTML, validate
     
    Methods inherited from class org.jCharts.properties.AxisChartTypeProperties
    addPostRenderEventListener, addPreRenderEventListener, firePostRender, firePreRender
     
    Methods inherited from class java.lang.Object
    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
     

    Constructor Detail

    StackedBarChartProperties

    public StackedBarChartProperties()


    jcharts-0.7.5/javadocs/org/jCharts/properties/StockChartProperties.html0000644000175000001440000005702507751071400025407 0ustar onkarusers StockChartProperties (jCharts-0.7.5 API)

    org.jCharts.properties
    Class StockChartProperties

    java.lang.Object
      |
      +--org.jCharts.properties.ChartTypeProperties
            |
            +--org.jCharts.properties.AxisChartTypeProperties
                  |
                  +--org.jCharts.properties.StockChartProperties
    
    All Implemented Interfaces:
    HTMLTestable

    public final class StockChartProperties
    extends AxisChartTypeProperties


    Field Summary
    private  int closeLength
               
    private  java.awt.Stroke closeStroke
               
    static java.awt.Stroke DEFAULT_STROKE
               
    private  java.awt.Stroke hiLowStroke
               
    private  int openLength
               
    private  java.awt.Stroke openStroke
               
     
    Fields inherited from class org.jCharts.properties.AxisChartTypeProperties
     
    Constructor Summary
    StockChartProperties()
               
    StockChartProperties(java.awt.Stroke hiLowStroke, java.awt.Stroke openStroke, int openPixelLength, java.awt.Stroke closeStroke, int closePixelLength)
               
     
    Method Summary
     int getClosePixelLength()
               
     java.awt.Stroke getCloseStroke()
               
     java.awt.Stroke getHiLowStroke()
               
     int getOpenPixelLength()
               
     java.awt.Stroke getOpenStroke()
               
     void setClosePixelLength(int pixelLength)
               
     void setCloseStroke(java.awt.Stroke stroke)
               
     void setHiLowStroke(java.awt.Stroke stroke)
               
     void setOpenPixelLength(int pixelLength)
               
     void setOpenStroke(java.awt.Stroke stroke)
               
     void toHTML(HTMLGenerator htmlGenerator)
              Enables the testing routines to display the contents of this Object.
     void validate(IAxisPlotDataSet iAxisPlotDataSet)
              Validates the properties.
     
    Methods inherited from class org.jCharts.properties.AxisChartTypeProperties
    addPostRenderEventListener, addPreRenderEventListener, firePostRender, firePreRender
     
    Methods inherited from class java.lang.Object
    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
     

    Field Detail

    DEFAULT_STROKE

    public static final java.awt.Stroke DEFAULT_STROKE

    hiLowStroke

    private java.awt.Stroke hiLowStroke

    openStroke

    private java.awt.Stroke openStroke

    openLength

    private int openLength

    closeStroke

    private java.awt.Stroke closeStroke

    closeLength

    private int closeLength
    Constructor Detail

    StockChartProperties

    public StockChartProperties()

    StockChartProperties

    public StockChartProperties(java.awt.Stroke hiLowStroke,
                                java.awt.Stroke openStroke,
                                int openPixelLength,
                                java.awt.Stroke closeStroke,
                                int closePixelLength)
    Parameters:
    hiLowStroke -
    openStroke -
    openPixelLength -
    closeStroke -
    closePixelLength -
    Method Detail

    getHiLowStroke

    public java.awt.Stroke getHiLowStroke()
    Returns:
    Stroke

    setHiLowStroke

    public void setHiLowStroke(java.awt.Stroke stroke)
    Parameters:
    stroke -

    getOpenStroke

    public java.awt.Stroke getOpenStroke()
    Returns:
    Stroke

    setOpenStroke

    public void setOpenStroke(java.awt.Stroke stroke)
    Parameters:
    stroke -

    getOpenPixelLength

    public int getOpenPixelLength()
    Returns:
    int

    setOpenPixelLength

    public void setOpenPixelLength(int pixelLength)
    Parameters:
    pixelLength -

    getCloseStroke

    public java.awt.Stroke getCloseStroke()
    Returns:
    Stroke

    setCloseStroke

    public void setCloseStroke(java.awt.Stroke stroke)
    Parameters:
    stroke -

    getClosePixelLength

    public int getClosePixelLength()
    Returns:
    int

    setClosePixelLength

    public void setClosePixelLength(int pixelLength)
    Parameters:
    pixelLength -

    validate

    public void validate(IAxisPlotDataSet iAxisPlotDataSet)
                  throws PropertyException
    Validates the properties.

    Specified by:
    validate in class AxisChartTypeProperties
    Parameters:
    iAxisPlotDataSet -
    Throws:
    PropertyException

    toHTML

    public void toHTML(HTMLGenerator htmlGenerator)
    Enables the testing routines to display the contents of this Object.

    Parameters:
    htmlGenerator -


    jcharts-0.7.5/javadocs/org/jCharts/test/0000755000175000001440000000000007751071404017155 5ustar onkarusersjcharts-0.7.5/javadocs/org/jCharts/test/AreaTestDriver.html0000644000175000001440000004117107751071400022727 0ustar onkarusers AreaTestDriver (jCharts-0.7.5 API)

    org.jCharts.test
    Class AreaTestDriver

    java.lang.Object
      |
      +--org.jCharts.test.AxisChartTestBase
            |
            +--org.jCharts.test.AreaTestDriver
    

    class AreaTestDriver
    extends AxisChartTestBase

    This file provides examples of how to create all the different chart types provided by this package.


    Constructor Summary
    (package private) AreaTestDriver()
               
     
    Method Summary
    (package private) static void axisChartTest(java.lang.String name, AxisChartTestBase axisChartTestBase)
              Test for LineChart
    (package private)  AxisChartDataSet createAxisChartDataSet(ChartType chartType, ChartTypeProperties chartTypeProperties, int numberOfDataSets, int numberOfValuesToCreate, int minValue, int maxValue)
              Generates a random MultiDataSet
    (package private)  DataSeries createDataSeries(int numberOfValuesToCreate)
               
    (package private) static ChartTypeProperties getChartTypeProperties(int numberOfDataSets)
              Separate this so can use for combo chart test
    (package private)  DataSeries getDataSeries()
               
    static void main(java.lang.String[] args)
               
    (package private)  boolean supportsImageMap()
               
     
    Methods inherited from class java.lang.Object
    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
     

    Constructor Detail

    AreaTestDriver

    AreaTestDriver()
    Method Detail

    supportsImageMap

    boolean supportsImageMap()
    Specified by:
    supportsImageMap in class AxisChartTestBase

    getChartTypeProperties

    static ChartTypeProperties getChartTypeProperties(int numberOfDataSets)
    Separate this so can use for combo chart test


    getDataSeries

    DataSeries getDataSeries()
                       throws ChartDataException
    Specified by:
    getDataSeries in class AxisChartTestBase
    ChartDataException

    main

    public static void main(java.lang.String[] args)
                     throws ChartDataException,
                            PropertyException
    ChartDataException
    PropertyException

    axisChartTest

    static void axisChartTest(java.lang.String name,
                              AxisChartTestBase axisChartTestBase)
                       throws ChartDataException,
                              PropertyException
    Test for LineChart

    ChartDataException
    PropertyException

    createDataSeries

    final DataSeries createDataSeries(int numberOfValuesToCreate)

    createAxisChartDataSet

    AxisChartDataSet createAxisChartDataSet(ChartType chartType,
                                            ChartTypeProperties chartTypeProperties,
                                            int numberOfDataSets,
                                            int numberOfValuesToCreate,
                                            int minValue,
                                            int maxValue)
                                      throws ChartDataException
    Generates a random MultiDataSet

    Parameters:
    numberOfDataSets -
    numberOfValuesToCreate - the number of doubles to generate
    minValue -
    maxValue -
    Returns:
    AxisChartDataSet
    ChartDataException


    jcharts-0.7.5/javadocs/org/jCharts/test/AxisChartTestBase.html0000644000175000001440000003557207751071400023374 0ustar onkarusers AxisChartTestBase (jCharts-0.7.5 API)

    org.jCharts.test
    Class AxisChartTestBase

    java.lang.Object
      |
      +--org.jCharts.test.AxisChartTestBase
    
    Direct Known Subclasses:
    AreaTestDriver, BarTestDriver, ClusteredBarTestDriver, ComboTestDriver, LineTestDriver, PointTestDriver, StackedAreaTestDriver, StackedBarTestDriver, StockTestDriver

    abstract class AxisChartTestBase
    extends java.lang.Object


    Constructor Summary
    AxisChartTestBase()
               
     
    Method Summary
    (package private) static void axisChartTest(java.lang.String name, AxisChartTestBase axisChartTestBase)
              Test for LineChart
    (package private)  AxisChartDataSet createAxisChartDataSet(ChartType chartType, ChartTypeProperties chartTypeProperties, int numberOfDataSets, int numberOfValuesToCreate, int minValue, int maxValue)
              Generates a random MultiDataSet
    (package private)  DataSeries createDataSeries(int numberOfValuesToCreate)
               
    (package private) abstract  DataSeries getDataSeries()
               
    (package private) abstract  boolean supportsImageMap()
               
     
    Methods inherited from class java.lang.Object
    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
     

    Constructor Detail

    AxisChartTestBase

    public AxisChartTestBase()
    Method Detail

    getDataSeries

    abstract DataSeries getDataSeries()
                               throws ChartDataException
    ChartDataException

    supportsImageMap

    abstract boolean supportsImageMap()

    axisChartTest

    static void axisChartTest(java.lang.String name,
                              AxisChartTestBase axisChartTestBase)
                       throws ChartDataException,
                              PropertyException
    Test for LineChart

    ChartDataException
    PropertyException

    createDataSeries

    final DataSeries createDataSeries(int numberOfValuesToCreate)

    createAxisChartDataSet

    AxisChartDataSet createAxisChartDataSet(ChartType chartType,
                                            ChartTypeProperties chartTypeProperties,
                                            int numberOfDataSets,
                                            int numberOfValuesToCreate,
                                            int minValue,
                                            int maxValue)
                                      throws ChartDataException
    Generates a random MultiDataSet

    Parameters:
    numberOfDataSets -
    numberOfValuesToCreate - the number of doubles to generate
    minValue -
    maxValue -
    Returns:
    AxisChartDataSet
    ChartDataException


    jcharts-0.7.5/javadocs/org/jCharts/test/BarTestDriver.html0000644000175000001440000004407007751071400022564 0ustar onkarusers BarTestDriver (jCharts-0.7.5 API)

    org.jCharts.test
    Class BarTestDriver

    java.lang.Object
      |
      +--org.jCharts.test.AxisChartTestBase
            |
            +--org.jCharts.test.BarTestDriver
    

    public final class BarTestDriver
    extends AxisChartTestBase

    This file provides examples of how to create all the different chart types provided by this package.


    Constructor Summary
    BarTestDriver()
               
     
    Method Summary
    (package private) static void axisChartTest(java.lang.String name, AxisChartTestBase axisChartTestBase)
              Test for LineChart
    static void bug()
               
    private static void bug2()
               
    (package private)  AxisChartDataSet createAxisChartDataSet(ChartType chartType, ChartTypeProperties chartTypeProperties, int numberOfDataSets, int numberOfValuesToCreate, int minValue, int maxValue)
              Generates a random MultiDataSet
    (package private)  DataSeries createDataSeries(int numberOfValuesToCreate)
               
    (package private) static ChartTypeProperties getChartTypeProperties(int numberOfDataSets)
              Separate this so can use for combo chart test
    (package private)  DataSeries getDataSeries()
               
    static void main(java.lang.String[] args)
               
    (package private)  boolean supportsImageMap()
               
     
    Methods inherited from class java.lang.Object
    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
     

    Constructor Detail

    BarTestDriver

    public BarTestDriver()
    Method Detail

    supportsImageMap

    boolean supportsImageMap()
    Specified by:
    supportsImageMap in class AxisChartTestBase

    getChartTypeProperties

    static ChartTypeProperties getChartTypeProperties(int numberOfDataSets)
    Separate this so can use for combo chart test


    getDataSeries

    DataSeries getDataSeries()
                       throws ChartDataException
    Specified by:
    getDataSeries in class AxisChartTestBase
    ChartDataException

    main

    public static void main(java.lang.String[] args)
                     throws PropertyException,
                            ChartDataException
    Parameters:
    args -
    Throws:
    PropertyException
    ChartDataException

    bug

    public static void bug()
                    throws ChartDataException,
                           PropertyException
    ChartDataException
    PropertyException

    bug2

    private static void bug2()

    axisChartTest

    static void axisChartTest(java.lang.String name,
                              AxisChartTestBase axisChartTestBase)
                       throws ChartDataException,
                              PropertyException
    Test for LineChart

    ChartDataException
    PropertyException

    createDataSeries

    final DataSeries createDataSeries(int numberOfValuesToCreate)

    createAxisChartDataSet

    AxisChartDataSet createAxisChartDataSet(ChartType chartType,
                                            ChartTypeProperties chartTypeProperties,
                                            int numberOfDataSets,
                                            int numberOfValuesToCreate,
                                            int minValue,
                                            int maxValue)
                                      throws ChartDataException
    Generates a random MultiDataSet

    Parameters:
    numberOfDataSets -
    numberOfValuesToCreate - the number of doubles to generate
    minValue -
    maxValue -
    Returns:
    AxisChartDataSet
    ChartDataException


    jcharts-0.7.5/javadocs/org/jCharts/test/ChartTestDriver.html0000644000175000001440000003767207751071402023135 0ustar onkarusers ChartTestDriver (jCharts-0.7.5 API)

    org.jCharts.test
    Class ChartTestDriver

    java.lang.Object
      |
      +--org.jCharts.test.ChartTestDriver
    

    public final class ChartTestDriver
    extends java.lang.Object

    This file provides examples of how to create all the different chart types provided by this package.


    Field Summary
    (package private) static java.lang.String EXTENSION
               
    private static java.lang.String JPEG
               
    private static java.lang.String JPEG_LEGACY
               
    (package private) static java.lang.String OUTPUT_PATH
               
    private static java.lang.String PNG
               
    private static java.lang.String SVG
               
     
    Constructor Summary
    ChartTestDriver()
               
     
    Method Summary
    (package private) static void exportImage(Chart chart, java.lang.String fileName)
              Utility method to write the image to file so I do not have to deal with file i/o every time I write a test.
    static void main(java.lang.String[] args)
              Main method so can run as command line.
    private static void testAxisScale()
               
     
    Methods inherited from class java.lang.Object
    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
     

    Field Detail

    SVG

    private static final java.lang.String SVG
    See Also:
    Constant Field Values

    PNG

    private static final java.lang.String PNG
    See Also:
    Constant Field Values

    JPEG

    private static final java.lang.String JPEG
    See Also:
    Constant Field Values

    JPEG_LEGACY

    private static final java.lang.String JPEG_LEGACY
    See Also:
    Constant Field Values

    OUTPUT_PATH

    static final java.lang.String OUTPUT_PATH
    See Also:
    Constant Field Values

    EXTENSION

    static final java.lang.String EXTENSION
    See Also:
    Constant Field Values
    Constructor Detail

    ChartTestDriver

    public ChartTestDriver()
    Method Detail

    main

    public static void main(java.lang.String[] args)
                     throws ChartDataException,
                            PropertyException
    Main method so can run as command line.

    Parameters:
    args - command line arguements.
    ChartDataException
    PropertyException

    testAxisScale

    private static void testAxisScale()

    exportImage

    static void exportImage(Chart chart,
                            java.lang.String fileName)
                     throws ChartDataException,
                            PropertyException
    Utility method to write the image to file so I do not have to deal with file i/o every time I write a test.

    Parameters:
    chart - verything that is renderable extends this class.
    fileName - what to name the file
    Throws:
    ChartDataException
    PropertyException


    jcharts-0.7.5/javadocs/org/jCharts/test/ClusteredBarTestDriver.html0000644000175000001440000004014607751071402024441 0ustar onkarusers ClusteredBarTestDriver (jCharts-0.7.5 API)

    org.jCharts.test
    Class ClusteredBarTestDriver

    java.lang.Object
      |
      +--org.jCharts.test.AxisChartTestBase
            |
            +--org.jCharts.test.ClusteredBarTestDriver
    

    class ClusteredBarTestDriver
    extends AxisChartTestBase

    This file provides examples of how to create all the different chart types provided by this package.


    Constructor Summary
    (package private) ClusteredBarTestDriver()
               
     
    Method Summary
    (package private) static void axisChartTest(java.lang.String name, AxisChartTestBase axisChartTestBase)
              Test for LineChart
    (package private)  AxisChartDataSet createAxisChartDataSet(ChartType chartType, ChartTypeProperties chartTypeProperties, int numberOfDataSets, int numberOfValuesToCreate, int minValue, int maxValue)
              Generates a random MultiDataSet
    (package private)  DataSeries createDataSeries(int numberOfValuesToCreate)
               
    (package private)  DataSeries getDataSeries()
               
    static void main(java.lang.String[] args)
               
    (package private)  boolean supportsImageMap()
               
     
    Methods inherited from class java.lang.Object
    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
     

    Constructor Detail

    ClusteredBarTestDriver

    ClusteredBarTestDriver()
    Method Detail

    supportsImageMap

    boolean supportsImageMap()
    Specified by:
    supportsImageMap in class AxisChartTestBase

    getDataSeries

    DataSeries getDataSeries()
                       throws ChartDataException
    Specified by:
    getDataSeries in class AxisChartTestBase
    ChartDataException

    main

    public static void main(java.lang.String[] args)
                     throws PropertyException,
                            ChartDataException
    Parameters:
    args -
    Throws:
    PropertyException
    ChartDataException

    axisChartTest

    static void axisChartTest(java.lang.String name,
                              AxisChartTestBase axisChartTestBase)
                       throws ChartDataException,
                              PropertyException
    Test for LineChart

    ChartDataException
    PropertyException

    createDataSeries

    final DataSeries createDataSeries(int numberOfValuesToCreate)

    createAxisChartDataSet

    AxisChartDataSet createAxisChartDataSet(ChartType chartType,
                                            ChartTypeProperties chartTypeProperties,
                                            int numberOfDataSets,
                                            int numberOfValuesToCreate,
                                            int minValue,
                                            int maxValue)
                                      throws ChartDataException
    Generates a random MultiDataSet

    Parameters:
    numberOfDataSets -
    numberOfValuesToCreate - the number of doubles to generate
    minValue -
    maxValue -
    Returns:
    AxisChartDataSet
    ChartDataException


    jcharts-0.7.5/javadocs/org/jCharts/test/ComboTestDriver.html0000644000175000001440000003561207751071402023123 0ustar onkarusers ComboTestDriver (jCharts-0.7.5 API)

    org.jCharts.test
    Class ComboTestDriver

    java.lang.Object
      |
      +--org.jCharts.test.AxisChartTestBase
            |
            +--org.jCharts.test.ComboTestDriver
    

    public final class ComboTestDriver
    extends AxisChartTestBase

    This file provides examples of how to create all the different chart types provided by this package.


    Constructor Summary
    ComboTestDriver()
               
     
    Method Summary
    (package private) static void axisChartTest(java.lang.String name, AxisChartTestBase axisChartTestBase)
              Test for LineChart
    (package private)  AxisChartDataSet createAxisChartDataSet(ChartType chartType, ChartTypeProperties chartTypeProperties, int numberOfDataSets, int numberOfValuesToCreate, int minValue, int maxValue)
              Generates a random MultiDataSet
    (package private)  DataSeries createDataSeries(int numberOfValuesToCreate)
               
    (package private)  DataSeries getDataSeries()
              Test for LineChart
    (package private)  boolean supportsImageMap()
               
     
    Methods inherited from class java.lang.Object
    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
     

    Constructor Detail

    ComboTestDriver

    public ComboTestDriver()
    Method Detail

    supportsImageMap

    boolean supportsImageMap()
    Specified by:
    supportsImageMap in class AxisChartTestBase

    getDataSeries

    DataSeries getDataSeries()
                       throws ChartDataException
    Test for LineChart

    Specified by:
    getDataSeries in class AxisChartTestBase
    ChartDataException

    axisChartTest

    static void axisChartTest(java.lang.String name,
                              AxisChartTestBase axisChartTestBase)
                       throws ChartDataException,
                              PropertyException
    Test for LineChart

    ChartDataException
    PropertyException

    createDataSeries

    final DataSeries createDataSeries(int numberOfValuesToCreate)

    createAxisChartDataSet

    AxisChartDataSet createAxisChartDataSet(ChartType chartType,
                                            ChartTypeProperties chartTypeProperties,
                                            int numberOfDataSets,
                                            int numberOfValuesToCreate,
                                            int minValue,
                                            int maxValue)
                                      throws ChartDataException
    Generates a random MultiDataSet

    Parameters:
    numberOfDataSets -
    numberOfValuesToCreate - the number of doubles to generate
    minValue -
    maxValue -
    Returns:
    AxisChartDataSet
    ChartDataException


    jcharts-0.7.5/javadocs/org/jCharts/test/HTMLChartTestable.html0000644000175000001440000002044307751071400023254 0ustar onkarusers HTMLChartTestable (jCharts-0.7.5 API)

    org.jCharts.test
    Interface HTMLChartTestable

    All Known Implementing Classes:
    AxisChart, PieChart2D, ScatterPlotAxisChart

    public interface HTMLChartTestable

    Interface class for Chart Objects that can be displayed in a jCharts test.


    Method Summary
     void toHTML(HTMLGenerator htmlGenerator, java.lang.String imageFileName, ImageMap imageMap)
               
     

    Method Detail

    toHTML

    public void toHTML(HTMLGenerator htmlGenerator,
                       java.lang.String imageFileName,
                       ImageMap imageMap)
    Parameters:
    htmlGenerator -
    imageFileName - the name of the output test image
    imageMap - if this is NULL we are not creating image map data in html


    jcharts-0.7.5/javadocs/org/jCharts/test/HTMLGenerator.html0000644000175000001440000006516107751071402022465 0ustar onkarusers HTMLGenerator (jCharts-0.7.5 API)

    org.jCharts.test
    Class HTMLGenerator

    java.lang.Object
      |
      +--org.jCharts.test.HTMLGenerator
    

    public final class HTMLGenerator
    extends java.lang.Object

    Utility class for viewing a series of tests.


    Field Summary
    private  java.lang.String fileName
               
    private  java.lang.StringBuffer stringBuffer
               
     
    Constructor Summary
    HTMLGenerator(java.lang.String fileName)
               
     
    Method Summary
     void addField(java.lang.String name, java.lang.Object object)
              Adds passed field to table.
     void addImage(java.lang.String fileName, ImageMap imageMap)
              Adds an image
    private  void addImageMapData(ImageMap imageMap, java.lang.String fileName)
               
     void addLineBreak()
              Add line break
     void addString(java.lang.Object object)
              Adds a String
     void addString(java.lang.String label, java.lang.Object object)
              Adds a String
     void addTableRow(java.lang.String label, java.lang.Object value)
               
    static java.lang.String arrayToString(boolean[] array)
              Adds an Array
    static java.lang.String arrayToString(double[] values)
              Adds an Array
    static java.lang.String arrayToString(double[][] values)
              Adds an Array
    static java.lang.String arrayToString(float[] values)
              Adds an Array
    static java.lang.String arrayToString(int[] values)
              Adds an Array
    static java.lang.String arrayToString(java.lang.Object[] object)
              Adds an Array
     void chartTableEnd()
               
     void chartTableRowEnd()
               
     void chartTableRowStart()
               
     void chartTableStart(java.lang.String chartName, java.lang.String imageFileName, ImageMap imageMap)
               
     void innerTableRowEnd()
               
     void innerTableRowStart()
               
     void legendTableEnd()
               
     void legendTableStart()
               
     void propertiesTableEnd()
               
     void propertiesTableRowEnd()
               
     void propertiesTableRowStart()
               
     void propertiesTableStart(java.lang.String propertiesName)
               
     void saveFile()
              Writes the file.
     
    Methods inherited from class java.lang.Object
    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
     

    Field Detail

    fileName

    private java.lang.String fileName

    stringBuffer

    private java.lang.StringBuffer stringBuffer
    Constructor Detail

    HTMLGenerator

    public HTMLGenerator(java.lang.String fileName)
    Parameters:
    fileName - the name of the file to write to.
    Method Detail

    addField

    public void addField(java.lang.String name,
                         java.lang.Object object)
    Adds passed field to table. Use reflection to get the fields.

    Parameters:
    name -
    object -

    addString

    public void addString(java.lang.Object object)
    Adds a String


    addString

    public void addString(java.lang.String label,
                          java.lang.Object object)
    Adds a String


    arrayToString

    public static java.lang.String arrayToString(java.lang.Object[] object)
    Adds an Array

    Parameters:
    object -

    arrayToString

    public static java.lang.String arrayToString(boolean[] array)
    Adds an Array

    Parameters:
    array -

    arrayToString

    public static java.lang.String arrayToString(double[] values)
    Adds an Array

    Parameters:
    values -

    arrayToString

    public static java.lang.String arrayToString(double[][] values)
    Adds an Array

    Parameters:
    values -

    arrayToString

    public static java.lang.String arrayToString(float[] values)
    Adds an Array

    Parameters:
    values -

    arrayToString

    public static java.lang.String arrayToString(int[] values)
    Adds an Array

    Parameters:
    values -

    addImage

    public void addImage(java.lang.String fileName,
                         ImageMap imageMap)
    Adds an image


    addImageMapData

    private void addImageMapData(ImageMap imageMap,
                                 java.lang.String fileName)

    addLineBreak

    public void addLineBreak()
    Add line break


    saveFile

    public void saveFile()
    Writes the file.


    addTableRow

    public void addTableRow(java.lang.String label,
                            java.lang.Object value)
    Parameters:
    label -
    value -

    propertiesTableStart

    public void propertiesTableStart(java.lang.String propertiesName)
    Parameters:
    propertiesName -

    propertiesTableEnd

    public void propertiesTableEnd()

    propertiesTableRowStart

    public void propertiesTableRowStart()

    propertiesTableRowEnd

    public void propertiesTableRowEnd()

    chartTableStart

    public void chartTableStart(java.lang.String chartName,
                                java.lang.String imageFileName,
                                ImageMap imageMap)
    Parameters:
    chartName -
    imageFileName -
    imageMap - if this is NULL we are not creating image map data in html

    chartTableEnd

    public void chartTableEnd()

    chartTableRowStart

    public void chartTableRowStart()

    chartTableRowEnd

    public void chartTableRowEnd()

    legendTableStart

    public void legendTableStart()

    legendTableEnd

    public void legendTableEnd()

    innerTableRowStart

    public void innerTableRowStart()

    innerTableRowEnd

    public void innerTableRowEnd()


    jcharts-0.7.5/javadocs/org/jCharts/test/HTMLTestable.html0000644000175000001440000002340707751071400022275 0ustar onkarusers HTMLTestable (jCharts-0.7.5 API)

    org.jCharts.test
    Interface HTMLTestable

    All Known Implementing Classes:
    AreaProperties, Axis, AxisChartDataSet, AxisChartTypeProperties, AxisDataSeries, AxisProperties, AxisTypeProperties, ChartProperties, ChartTypeProperties, DataAxis, DataAxisProperties, DataSeries, DataSet, LabelAxis, LabelAxisProperties, Legend, LegendAreaProperties, LegendProperties, PieChart2DProperties, Properties, ScatterPlotDataSeries, ScatterPlotDataSet, StockChartDataSet, TextTag, TextTagGroup, XAxis, YAxis

    public interface HTMLTestable

    Interface class for Objects that can be displayed in a jCharts test.


    Method Summary
     void toHTML(HTMLGenerator htmlGenerator)
              Enables the testing routines to display the contents of this Object.
     

    Method Detail

    toHTML

    public void toHTML(HTMLGenerator htmlGenerator)
    Enables the testing routines to display the contents of this Object.

    Parameters:
    htmlGenerator -


    jcharts-0.7.5/javadocs/org/jCharts/test/LineTestDriver.html0000644000175000001440000004462007751071402022752 0ustar onkarusers LineTestDriver (jCharts-0.7.5 API)

    org.jCharts.test
    Class LineTestDriver

    java.lang.Object
      |
      +--org.jCharts.test.AxisChartTestBase
            |
            +--org.jCharts.test.LineTestDriver
    

    class LineTestDriver
    extends AxisChartTestBase

    This file provides examples of how to create all the different chart types provided by this package.


    Constructor Summary
    (package private) LineTestDriver()
               
     
    Method Summary
    (package private) static void axisChartTest(java.lang.String name, AxisChartTestBase axisChartTestBase)
              Test for LineChart
    (package private)  AxisChartDataSet createAxisChartDataSet(ChartType chartType, ChartTypeProperties chartTypeProperties, int numberOfDataSets, int numberOfValuesToCreate, int minValue, int maxValue)
              Generates a random MultiDataSet
    (package private)  DataSeries createDataSeries(int numberOfValuesToCreate)
               
    (package private) static ChartTypeProperties getChartTypeProperties(int numberOfDataSets)
              Separate this so can use for combo chart test
    (package private)  DataSeries getDataSeries()
               
    static void main(java.lang.String[] args)
              DataSeries getDataSeries() throws ChartDataException { String[] xAxisLabels={"1", "2", "3", "4", "5"}; DataSeries dataSeries=new DataSeries( xAxisLabels, "numbers", "numbers", "Bug #559177" ); AxisChartDataSet axisChartDataSet; double[][] data={{1, 2, 3, 4, 5}, {7, 8, Double.NaN, Double.NaN, Double.NaN}, {Double.NaN, Double.NaN, Double.NaN, Double.NaN, 2}}; String[] legendLabels={"set 1", "set 2", "set 3"}; Paint[] paints={Color.blue, Color.red, Color.green}; axisChartDataSet=new AxisChartDataSet( data, legendLabels, paints, ChartType.LINE, this.getChartTypeProperties( 3 ) ); dataSeries.addIAxisPlotDataSet( axisChartDataSet ); return dataSeries; }
    (package private)  boolean supportsImageMap()
               
     
    Methods inherited from class java.lang.Object
    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
     

    Constructor Detail

    LineTestDriver

    LineTestDriver()
    Method Detail

    supportsImageMap

    boolean supportsImageMap()
    Specified by:
    supportsImageMap in class AxisChartTestBase

    getChartTypeProperties

    static ChartTypeProperties getChartTypeProperties(int numberOfDataSets)
    Separate this so can use for combo chart test

    Parameters:
    numberOfDataSets -

    getDataSeries

    DataSeries getDataSeries()
                       throws ChartDataException
    Specified by:
    getDataSeries in class AxisChartTestBase
    ChartDataException

    main

    public static void main(java.lang.String[] args)
                     throws ChartDataException,
                            PropertyException
    DataSeries getDataSeries() throws ChartDataException { String[] xAxisLabels={"1", "2", "3", "4", "5"}; DataSeries dataSeries=new DataSeries( xAxisLabels, "numbers", "numbers", "Bug #559177" ); AxisChartDataSet axisChartDataSet; double[][] data={{1, 2, 3, 4, 5}, {7, 8, Double.NaN, Double.NaN, Double.NaN}, {Double.NaN, Double.NaN, Double.NaN, Double.NaN, 2}}; String[] legendLabels={"set 1", "set 2", "set 3"}; Paint[] paints={Color.blue, Color.red, Color.green}; axisChartDataSet=new AxisChartDataSet( data, legendLabels, paints, ChartType.LINE, this.getChartTypeProperties( 3 ) ); dataSeries.addIAxisPlotDataSet( axisChartDataSet ); return dataSeries; }

    ChartDataException
    PropertyException

    axisChartTest

    static void axisChartTest(java.lang.String name,
                              AxisChartTestBase axisChartTestBase)
                       throws ChartDataException,
                              PropertyException
    Test for LineChart

    ChartDataException
    PropertyException

    createDataSeries

    final DataSeries createDataSeries(int numberOfValuesToCreate)

    createAxisChartDataSet

    AxisChartDataSet createAxisChartDataSet(ChartType chartType,
                                            ChartTypeProperties chartTypeProperties,
                                            int numberOfDataSets,
                                            int numberOfValuesToCreate,
                                            int minValue,
                                            int maxValue)
                                      throws ChartDataException
    Generates a random MultiDataSet

    Parameters:
    numberOfDataSets -
    numberOfValuesToCreate - the number of doubles to generate
    minValue -
    maxValue -
    Returns:
    AxisChartDataSet
    ChartDataException


    jcharts-0.7.5/javadocs/org/jCharts/test/package-frame.html0000644000175000001440000000517007751071376022541 0ustar onkarusers org.jCharts.test (jCharts-0.7.5 API) org.jCharts.test
    Interfaces 
    HTMLChartTestable
    HTMLTestable
    Classes 
    AreaTestDriver
    AxisChartTestBase
    BarTestDriver
    ChartTestDriver
    ClusteredBarTestDriver
    ComboTestDriver
    HTMLGenerator
    LineTestDriver
    PieTestDriver
    PointTestDriver
    ScatterChartTestBase
    ScatterPlotTestDriver
    StackedAreaTestDriver
    StackedBarTestDriver
    StockTestDriver
    StopWatch
    SwingTest
    TestDataGenerator
    jcharts-0.7.5/javadocs/org/jCharts/test/package-summary.html0000644000175000001440000002313107751071376023141 0ustar onkarusers org.jCharts.test (jCharts-0.7.5 API)

    Package org.jCharts.test

    Interface Summary
    HTMLChartTestable Interface class for Chart Objects that can be displayed in a jCharts test.
    HTMLTestable Interface class for Objects that can be displayed in a jCharts test.
     

    Class Summary
    AreaTestDriver This file provides examples of how to create all the different chart types provided by this package.
    AxisChartTestBase  
    BarTestDriver This file provides examples of how to create all the different chart types provided by this package.
    ChartTestDriver This file provides examples of how to create all the different chart types provided by this package.
    ClusteredBarTestDriver This file provides examples of how to create all the different chart types provided by this package.
    ComboTestDriver This file provides examples of how to create all the different chart types provided by this package.
    HTMLGenerator Utility class for viewing a series of tests.
    LineTestDriver This file provides examples of how to create all the different chart types provided by this package.
    PieTestDriver This file provides examples of how to create all the different chart types provided by this package.
    PointTestDriver This file provides examples of how to create all the different chart types provided by this package.
    ScatterChartTestBase  
    ScatterPlotTestDriver This file provides examples of how to create all the different chart types provided by this package.
    StackedAreaTestDriver This file provides examples of how to create all the different chart types provided by this package.
    StackedBarTestDriver This file provides examples of how to create all the different chart types provided by this package.
    StockTestDriver This file provides examples of how to create all the different chart types provided by this package.
    StopWatch  
    SwingTest  
    TestDataGenerator  
     



    jcharts-0.7.5/javadocs/org/jCharts/test/package-tree.html0000644000175000001440000002026007751071376022403 0ustar onkarusers org.jCharts.test Class Hierarchy (jCharts-0.7.5 API)

    Hierarchy For Package org.jCharts.test

    Package Hierarchies:
    All Packages

    Class Hierarchy

    Interface Hierarchy



    jcharts-0.7.5/javadocs/org/jCharts/test/PieTestDriver.html0000644000175000001440000002747707751071402022613 0ustar onkarusers PieTestDriver (jCharts-0.7.5 API)

    org.jCharts.test
    Class PieTestDriver

    java.lang.Object
      |
      +--org.jCharts.test.PieTestDriver
    

    abstract class PieTestDriver
    extends java.lang.Object

    This file provides examples of how to create all the different chart types provided by this package.


    Constructor Summary
    (package private) PieTestDriver()
               
     
    Method Summary
    private static PieChartDataSet getPieChartDataSet(int numToCreate, int minValue, int maxValue)
              Generates a random NonAxisChartDataSet
    static void main(java.lang.String[] args)
               
    (package private) static void test()
              Test for PieChart2D
     
    Methods inherited from class java.lang.Object
    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
     

    Constructor Detail

    PieTestDriver

    PieTestDriver()
    Method Detail

    test

    static void test()
              throws ChartDataException,
                     PropertyException
    Test for PieChart2D

    Throws:
    ChartDataException
    PropertyException

    getPieChartDataSet

    private static PieChartDataSet getPieChartDataSet(int numToCreate,
                                                      int minValue,
                                                      int maxValue)
                                               throws ChartDataException
    Generates a random NonAxisChartDataSet

    Parameters:
    numToCreate - the number of doubles to generate
    minValue -
    maxValue -
    Returns:
    PieChartDataSet
    ChartDataException

    main

    public static void main(java.lang.String[] args)
                     throws ChartDataException,
                            PropertyException
    ChartDataException
    PropertyException


    jcharts-0.7.5/javadocs/org/jCharts/test/PointTestDriver.html0000644000175000001440000004153207751071402023153 0ustar onkarusers PointTestDriver (jCharts-0.7.5 API)

    org.jCharts.test
    Class PointTestDriver

    java.lang.Object
      |
      +--org.jCharts.test.AxisChartTestBase
            |
            +--org.jCharts.test.PointTestDriver
    

    class PointTestDriver
    extends AxisChartTestBase

    This file provides examples of how to create all the different chart types provided by this package.


    Constructor Summary
    (package private) PointTestDriver()
               
     
    Method Summary
    (package private) static void axisChartTest(java.lang.String name, AxisChartTestBase axisChartTestBase)
              Test for LineChart
    (package private)  AxisChartDataSet createAxisChartDataSet(ChartType chartType, ChartTypeProperties chartTypeProperties, int numberOfDataSets, int numberOfValuesToCreate, int minValue, int maxValue)
              Generates a random MultiDataSet
    (package private)  DataSeries createDataSeries(int numberOfValuesToCreate)
               
    (package private) static ChartTypeProperties getChartTypeProperties(int numberOfDataSets)
              Separate this so can use for combo chart test
    (package private)  DataSeries getDataSeries()
               
    static void main(java.lang.String[] args)
               
    (package private)  boolean supportsImageMap()
               
     
    Methods inherited from class java.lang.Object
    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
     

    Constructor Detail

    PointTestDriver

    PointTestDriver()
    Method Detail

    supportsImageMap

    boolean supportsImageMap()
    Specified by:
    supportsImageMap in class AxisChartTestBase

    getChartTypeProperties

    static ChartTypeProperties getChartTypeProperties(int numberOfDataSets)
    Separate this so can use for combo chart test


    getDataSeries

    DataSeries getDataSeries()
                       throws ChartDataException
    Specified by:
    getDataSeries in class AxisChartTestBase
    ChartDataException

    main

    public static void main(java.lang.String[] args)
                     throws PropertyException,
                            ChartDataException
    Parameters:
    args -
    Throws:
    PropertyException
    ChartDataException

    axisChartTest

    static void axisChartTest(java.lang.String name,
                              AxisChartTestBase axisChartTestBase)
                       throws ChartDataException,
                              PropertyException
    Test for LineChart

    ChartDataException
    PropertyException

    createDataSeries

    final DataSeries createDataSeries(int numberOfValuesToCreate)

    createAxisChartDataSet

    AxisChartDataSet createAxisChartDataSet(ChartType chartType,
                                            ChartTypeProperties chartTypeProperties,
                                            int numberOfDataSets,
                                            int numberOfValuesToCreate,
                                            int minValue,
                                            int maxValue)
                                      throws ChartDataException
    Generates a random MultiDataSet

    Parameters:
    numberOfDataSets -
    numberOfValuesToCreate - the number of doubles to generate
    minValue -
    maxValue -
    Returns:
    AxisChartDataSet
    ChartDataException


    jcharts-0.7.5/javadocs/org/jCharts/test/ScatterChartTestBase.html0000644000175000001440000003462107751071402024071 0ustar onkarusers ScatterChartTestBase (jCharts-0.7.5 API)

    org.jCharts.test
    Class ScatterChartTestBase

    java.lang.Object
      |
      +--org.jCharts.test.ScatterChartTestBase
    
    Direct Known Subclasses:
    ScatterPlotTestDriver

    abstract class ScatterChartTestBase
    extends java.lang.Object


    Constructor Summary
    ScatterChartTestBase()
               
     
    Method Summary
    (package private) static void axisChartTest(java.lang.String name, ScatterChartTestBase axisChartTestBase)
              Test for LineChart
    (package private)  AxisChartDataSet createAxisChartDataSet(ChartType chartType, ChartTypeProperties chartTypeProperties, int numberOfDataSets, int numberOfValuesToCreate, int minValue, int maxValue)
              Generates a random MultiDataSet
    (package private)  DataSeries createDataSeries(int numberOfValuesToCreate)
               
    (package private) abstract  ScatterPlotDataSeries getDataSeries()
               
    (package private) abstract  boolean supportsImageMap()
               
     
    Methods inherited from class java.lang.Object
    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
     

    Constructor Detail

    ScatterChartTestBase

    public ScatterChartTestBase()
    Method Detail

    getDataSeries

    abstract ScatterPlotDataSeries getDataSeries()
                                          throws ChartDataException
    ChartDataException

    supportsImageMap

    abstract boolean supportsImageMap()

    axisChartTest

    static void axisChartTest(java.lang.String name,
                              ScatterChartTestBase axisChartTestBase)
                       throws ChartDataException,
                              PropertyException
    Test for LineChart

    ChartDataException
    PropertyException

    createDataSeries

    final DataSeries createDataSeries(int numberOfValuesToCreate)

    createAxisChartDataSet

    AxisChartDataSet createAxisChartDataSet(ChartType chartType,
                                            ChartTypeProperties chartTypeProperties,
                                            int numberOfDataSets,
                                            int numberOfValuesToCreate,
                                            int minValue,
                                            int maxValue)
                                      throws ChartDataException
    Generates a random MultiDataSet

    Parameters:
    numberOfDataSets -
    numberOfValuesToCreate - the number of doubles to generate
    minValue -
    maxValue -
    Returns:
    AxisChartDataSet
    ChartDataException


    jcharts-0.7.5/javadocs/org/jCharts/test/ScatterPlotTestDriver.html0000644000175000001440000005114207751071402024324 0ustar onkarusers ScatterPlotTestDriver (jCharts-0.7.5 API)

    org.jCharts.test
    Class ScatterPlotTestDriver

    java.lang.Object
      |
      +--org.jCharts.test.ScatterChartTestBase
            |
            +--org.jCharts.test.ScatterPlotTestDriver
    

    public class ScatterPlotTestDriver
    extends ScatterChartTestBase

    This file provides examples of how to create all the different chart types provided by this package.


    Constructor Summary
    ScatterPlotTestDriver()
               
     
    Method Summary
    (package private) static void axisChartTest(java.lang.String name, ScatterChartTestBase axisChartTestBase)
              Test for LineChart
    (package private)  AxisChartDataSet createAxisChartDataSet(ChartType chartType, ChartTypeProperties chartTypeProperties, int numberOfDataSets, int numberOfValuesToCreate, int minValue, int maxValue)
              Generates a random MultiDataSet
    (package private)  DataSeries createDataSeries(int numberOfValuesToCreate)
               
    private  ScatterPlotDataSet createScatterPlotDataSet(int numberOfDataSets, int numberOfValuesToCreate, int xMinValue, int xMaxValue, int yMinValue, int yMaxValue)
              Generates a random MultiDataSet
    (package private)  ScatterPlotDataSeries getDataSeries()
               
    private  ScatterPlotProperties getScatterPlotProperties(int numberOfDataSets)
              Separate this so can use for combo chart test
    static void main(java.lang.String[] args)
              DataSeries getDataSeries() throws ChartDataException { String[] xAxisLabels={"1", "2", "3", "4", "5"}; DataSeries dataSeries=new DataSeries( xAxisLabels, "numbers", "numbers", "Bug #559177" ); AxisChartDataSet axisChartDataSet; double[][] data={{1, 2, 3, 4, 5}, {7, 8, Double.NaN, Double.NaN, Double.NaN}, {Double.NaN, Double.NaN, Double.NaN, Double.NaN, 2}}; String[] legendLabels={"set 1", "set 2", "set 3"}; Paint[] paints={Color.blue, Color.red, Color.green}; axisChartDataSet=new AxisChartDataSet( data, legendLabels, paints, ChartType.LINE, this.getChartTypeProperties( 3 ) ); dataSeries.addIAxisPlotDataSet( axisChartDataSet ); return dataSeries; }
    (package private)  boolean supportsImageMap()
               
     
    Methods inherited from class java.lang.Object
    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
     

    Constructor Detail

    ScatterPlotTestDriver

    public ScatterPlotTestDriver()
    Method Detail

    supportsImageMap

    boolean supportsImageMap()
    Specified by:
    supportsImageMap in class ScatterChartTestBase

    getScatterPlotProperties

    private ScatterPlotProperties getScatterPlotProperties(int numberOfDataSets)
    Separate this so can use for combo chart test

    Parameters:
    numberOfDataSets -

    createScatterPlotDataSet

    private ScatterPlotDataSet createScatterPlotDataSet(int numberOfDataSets,
                                                        int numberOfValuesToCreate,
                                                        int xMinValue,
                                                        int xMaxValue,
                                                        int yMinValue,
                                                        int yMaxValue)
                                                 throws ChartDataException
    Generates a random MultiDataSet

    Parameters:
    numberOfDataSets -
    numberOfValuesToCreate - the number of doubles to generate
    xMinValue -
    xMaxValue -
    yMinValue -
    yMaxValue -
    Returns:
    AxisChartDataSet
    ChartDataException

    getDataSeries

    ScatterPlotDataSeries getDataSeries()
                                  throws ChartDataException
    Specified by:
    getDataSeries in class ScatterChartTestBase
    ChartDataException

    main

    public static void main(java.lang.String[] args)
                     throws ChartDataException,
                            PropertyException
    DataSeries getDataSeries() throws ChartDataException { String[] xAxisLabels={"1", "2", "3", "4", "5"}; DataSeries dataSeries=new DataSeries( xAxisLabels, "numbers", "numbers", "Bug #559177" ); AxisChartDataSet axisChartDataSet; double[][] data={{1, 2, 3, 4, 5}, {7, 8, Double.NaN, Double.NaN, Double.NaN}, {Double.NaN, Double.NaN, Double.NaN, Double.NaN, 2}}; String[] legendLabels={"set 1", "set 2", "set 3"}; Paint[] paints={Color.blue, Color.red, Color.green}; axisChartDataSet=new AxisChartDataSet( data, legendLabels, paints, ChartType.LINE, this.getChartTypeProperties( 3 ) ); dataSeries.addIAxisPlotDataSet( axisChartDataSet ); return dataSeries; }

    ChartDataException
    PropertyException

    axisChartTest

    static void axisChartTest(java.lang.String name,
                              ScatterChartTestBase axisChartTestBase)
                       throws ChartDataException,
                              PropertyException
    Test for LineChart

    ChartDataException
    PropertyException

    createDataSeries

    final DataSeries createDataSeries(int numberOfValuesToCreate)

    createAxisChartDataSet

    AxisChartDataSet createAxisChartDataSet(ChartType chartType,
                                            ChartTypeProperties chartTypeProperties,
                                            int numberOfDataSets,
                                            int numberOfValuesToCreate,
                                            int minValue,
                                            int maxValue)
                                      throws ChartDataException
    Generates a random MultiDataSet

    Parameters:
    numberOfDataSets -
    numberOfValuesToCreate - the number of doubles to generate
    minValue -
    maxValue -
    Returns:
    AxisChartDataSet
    ChartDataException


    jcharts-0.7.5/javadocs/org/jCharts/test/StackedAreaTestDriver.html0000644000175000001440000003770107751071402024234 0ustar onkarusers StackedAreaTestDriver (jCharts-0.7.5 API)

    org.jCharts.test
    Class StackedAreaTestDriver

    java.lang.Object
      |
      +--org.jCharts.test.AxisChartTestBase
            |
            +--org.jCharts.test.StackedAreaTestDriver
    

    class StackedAreaTestDriver
    extends AxisChartTestBase

    This file provides examples of how to create all the different chart types provided by this package.


    Constructor Summary
    (package private) StackedAreaTestDriver()
               
     
    Method Summary
    (package private) static void axisChartTest(java.lang.String name, AxisChartTestBase axisChartTestBase)
              Test for LineChart
    (package private)  AxisChartDataSet createAxisChartDataSet(ChartType chartType, ChartTypeProperties chartTypeProperties, int numberOfDataSets, int numberOfValuesToCreate, int minValue, int maxValue)
              Generates a random MultiDataSet
    (package private)  DataSeries createDataSeries(int numberOfValuesToCreate)
               
    (package private) static ChartTypeProperties getChartTypeProperties(int numberOfDataSets)
              Separate this so can use for combo chart test
    (package private)  DataSeries getDataSeries()
               
    (package private)  boolean supportsImageMap()
               
     
    Methods inherited from class java.lang.Object
    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
     

    Constructor Detail

    StackedAreaTestDriver

    StackedAreaTestDriver()
    Method Detail

    supportsImageMap

    boolean supportsImageMap()
    Specified by:
    supportsImageMap in class AxisChartTestBase

    getChartTypeProperties

    static ChartTypeProperties getChartTypeProperties(int numberOfDataSets)
    Separate this so can use for combo chart test


    getDataSeries

    DataSeries getDataSeries()
                       throws ChartDataException
    Specified by:
    getDataSeries in class AxisChartTestBase
    ChartDataException

    axisChartTest

    static void axisChartTest(java.lang.String name,
                              AxisChartTestBase axisChartTestBase)
                       throws ChartDataException,
                              PropertyException
    Test for LineChart

    ChartDataException
    PropertyException

    createDataSeries

    final DataSeries createDataSeries(int numberOfValuesToCreate)

    createAxisChartDataSet

    AxisChartDataSet createAxisChartDataSet(ChartType chartType,
                                            ChartTypeProperties chartTypeProperties,
                                            int numberOfDataSets,
                                            int numberOfValuesToCreate,
                                            int minValue,
                                            int maxValue)
                                      throws ChartDataException
    Generates a random MultiDataSet

    Parameters:
    numberOfDataSets -
    numberOfValuesToCreate - the number of doubles to generate
    minValue -
    maxValue -
    Returns:
    AxisChartDataSet
    ChartDataException


    jcharts-0.7.5/javadocs/org/jCharts/test/StackedBarTestDriver.html0000644000175000001440000003775507751071402024101 0ustar onkarusers StackedBarTestDriver (jCharts-0.7.5 API)

    org.jCharts.test
    Class StackedBarTestDriver

    java.lang.Object
      |
      +--org.jCharts.test.AxisChartTestBase
            |
            +--org.jCharts.test.StackedBarTestDriver
    

    public class StackedBarTestDriver
    extends AxisChartTestBase

    This file provides examples of how to create all the different chart types provided by this package.


    Constructor Summary
    StackedBarTestDriver()
               
     
    Method Summary
    (package private) static void axisChartTest(java.lang.String name, AxisChartTestBase axisChartTestBase)
              Test for LineChart
    (package private)  AxisChartDataSet createAxisChartDataSet(ChartType chartType, ChartTypeProperties chartTypeProperties, int numberOfDataSets, int numberOfValuesToCreate, int minValue, int maxValue)
              Generates a random MultiDataSet
    (package private)  DataSeries createDataSeries(int numberOfValuesToCreate)
               
    (package private)  DataSeries getDataSeries()
               
    static void main(java.lang.String[] args)
               
    (package private)  boolean supportsImageMap()
               
     
    Methods inherited from class java.lang.Object
    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
     

    Constructor Detail

    StackedBarTestDriver

    public StackedBarTestDriver()
    Method Detail

    supportsImageMap

    boolean supportsImageMap()
    Specified by:
    supportsImageMap in class AxisChartTestBase

    getDataSeries

    DataSeries getDataSeries()
                       throws ChartDataException
    Specified by:
    getDataSeries in class AxisChartTestBase
    ChartDataException

    main

    public static void main(java.lang.String[] args)
                     throws PropertyException,
                            ChartDataException
    Parameters:
    args -
    Throws:
    PropertyException
    ChartDataException

    axisChartTest

    static void axisChartTest(java.lang.String name,
                              AxisChartTestBase axisChartTestBase)
                       throws ChartDataException,
                              PropertyException
    Test for LineChart

    ChartDataException
    PropertyException

    createDataSeries

    final DataSeries createDataSeries(int numberOfValuesToCreate)

    createAxisChartDataSet

    AxisChartDataSet createAxisChartDataSet(ChartType chartType,
                                            ChartTypeProperties chartTypeProperties,
                                            int numberOfDataSets,
                                            int numberOfValuesToCreate,
                                            int minValue,
                                            int maxValue)
                                      throws ChartDataException
    Generates a random MultiDataSet

    Parameters:
    numberOfDataSets -
    numberOfValuesToCreate - the number of doubles to generate
    minValue -
    maxValue -
    Returns:
    AxisChartDataSet
    ChartDataException


    jcharts-0.7.5/javadocs/org/jCharts/test/StockTestDriver.html0000644000175000001440000003742207751071402023150 0ustar onkarusers StockTestDriver (jCharts-0.7.5 API)

    org.jCharts.test
    Class StockTestDriver

    java.lang.Object
      |
      +--org.jCharts.test.AxisChartTestBase
            |
            +--org.jCharts.test.StockTestDriver
    

    public final class StockTestDriver
    extends AxisChartTestBase

    This file provides examples of how to create all the different chart types provided by this package.


    Constructor Summary
    StockTestDriver()
               
     
    Method Summary
    (package private) static void axisChartTest(java.lang.String name, AxisChartTestBase axisChartTestBase)
              Test for LineChart
    (package private)  AxisChartDataSet createAxisChartDataSet(ChartType chartType, ChartTypeProperties chartTypeProperties, int numberOfDataSets, int numberOfValuesToCreate, int minValue, int maxValue)
              Generates a random MultiDataSet
    (package private)  DataSeries createDataSeries(int numberOfValuesToCreate)
               
    (package private) static ChartTypeProperties getChartTypeProperties(int numberOfDataSets)
              Separate this so can use for combo chart test
    (package private)  DataSeries getDataSeries()
              Test for LineChart
    (package private)  boolean supportsImageMap()
               
     
    Methods inherited from class java.lang.Object
    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
     

    Constructor Detail

    StockTestDriver

    public StockTestDriver()
    Method Detail

    supportsImageMap

    boolean supportsImageMap()
    Specified by:
    supportsImageMap in class AxisChartTestBase

    getChartTypeProperties

    static ChartTypeProperties getChartTypeProperties(int numberOfDataSets)
    Separate this so can use for combo chart test


    getDataSeries

    DataSeries getDataSeries()
                       throws ChartDataException
    Test for LineChart

    Specified by:
    getDataSeries in class AxisChartTestBase
    Throws:
    ChartDataException

    axisChartTest

    static void axisChartTest(java.lang.String name,
                              AxisChartTestBase axisChartTestBase)
                       throws ChartDataException,
                              PropertyException
    Test for LineChart

    ChartDataException
    PropertyException

    createDataSeries

    final DataSeries createDataSeries(int numberOfValuesToCreate)

    createAxisChartDataSet

    AxisChartDataSet createAxisChartDataSet(ChartType chartType,
                                            ChartTypeProperties chartTypeProperties,
                                            int numberOfDataSets,
                                            int numberOfValuesToCreate,
                                            int minValue,
                                            int maxValue)
                                      throws ChartDataException
    Generates a random MultiDataSet

    Parameters:
    numberOfDataSets -
    numberOfValuesToCreate - the number of doubles to generate
    minValue -
    maxValue -
    Returns:
    AxisChartDataSet
    ChartDataException


    jcharts-0.7.5/javadocs/org/jCharts/test/StopWatch.html0000644000175000001440000002612307751071402021761 0ustar onkarusers StopWatch (jCharts-0.7.5 API)

    org.jCharts.test
    Class StopWatch

    java.lang.Object
      |
      +--org.jCharts.test.StopWatch
    

    public class StopWatch
    extends java.lang.Object


    Field Summary
    private  long start
               
    private  long stop
               
     
    Constructor Summary
    StopWatch()
               
     
    Method Summary
     void start()
               
     void stop()
               
     java.lang.String toString()
               
     
    Methods inherited from class java.lang.Object
    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
     

    Field Detail

    start

    private long start

    stop

    private long stop
    Constructor Detail

    StopWatch

    public StopWatch()
    Method Detail

    start

    public void start()

    stop

    public void stop()

    toString

    public java.lang.String toString()
    Overrides:
    toString in class java.lang.Object


    jcharts-0.7.5/javadocs/org/jCharts/test/SwingTest.html0000644000175000001440000005473107751071402022002 0ustar onkarusers SwingTest (jCharts-0.7.5 API)

    org.jCharts.test
    Class SwingTest

    java.lang.Object
      |
      +--java.awt.Component
            |
            +--java.awt.Container
                  |
                  +--java.awt.Window
                        |
                        +--java.awt.Frame
                              |
                              +--javax.swing.JFrame
                                    |
                                    +--org.jCharts.test.SwingTest
    
    All Implemented Interfaces:
    javax.accessibility.Accessible, java.awt.image.ImageObserver, java.awt.MenuContainer, javax.swing.RootPaneContainer, java.io.Serializable, javax.swing.WindowConstants

    public class SwingTest
    extends javax.swing.JFrame

    See Also:
    Serialized Form

    Field Summary
    private  javax.swing.JPanel panel
               
     
    Fields inherited from class javax.swing.JFrame
    accessibleContext, EXIT_ON_CLOSE, rootPane, rootPaneCheckingEnabled
     
    Fields inherited from class java.awt.Frame
    CROSSHAIR_CURSOR, DEFAULT_CURSOR, E_RESIZE_CURSOR, HAND_CURSOR, ICONIFIED, MAXIMIZED_BOTH, MAXIMIZED_HORIZ, MAXIMIZED_VERT, MOVE_CURSOR, N_RESIZE_CURSOR, NE_RESIZE_CURSOR, NORMAL, NW_RESIZE_CURSOR, S_RESIZE_CURSOR, SE_RESIZE_CURSOR, SW_RESIZE_CURSOR, TEXT_CURSOR, W_RESIZE_CURSOR, WAIT_CURSOR
     
    Fields inherited from class java.awt.Window
     
    Fields inherited from class java.awt.Container
     
    Fields inherited from class java.awt.Component
    BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
     
    Fields inherited from interface javax.swing.WindowConstants
    DISPOSE_ON_CLOSE, DO_NOTHING_ON_CLOSE, HIDE_ON_CLOSE
     
    Fields inherited from interface java.awt.image.ImageObserver
    ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
     
    Constructor Summary
    SwingTest()
               
     
    Method Summary
    private  void exitForm(java.awt.event.WindowEvent windowEvent)
              Exit the Application
    private  void initComponents()
               
    static void main(java.lang.String[] args)
               
     
    Methods inherited from class javax.swing.JFrame
    addImpl, createRootPane, frameInit, getAccessibleContext, getContentPane, getDefaultCloseOperation, getGlassPane, getJMenuBar, getLayeredPane, getRootPane, isDefaultLookAndFeelDecorated, isRootPaneCheckingEnabled, paramString, processWindowEvent, remove, setContentPane, setDefaultCloseOperation, setDefaultLookAndFeelDecorated, setGlassPane, setJMenuBar, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, update
     
    Methods inherited from class java.awt.Frame
    addNotify, finalize, getCursorType, getExtendedState, getFrames, getIconImage, getMaximizedBounds, getMenuBar, getState, getTitle, isResizable, isUndecorated, remove, removeNotify, setCursor, setExtendedState, setIconImage, setMaximizedBounds, setMenuBar, setResizable, setState, setTitle, setUndecorated
     
    Methods inherited from class java.awt.Window
    addPropertyChangeListener, addPropertyChangeListener, addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, dispose, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getFocusTraversalKeys, getGraphicsConfiguration, getInputContext, getListeners, getLocale, getMostRecentFocusOwner, getOwnedWindows, getOwner, getToolkit, getWarningString, getWindowFocusListeners, getWindowListeners, getWindowStateListeners, hide, isActive, isFocusableWindow, isFocusCycleRoot, isFocused, isShowing, pack, postEvent, processEvent, processWindowFocusEvent, processWindowStateEvent, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, setCursor, setFocusableWindowState, setFocusCycleRoot, setLocationRelativeTo, show, toBack, toFront
     
    Methods inherited from class java.awt.Container
    add, add, add, add, add, addContainerListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getContainerListeners, getFocusTraversalPolicy, getInsets, getLayout, getMaximumSize, getMinimumSize, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paint, paintComponents, preferredSize, print, printComponents, processContainerEvent, remove, removeAll, removeContainerListener, setFocusTraversalKeys, setFocusTraversalPolicy, setFont, transferFocusBackward, transferFocusDownCycle, validate, validateTree
     
    Methods inherited from class java.awt.Component
    action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isOpaque, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, size, toString, transferFocus, transferFocusUpCycle
     
    Methods inherited from class java.lang.Object
    clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
     
    Methods inherited from interface java.awt.MenuContainer
    getFont, postEvent
     

    Field Detail

    panel

    private javax.swing.JPanel panel
    Constructor Detail

    SwingTest

    public SwingTest()
              throws ChartDataException,
                     PropertyException
    Method Detail

    initComponents

    private void initComponents()
                         throws ChartDataException,
                                PropertyException
    ChartDataException
    PropertyException

    exitForm

    private void exitForm(java.awt.event.WindowEvent windowEvent)
    Exit the Application

    Parameters:
    windowEvent -

    main

    public static void main(java.lang.String[] args)
                     throws ChartDataException,
                            PropertyException
    ChartDataException
    PropertyException


    jcharts-0.7.5/javadocs/org/jCharts/test/TestDataGenerator.html0000644000175000001440000005242007751071402023424 0ustar onkarusers TestDataGenerator (jCharts-0.7.5 API)

    org.jCharts.test
    Class TestDataGenerator

    java.lang.Object
      |
      +--org.jCharts.test.TestDataGenerator
    

    public final class TestDataGenerator
    extends java.lang.Object


    Field Summary
    private static java.awt.Font[] ALL_FONTS
               
     
    Constructor Summary
    TestDataGenerator()
               
     
    Method Summary
    protected static java.awt.Color getRandomColor()
              Random Color generator.
    static java.awt.Font getRandomFont(double minSize, double maxSize)
              Random font generator based on the available Fonts on this machine.
    static double getRandomNumber(double maxValue)
              Random number generator.
    protected static double getRandomNumber(double minValue, double maxValue)
              Random number generator in specified range.
    static double[] getRandomNumbers(int numToGenerate, double minValue, double maxValue)
              Random numbers generator in specified range.
    static double[][] getRandomNumbers(int numberOfDataSets, int numToGenerate, double minValue, double maxValue)
              Random numbers generator in specified range.
    protected static java.awt.Paint getRandomPaint()
              Random Paint generator.
    static java.awt.Paint[] getRandomPaints(int numToCreate)
              Random Color generator.
    static java.awt.geom.Point2D.Double[] getRandomPoints(int numToGenerate, double xMinValue, double xMaxValue, double yMinValue, double yMaxValue)
              Random numbers generator in specified range.
    protected static java.lang.String getRandomString(int maxStringLength, boolean canBeNull)
              Random String generator.
    protected static java.lang.String[] getRandomStrings(int numToCreate, int maxStringLength, boolean canBeNull)
              Random String generator.
    protected static void randomizeAxisProperties(AxisProperties axisProperties)
              Takes the passed AxisProperties and randomizes it.
    protected static void randomizeLegend(LegendProperties legendProperties)
              Takes the passed Legend and randomizes it.
     
    Methods inherited from class java.lang.Object
    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
     

    Field Detail

    ALL_FONTS

    private static final java.awt.Font[] ALL_FONTS
    Constructor Detail

    TestDataGenerator

    public TestDataGenerator()
    Method Detail

    getRandomFont

    public static java.awt.Font getRandomFont(double minSize,
                                              double maxSize)
    Random font generator based on the available Fonts on this machine.

    Parameters:
    minSize -
    maxSize -
    Returns:
    Font

    getRandomNumber

    public static double getRandomNumber(double maxValue)
    Random number generator.

    Parameters:
    maxValue -
    Returns:
    double

    getRandomNumber

    protected static double getRandomNumber(double minValue,
                                            double maxValue)
    Random number generator in specified range.

    Parameters:
    minValue -
    maxValue -
    Returns:
    double

    getRandomNumbers

    public static double[] getRandomNumbers(int numToGenerate,
                                            double minValue,
                                            double maxValue)
    Random numbers generator in specified range.

    Parameters:
    numToGenerate - the number of doubles to generate
    minValue -
    maxValue -
    Returns:
    double[]

    getRandomNumbers

    public static double[][] getRandomNumbers(int numberOfDataSets,
                                              int numToGenerate,
                                              double minValue,
                                              double maxValue)
    Random numbers generator in specified range.

    Parameters:
    numberOfDataSets - to generate
    numToGenerate - the number of doubles to generate
    minValue -
    maxValue -
    Returns:
    double[]

    getRandomPoints

    public static java.awt.geom.Point2D.Double[] getRandomPoints(int numToGenerate,
                                                                 double xMinValue,
                                                                 double xMaxValue,
                                                                 double yMinValue,
                                                                 double yMaxValue)
    Random numbers generator in specified range.

    Parameters:
    numToGenerate - the number of doubles to generate
    xMinValue -
    xMaxValue -
    yMinValue -
    yMaxValue -
    Returns:
    Point.Double[]

    getRandomPaint

    protected static java.awt.Paint getRandomPaint()
    Random Paint generator.

    Returns:
    Paint

    getRandomPaints

    public static java.awt.Paint[] getRandomPaints(int numToCreate)
    Random Color generator.

    Returns:
    Paint[]

    getRandomColor

    protected static java.awt.Color getRandomColor()
    Random Color generator.

    Returns:
    Color

    getRandomString

    protected static java.lang.String getRandomString(int maxStringLength,
                                                      boolean canBeNull)
    Random String generator.

    Parameters:
    maxStringLength -
    canBeNull -
    Returns:
    String

    getRandomStrings

    protected static java.lang.String[] getRandomStrings(int numToCreate,
                                                         int maxStringLength,
                                                         boolean canBeNull)
    Random String generator.

    Returns:
    String[]

    randomizeAxisProperties

    protected static void randomizeAxisProperties(AxisProperties axisProperties)
    Takes the passed AxisProperties and randomizes it.

    Parameters:
    axisProperties -

    randomizeLegend

    protected static void randomizeLegend(LegendProperties legendProperties)
    Takes the passed Legend and randomizes it.

    Parameters:
    legendProperties -


    jcharts-0.7.5/javadocs/org/jCharts/types/0000755000175000001440000000000007751071404017342 5ustar onkarusersjcharts-0.7.5/javadocs/org/jCharts/types/ChartType.html0000644000175000001440000004253607751071402022143 0ustar onkarusers ChartType (jCharts-0.7.5 API)

    org.jCharts.types
    Class ChartType

    java.lang.Object
      |
      +--org.jCharts.types.IntType
            |
            +--org.jCharts.types.ChartType
    
    All Implemented Interfaces:
    java.io.Serializable

    public class ChartType
    extends IntType

    Chart IntType constants to be used on data sets to specify how they should be plotted.

    See Also:
    Serialized Form

    Field Summary
    static ChartType AREA
               
    static ChartType AREA_STACKED
               
    static ChartType BAR
               
    static ChartType BAR_CLUSTERED
               
    static ChartType BAR_STACKED
               
    static ChartType LINE
               
    static ChartType POINT
               
    static ChartType SCATTER_PLOT
               
    private  boolean stackedData
               
    static ChartType STOCK
               
     
    Fields inherited from class org.jCharts.types.IntType
     
    Constructor Summary
    private ChartType(int typeCode, boolean stackedData)
               
     
    Method Summary
     boolean equals(ChartType chartType)
              Returns flag indicating whether passed ChartType is equal to this one
     boolean isStacked()
              Returns flag indicating whether chart type has stacked data
     
    Methods inherited from class org.jCharts.types.IntType
    getInt
     
    Methods inherited from class java.lang.Object
    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
     

    Field Detail

    BAR

    public static final ChartType BAR

    BAR_CLUSTERED

    public static final ChartType BAR_CLUSTERED

    BAR_STACKED

    public static final ChartType BAR_STACKED

    LINE

    public static final ChartType LINE

    POINT

    public static final ChartType POINT

    AREA

    public static final ChartType AREA

    AREA_STACKED

    public static final ChartType AREA_STACKED

    STOCK

    public static final ChartType STOCK

    SCATTER_PLOT

    public static final ChartType SCATTER_PLOT

    stackedData

    private boolean stackedData
    Constructor Detail

    ChartType

    private ChartType(int typeCode,
                      boolean stackedData)
    Method Detail

    isStacked

    public boolean isStacked()
    Returns flag indicating whether chart type has stacked data

    Returns:
    boolean

    equals

    public boolean equals(ChartType chartType)
    Returns flag indicating whether passed ChartType is equal to this one

    Returns:
    boolean


    jcharts-0.7.5/javadocs/org/jCharts/types/IntType.html0000644000175000001440000002464107751071402021631 0ustar onkarusers IntType (jCharts-0.7.5 API)

    org.jCharts.types
    Class IntType

    java.lang.Object
      |
      +--org.jCharts.types.IntType
    
    All Implemented Interfaces:
    java.io.Serializable
    Direct Known Subclasses:
    ChartType, PieLabelType, StockChartDataType

    public abstract class IntType
    extends java.lang.Object
    implements java.io.Serializable

    Provides a common base class for all types.

    See Also:
    Serialized Form

    Field Summary
    private  int type
               
     
    Constructor Summary
    protected IntType(int typeCode)
               
     
    Method Summary
     int getInt()
               
     
    Methods inherited from class java.lang.Object
    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
     

    Field Detail

    type

    private int type
    Constructor Detail

    IntType

    protected IntType(int typeCode)
    Parameters:
    typeCode -
    Method Detail

    getInt

    public int getInt()
    Returns:
    int


    jcharts-0.7.5/javadocs/org/jCharts/types/package-frame.html0000644000175000001440000000233707751071376022730 0ustar onkarusers org.jCharts.types (jCharts-0.7.5 API) org.jCharts.types
    Classes 
    ChartType
    IntType
    PieLabelType
    StockChartDataType
    Type
    jcharts-0.7.5/javadocs/org/jCharts/types/package-summary.html0000644000175000001440000001352107751071376023330 0ustar onkarusers org.jCharts.types (jCharts-0.7.5 API)

    Package org.jCharts.types

    Class Summary
    ChartType Chart IntType constants to be used on data sets to specify how they should be plotted.
    IntType Provides a common base class for all types.
    PieLabelType  
    StockChartDataType  
    Type Provides a common base class for all types.
     



    jcharts-0.7.5/javadocs/org/jCharts/types/package-tree.html0000644000175000001440000001316507751071376022576 0ustar onkarusers org.jCharts.types Class Hierarchy (jCharts-0.7.5 API)

    Hierarchy For Package org.jCharts.types

    Package Hierarchies:
    All Packages

    Class Hierarchy



    jcharts-0.7.5/javadocs/org/jCharts/types/PieLabelType.html0000644000175000001440000003137007751071402022551 0ustar onkarusers PieLabelType (jCharts-0.7.5 API)

    org.jCharts.types
    Class PieLabelType

    java.lang.Object
      |
      +--org.jCharts.types.IntType
            |
            +--org.jCharts.types.PieLabelType
    
    All Implemented Interfaces:
    java.io.Serializable

    public class PieLabelType
    extends IntType

    See Also:
    Serialized Form

    Field Summary
    static PieLabelType LEGEND_LABELS
               
    static PieLabelType NO_LABELS
               
    static PieLabelType VALUE_LABELS
               
     
    Fields inherited from class org.jCharts.types.IntType
     
    Constructor Summary
    private PieLabelType(int value)
               
     
    Method Summary
     boolean equals(PieLabelType pieLabelType)
               
     
    Methods inherited from class org.jCharts.types.IntType
    getInt
     
    Methods inherited from class java.lang.Object
    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
     

    Field Detail

    NO_LABELS

    public static final PieLabelType NO_LABELS

    VALUE_LABELS

    public static final PieLabelType VALUE_LABELS

    LEGEND_LABELS

    public static final PieLabelType LEGEND_LABELS
    Constructor Detail

    PieLabelType

    private PieLabelType(int value)
    Parameters:
    value -
    Method Detail

    equals

    public boolean equals(PieLabelType pieLabelType)


    jcharts-0.7.5/javadocs/org/jCharts/types/StockChartDataType.html0000644000175000001440000003035507751071402023735 0ustar onkarusers StockChartDataType (jCharts-0.7.5 API)

    org.jCharts.types
    Class StockChartDataType

    java.lang.Object
      |
      +--org.jCharts.types.IntType
            |
            +--org.jCharts.types.StockChartDataType
    
    All Implemented Interfaces:
    java.io.Serializable

    public class StockChartDataType
    extends IntType

    See Also:
    Serialized Form

    Field Summary
    static StockChartDataType CLOSE
               
    static StockChartDataType HIGH
               
    static StockChartDataType LOW
               
    static StockChartDataType OPEN
               
     
    Fields inherited from class org.jCharts.types.IntType
     
    Constructor Summary
    private StockChartDataType(int typeCode)
               
     
    Methods inherited from class org.jCharts.types.IntType
    getInt
     
    Methods inherited from class java.lang.Object
    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
     

    Field Detail

    OPEN

    public static final StockChartDataType OPEN

    CLOSE

    public static final StockChartDataType CLOSE

    HIGH

    public static final StockChartDataType HIGH

    LOW

    public static final StockChartDataType LOW
    Constructor Detail

    StockChartDataType

    private StockChartDataType(int typeCode)


    jcharts-0.7.5/javadocs/org/jCharts/types/Type.html0000644000175000001440000002372607751071402021161 0ustar onkarusers Type (jCharts-0.7.5 API)

    org.jCharts.types
    Class Type

    java.lang.Object
      |
      +--org.jCharts.types.Type
    
    All Implemented Interfaces:
    java.io.Serializable

    public abstract class Type
    extends java.lang.Object
    implements java.io.Serializable

    Provides a common base class for all types.

    See Also:
    Serialized Form

    Field Summary
    private  int typeCode
               
     
    Constructor Summary
    (package private) Type(int typeCode)
               
     
    Method Summary
     int getTypeCode()
               
     
    Methods inherited from class java.lang.Object
    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
     

    Field Detail

    typeCode

    private int typeCode
    Constructor Detail

    Type

    Type(int typeCode)
    Method Detail

    getTypeCode

    public int getTypeCode()
    Returns:
    int


    jcharts-0.7.5/javadocs/org/jCharts/Chart.html0000644000175000001440000006745707751071400020144 0ustar onkarusers Chart (jCharts-0.7.5 API)

    org.jCharts
    Class Chart

    java.lang.Object
      |
      +--org.jCharts.Chart
    
    All Implemented Interfaces:
    java.io.Serializable
    Direct Known Subclasses:
    AxisChart, PieChart2D

    public abstract class Chart
    extends java.lang.Object
    implements java.io.Serializable

    Base class of all charts.

    See Also:
    Serialized Form

    Field Summary
    private  java.awt.image.BufferedImage bufferedImage
               
    private  ChartProperties chartProperties
               
    private  boolean generateImageMap
               
    private  java.awt.Graphics2D graphics2D
               
    private  int height
               
    private  ImageMap imageMap
               
    private  Legend legend
               
    private  int width
               
     
    Constructor Summary
    Chart(LegendProperties legendProperties, ChartProperties chartProperties, int pixelWidth, int pixelHeight)
              Constructor
     
    Method Summary
     java.awt.image.BufferedImage getBufferedImage()
              Returns the BufferedImage used to generate the ImageMap.
     ChartProperties getChartProperties()
              Returns the general properties Object.
     boolean getGenerateImageMapFlag()
              Returns flag indicating whether to generate an ImageMap
     java.awt.Graphics2D getGraphics2D()
              Shortcut method to get Graphics2D.
     int getImageHeight()
              Returns the BufferedImage height
     ImageMap getImageMap()
               
     int getImageWidth()
              Returns the BufferedImage width
    protected  Legend getLegend()
              Returns the Legend.
     boolean hasLegend()
              Returns flag indicating if there is a Legend.
     void render()
              Call this to kick off rendering of the chart
    protected abstract  void renderChart()
               
    protected  float renderChartTitle(java.lang.String chartTitle, java.awt.font.FontRenderContext fontRenderContext)
              Displays the chart title and returns the height of the title PLUS title padding.
     void renderWithImageMap()
              Renders the chart into a BufferedImage so that we can calculate all the Image Map coordinates.
     void setGraphics2D(java.awt.Graphics2D graphics2D)
              Sets the graphics object to render the chart on by the encoder.
     void setImageMap(ImageMap imageMap)
              To optimze performance of the ImageMap Object, we create it once we know how many data elements are in the chart which is dependent on the AxisChart or PieChart2D
     void toHTML(HTMLGenerator htmlGenerator, java.lang.String imageFileName, ImageMap imageMap)
              Enables the testing routines to display the contents of this Object.
     
    Methods inherited from class java.lang.Object
    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
     

    Field Detail

    graphics2D

    private java.awt.Graphics2D graphics2D

    width

    private int width

    height

    private int height

    legend

    private Legend legend

    chartProperties

    private ChartProperties chartProperties

    generateImageMap

    private boolean generateImageMap

    imageMap

    private ImageMap imageMap

    bufferedImage

    private java.awt.image.BufferedImage bufferedImage
    Constructor Detail

    Chart

    public Chart(LegendProperties legendProperties,
                 ChartProperties chartProperties,
                 int pixelWidth,
                 int pixelHeight)
    Constructor

    Parameters:
    legendProperties -
    chartProperties -
    pixelWidth -
    pixelHeight -
    Method Detail

    getGenerateImageMapFlag

    public boolean getGenerateImageMapFlag()
    Returns flag indicating whether to generate an ImageMap

    Returns:
    boolean

    getBufferedImage

    public java.awt.image.BufferedImage getBufferedImage()
    Returns the BufferedImage used to generate the ImageMap. Only should be called on binary format images, such as PNG and JPG, as it will not work on SVG. This is a HACK and the design of jCharts should do better than this!!!!!!

    Returns:
    BufferedImage

    renderWithImageMap

    public void renderWithImageMap()
                            throws ChartDataException,
                                   PropertyException
    Renders the chart into a BufferedImage so that we can calculate all the Image Map coordinates.

    Throws:
    ChartDataException
    PropertyException

    render

    public void render()
                throws ChartDataException,
                       PropertyException
    Call this to kick off rendering of the chart

    Throws:
    ChartDataException
    PropertyException

    renderChartTitle

    protected float renderChartTitle(java.lang.String chartTitle,
                                     java.awt.font.FontRenderContext fontRenderContext)
    Displays the chart title and returns the height of the title PLUS title padding.

    Parameters:
    chartTitle -
    fontRenderContext -
    Returns:
    float the height required by the title. If no title is displayed, zero is returned.

    renderChart

    protected abstract void renderChart()
                                 throws ChartDataException,
                                        PropertyException
    Throws:
    ChartDataException
    PropertyException

    getImageWidth

    public final int getImageWidth()
    Returns the BufferedImage width

    Returns:
    int

    getImageHeight

    public final int getImageHeight()
    Returns the BufferedImage height

    Returns:
    int

    getChartProperties

    public final ChartProperties getChartProperties()
    Returns the general properties Object.

    Returns:
    ChartProperties

    getLegend

    protected final Legend getLegend()
    Returns the Legend. Will be NULL if no Legend is desired.

    Returns:
    Legend

    hasLegend

    public final boolean hasLegend()
    Returns flag indicating if there is a Legend.

    Returns:
    boolean

    setGraphics2D

    public final void setGraphics2D(java.awt.Graphics2D graphics2D)
    Sets the graphics object to render the chart on by the encoder.

    Parameters:
    graphics2D -

    getGraphics2D

    public final java.awt.Graphics2D getGraphics2D()
    Shortcut method to get Graphics2D. Be aware that the call BufferedImage.getGraphics() and BufferedImage.createGraphics(), actually create a new Grpahics2D Object on each invocation. This returns the member reference so calls to this are not creating a new Object each time.

    Returns:
    Graphics2D

    setImageMap

    public final void setImageMap(ImageMap imageMap)
    To optimze performance of the ImageMap Object, we create it once we know how many data elements are in the chart which is dependent on the AxisChart or PieChart2D

    Parameters:
    imageMap -

    getImageMap

    public final ImageMap getImageMap()
    Returns:
    imageMap

    toHTML

    public void toHTML(HTMLGenerator htmlGenerator,
                       java.lang.String imageFileName,
                       ImageMap imageMap)
    Enables the testing routines to display the contents of this Object.

    Parameters:
    htmlGenerator -
    imageFileName -
    imageMap - if this is NULL we are not creating image map data in html


    jcharts-0.7.5/javadocs/org/jCharts/Legend.html0000644000175000001440000007261307751071400020267 0ustar onkarusers Legend (jCharts-0.7.5 API)

    org.jCharts
    Class Legend

    java.lang.Object
      |
      +--org.jCharts.Legend
    
    All Implemented Interfaces:
    HTMLTestable, java.io.Serializable

    public final class Legend
    extends java.lang.Object
    implements HTMLTestable, java.io.Serializable

    Version:
    $Id: Legend.java,v 1.17 2003/04/19 01:39:17 nathaniel_auvil Exp $
    Author:
    Nathaniel Auvil, Sandor Dornbush, Sundar Balasubramanian
    See Also:
    Serialized Form

    Field Summary
    private  Chart chart
               
    private  java.util.ArrayList fillPointsFlags
               
    private  float height
               
    private  float iconSide
               
    private  java.util.ArrayList labels
               
    private  LegendProperties legendProperties
               
    private  int numColumns
               
    private  int numRows
               
    private  java.util.ArrayList paints
               
    private  java.util.ArrayList pointOutlinePaints
               
    private  java.util.ArrayList shapes
               
    private  TextProcessor textProcessor
               
    private  float widestLabelAndColumnPadding
               
    private  float width
               
    private  float x
               
    private  float y
               
     
    Constructor Summary
    Legend(Chart chart)
              Deprecated.  
    Legend(Chart chart, LegendProperties legendProperties)
               
     
    Method Summary
     void calculateDrawingValues(IData iData)
              Calculates the width and height needed to display the Legend.
     void computeLegendXY(IAxisDataSeries iAxisDataSeries, float chartTitleHeight)
               
    private  void determineWidthAndHeight(int numberOfLabels)
              Determines the dimensions needed for the Legend and creates the image for it.
     int getHeight()
               
     LegendProperties getLegendProperties()
               
     float getWidth()
               
    private  void processData(IAxisDataSeries iAxisDataSeries)
              Central method for processing data; try to minimize looping.
    private  void processData(IPieChartDataSet iPieChartDataSet)
              Central method for processing data; try to minimize looping.
    private  void processLegendLabels(IAxisPlotDataSet iAxisPlotDataSet)
              Method for processing data for AxisPlot datasets; try to minimize looping.
    private  void processLegendLabels(IPieChartDataSet iPieChartDataSet)
              Method for processing data for PieCharts; try to minimize looping.
     void render()
              Renders the legend.
     void setX(float x)
               
     void setY(float y)
               
     void toHTML(HTMLGenerator htmlGenerator)
              Enables the testing routines to display the contents of this Object.
     
    Methods inherited from class java.lang.Object
    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
     

    Field Detail

    chart

    private Chart chart

    legendProperties

    private LegendProperties legendProperties

    iconSide

    private float iconSide

    widestLabelAndColumnPadding

    private float widestLabelAndColumnPadding

    numColumns

    private int numColumns

    numRows

    private int numRows

    textProcessor

    private TextProcessor textProcessor

    x

    private float x

    y

    private float y

    width

    private float width

    height

    private float height

    labels

    private java.util.ArrayList labels

    paints

    private java.util.ArrayList paints

    shapes

    private java.util.ArrayList shapes

    fillPointsFlags

    private java.util.ArrayList fillPointsFlags

    pointOutlinePaints

    private java.util.ArrayList pointOutlinePaints
    Constructor Detail

    Legend

    public Legend(Chart chart)
    Deprecated.  

    Parameters:
    chart -

    Legend

    public Legend(Chart chart,
                  LegendProperties legendProperties)
    Parameters:
    chart -
    legendProperties -
    Method Detail

    setX

    public void setX(float x)

    setY

    public void setY(float y)

    computeLegendXY

    public void computeLegendXY(IAxisDataSeries iAxisDataSeries,
                                float chartTitleHeight)
    Parameters:
    iAxisDataSeries -
    chartTitleHeight -

    processData

    private void processData(IAxisDataSeries iAxisDataSeries)
    Central method for processing data; try to minimize looping. 1) calculate the maximum height of labels 2) find the maximum label width

    Parameters:
    iAxisDataSeries -

    processData

    private void processData(IPieChartDataSet iPieChartDataSet)
    Central method for processing data; try to minimize looping. 1) calculate the maximum height of labels 2) find the maximum label width

    Parameters:
    iPieChartDataSet -

    processLegendLabels

    private void processLegendLabels(IAxisPlotDataSet iAxisPlotDataSet)
    Method for processing data for AxisPlot datasets; try to minimize looping. 1) calculate the maximum height of labels 2) find the maximum label width

    Parameters:
    iAxisPlotDataSet -

    processLegendLabels

    private void processLegendLabels(IPieChartDataSet iPieChartDataSet)
    Method for processing data for PieCharts; try to minimize looping. 1) calculate the maximum height of labels 2) find the maximum label width

    Parameters:
    iPieChartDataSet -

    getLegendProperties

    public LegendProperties getLegendProperties()

    calculateDrawingValues

    public void calculateDrawingValues(IData iData)
    Calculates the width and height needed to display the Legend. Use the getWidth() and getHeight() methods to extract this information.

    Parameters:
    iData - can pass either the IPieChartDataSet or the IChartDataSeries to this.

    getWidth

    public float getWidth()

    getHeight

    public int getHeight()

    determineWidthAndHeight

    private void determineWidthAndHeight(int numberOfLabels)
    Determines the dimensions needed for the Legend and creates the image for it.


    render

    public void render()
    Renders the legend.


    toHTML

    public void toHTML(HTMLGenerator htmlGenerator)
    Enables the testing routines to display the contents of this Object.

    Specified by:
    toHTML in interface HTMLTestable
    Parameters:
    htmlGenerator -


    jcharts-0.7.5/javadocs/org/jCharts/package-frame.html0000644000175000001440000000173507751071376021565 0ustar onkarusers org.jCharts (jCharts-0.7.5 API) org.jCharts
    Classes 
    Chart
    Legend
    jcharts-0.7.5/javadocs/org/jCharts/package-summary.html0000644000175000001440000001233107751071376022162 0ustar onkarusers org.jCharts (jCharts-0.7.5 API)

    Package org.jCharts

    Class Summary
    Chart Base class of all charts.
    Legend  
     



    jcharts-0.7.5/javadocs/org/jCharts/package-tree.html0000644000175000001440000001236407751071376021432 0ustar onkarusers org.jCharts Class Hierarchy (jCharts-0.7.5 API)

    Hierarchy For Package org.jCharts

    Package Hierarchies:
    All Packages

    Class Hierarchy



    jcharts-0.7.5/javadocs/allclasses-frame.html0000644000175000001440000003205007751071376020125 0ustar onkarusers All Classes (jCharts-0.7.5 API) All Classes
    AreaChart
    AreaChartProperties
    AreaProperties
    AreaShape
    AreaTestDriver
    AutomaticScaleCalculator
    Axis
    AxisChart
    AxisChartDataProcessor
    AxisChartDataSet
    AxisChartTestBase
    AxisChartTypeProperties
    AxisDataSeries
    AxisProperties
    AxisTypeProperties
    AxisValueRenderEvent
    BackgroundRenderer
    BarChart
    BarChartProperties
    BarTestDriver
    BarValueGroup
    BinaryEncoderUtil
    Chart
    ChartDataException
    ChartFont
    ChartItem
    ChartProperties
    ChartScale
    ChartStroke
    ChartTestDriver
    ChartType
    ChartTypeProperties
    CircleMapArea
    ClusteredBarChart
    ClusteredBarChartProperties
    ClusteredBarTestDriver
    ComboTestDriver
    DataAxis
    DataAxisProperties
    DataSeries
    DataSet
    HTMLChartTestable
    HTMLGenerator
    HTMLTestable
    IAxisChartDataSet
    IAxisDataSeries
    IAxisPlotDataSet
    IData
    IDataSeries
    IDataSet
    ImageMap
    ImageMapArea
    ImageMapNotSupportedException
    IntType
    IPieChartDataSet
    IScatterPlotDataSeries
    IScatterPlotDataSet
    IStockChartDataSet
    JPEGEncoder
    JPEGEncoder13
    LabelAxis
    LabelAxisProperties
    Legend
    LegendAreaProperties
    LegendProperties
    LineChart
    LineChartProperties
    LineTestDriver
    NonStackedDataProcessor
    NumericTagGroup
    PieChart2D
    PieChart2DProperties
    PieChartDataProcessor
    PieChartDataSet
    PieLabelType
    PieTestDriver
    PNGEncoder
    PointChart
    PointChartProperties
    PointTestDriver
    PolyMapArea
    PostAxisValueRenderListener
    PreAxisValueRenderListener
    Properties
    PropertyException
    RectMapArea
    ScaleCalculator
    ScatterChartTestBase
    ScatterPlotAxisChart
    ScatterPlotChart
    ScatterPlotDataProcessor
    ScatterPlotDataSeries
    ScatterPlotDataSet
    ScatterPlotProperties
    ScatterPlotTestDriver
    ServletEncoderHelper
    StackedAreaChart
    StackedAreaChartProperties
    StackedAreaTestDriver
    StackedBarChart
    StackedBarChartProperties
    StackedBarTestDriver
    StackedDataProcessor
    StockChart
    StockChartDataSet
    StockChartDataType
    StockChartProperties
    StockDataProcessor
    StockTestDriver
    StopWatch
    SVGEncoder
    SwingTest
    TestDataGenerator
    TextProcessor
    TextTag
    TextTagGroup
    Type
    UserDefinedScaleCalculator
    ValueLabelPosition
    ValueLabelRenderer
    XAxis
    YAxis
    jcharts-0.7.5/javadocs/allclasses-noframe.html0000644000175000001440000002754407751071376020476 0ustar onkarusers All Classes (jCharts-0.7.5 API) All Classes
    AreaChart
    AreaChartProperties
    AreaProperties
    AreaShape
    AreaTestDriver
    AutomaticScaleCalculator
    Axis
    AxisChart
    AxisChartDataProcessor
    AxisChartDataSet
    AxisChartTestBase
    AxisChartTypeProperties
    AxisDataSeries
    AxisProperties
    AxisTypeProperties
    AxisValueRenderEvent
    BackgroundRenderer
    BarChart
    BarChartProperties
    BarTestDriver
    BarValueGroup
    BinaryEncoderUtil
    Chart
    ChartDataException
    ChartFont
    ChartItem
    ChartProperties
    ChartScale
    ChartStroke
    ChartTestDriver
    ChartType
    ChartTypeProperties
    CircleMapArea
    ClusteredBarChart
    ClusteredBarChartProperties
    ClusteredBarTestDriver
    ComboTestDriver
    DataAxis
    DataAxisProperties
    DataSeries
    DataSet
    HTMLChartTestable
    HTMLGenerator
    HTMLTestable
    IAxisChartDataSet
    IAxisDataSeries
    IAxisPlotDataSet
    IData
    IDataSeries
    IDataSet
    ImageMap
    ImageMapArea
    ImageMapNotSupportedException
    IntType
    IPieChartDataSet
    IScatterPlotDataSeries
    IScatterPlotDataSet
    IStockChartDataSet
    JPEGEncoder
    JPEGEncoder13
    LabelAxis
    LabelAxisProperties
    Legend
    LegendAreaProperties
    LegendProperties
    LineChart
    LineChartProperties
    LineTestDriver
    NonStackedDataProcessor
    NumericTagGroup
    PieChart2D
    PieChart2DProperties
    PieChartDataProcessor
    PieChartDataSet
    PieLabelType
    PieTestDriver
    PNGEncoder
    PointChart
    PointChartProperties
    PointTestDriver
    PolyMapArea
    PostAxisValueRenderListener
    PreAxisValueRenderListener
    Properties
    PropertyException
    RectMapArea
    ScaleCalculator
    ScatterChartTestBase
    ScatterPlotAxisChart
    ScatterPlotChart
    ScatterPlotDataProcessor
    ScatterPlotDataSeries
    ScatterPlotDataSet
    ScatterPlotProperties
    ScatterPlotTestDriver
    ServletEncoderHelper
    StackedAreaChart
    StackedAreaChartProperties
    StackedAreaTestDriver
    StackedBarChart
    StackedBarChartProperties
    StackedBarTestDriver
    StackedDataProcessor
    StockChart
    StockChartDataSet
    StockChartDataType
    StockChartProperties
    StockDataProcessor
    StockTestDriver
    StopWatch
    SVGEncoder
    SwingTest
    TestDataGenerator
    TextProcessor
    TextTag
    TextTagGroup
    Type
    UserDefinedScaleCalculator
    ValueLabelPosition
    ValueLabelRenderer
    XAxis
    YAxis
    jcharts-0.7.5/javadocs/constant-values.html0000644000175000001440000003626507751071376020051 0ustar onkarusers Constant Field Values (jCharts-0.7.5 API)

    Constant Field Values


    Contents
    org.jCharts.*

    org.jCharts.encoders.JPEGEncoder
    private static final java.lang.String JPEG "jpeg"

    org.jCharts.encoders.PNGEncoder
    private static final java.lang.String PNG "png"

    org.jCharts.encoders.ServletEncoderHelper
    public static final java.lang.String JPEG_MIME_TYPE "image/jpeg"
    public static final java.lang.String PNG_MIME_TYPE "image/png"
    public static final java.lang.String SVG_MIME_TYPE "image/svg+xml"

    org.jCharts.properties.AxisTypeProperties
    public static final int GRID_LINES_ALL 1
    public static final int GRID_LINES_NONE 0
    public static final int GRID_LINES_ONLY_WITH_LABELS 2
    public static final int TICKS_ALL 1
    public static final int TICKS_NONE 0
    public static final int TICKS_ONLY_WITH_LABELS 2

    org.jCharts.properties.LegendAreaProperties
    public static final int BOTTOM 0
    public static final int COLUMNS_AS_MANY_AS_NEEDED 0
    public static final int COLUMNS_FIT_TO_IMAGE -1
    public static final int LEFT 2
    public static final int RIGHT 1
    public static final int TOP 3

    org.jCharts.test.ChartTestDriver
    static final java.lang.String EXTENSION ".png"
    private static final java.lang.String JPEG ".jpg"
    private static final java.lang.String JPEG_LEGACY ".jpeg"
    static final java.lang.String OUTPUT_PATH ""
    private static final java.lang.String PNG ".png"
    private static final java.lang.String SVG ".svg"



    jcharts-0.7.5/javadocs/deprecated-list.html0000644000175000001440000001504407751071376017764 0ustar onkarusers Deprecated List (jCharts-0.7.5 API)

    Deprecated API

    Deprecated Classes
    org.jCharts.axisChart.axis.DataAxis
              just using the YAxis Object 
    org.jCharts.axisChart.axis.LabelAxis
              just using the Axis Object 
     

    Deprecated Constructors
    org.jCharts.axisChart.axis.DataAxis(AxisChart)
              this class is no longer used 
    org.jCharts.axisChart.axis.LabelAxis(AxisChart)
              this class is no longer used 
    org.jCharts.Legend(Chart)
                
    org.jCharts.axisChart.customRenderers.axisValue.renderers.ValueLabelRenderer(boolean, boolean, int)
                
     



    jcharts-0.7.5/javadocs/help-doc.html0000644000175000001440000001747407751071402016405 0ustar onkarusers API Help (jCharts-0.7.5 API)

    How This API Document Is Organized

    This API (Application Programming Interface) document has pages corresponding to the items in the navigation bar, described as follows.

    Overview

    The Overview page is the front page of this API document and provides a list of all packages with a summary for each. This page can also contain an overall description of the set of packages.

    Package

    Each package has a page that contains a list of its classes and interfaces, with a summary for each. This page can contain four categories:

    • Interfaces (italic)
    • Classes
    • Exceptions
    • Errors

    Class/Interface

    Each class, interface, nested class and nested interface has its own separate page. Each of these pages has three sections consisting of a class/interface description, summary tables, and detailed member descriptions:

    • Class inheritance diagram
    • Direct Subclasses
    • All Known Subinterfaces
    • All Known Implementing Classes
    • Class/interface declaration
    • Class/interface description

    • Nested Class Summary
    • Field Summary
    • Constructor Summary
    • Method Summary

    • Field Detail
    • Constructor Detail
    • Method Detail
    Each summary entry contains the first sentence from the detailed description for that item. The summary entries are alphabetical, while the detailed descriptions are in the order they appear in the source code. This preserves the logical groupings established by the programmer.

    Tree (Class Hierarchy)

    There is a Class Hierarchy page for all packages, plus a hierarchy for each package. Each hierarchy page contains a list of classes and a list of interfaces. The classes are organized by inheritance structure starting with java.lang.Object. The interfaces do not inherit from java.lang.Object.
    • When viewing the Overview page, clicking on "Tree" displays the hierarchy for all packages.
    • When viewing a particular package, class or interface page, clicking "Tree" displays the hierarchy for only that package.

    Deprecated API

    The Deprecated API page lists all of the API that have been deprecated. A deprecated API is not recommended for use, generally due to improvements, and a replacement API is usually given. Deprecated APIs may be removed in future implementations.

    Index

    The Index contains an alphabetic list of all classes, interfaces, constructors, methods, and fields.

    Prev/Next

    These links take you to the next or previous class, interface, package, or related page.

    Frames/No Frames

    These links show and hide the HTML frames. All pages are available with or without frames.

    Serialized Form

    Each serializable or externalizable class has a description of its serialization fields and methods. This information is of interest to re-implementors, not to developers using the API. While there is no link in the navigation bar, you can get to this information by going to any serialized class and clicking "Serialized Form" in the "See also" section of the class description.

    This help file applies to API documentation generated using the standard doclet.



    jcharts-0.7.5/javadocs/index-all.html0000644000175000001440000122426507751071376016600 0ustar onkarusers Index (jCharts-0.7.5 API)
    A B C D E F G H I J L M N O P R S T U V W X Y Z

    A

    ABOVE_ZERO_LINE - Static variable in class org.jCharts.axisChart.customRenderers.axisValue.renderers.ValueLabelPosition
     
    addAttribute(String, Object) - Method in class org.jCharts.chartText.TextTag
     
    addBarValue(int, double, Rectangle2D.Float) - Method in class org.jCharts.chartText.BarValueGroup
    Adds a bar value for the given data item, if barValues are on
    addCoordinate(int, float, float) - Method in class org.jCharts.imageMap.PolyMapArea
    Adds the x, y coordinate at the specified index.
    addDataPoints(Point2D.Double[], Paint, String) - Method in class org.jCharts.chartData.ScatterPlotDataSet
     
    addField(String, Object) - Method in class org.jCharts.test.HTMLGenerator
    Adds passed field to table.
    addIAxisPlotDataSet(IAxisPlotDataSet) - Method in class org.jCharts.chartData.AxisDataSeries
    Adds the passed IAxisPlotDataSet to the series
    addIAxisPlotDataSet(IAxisPlotDataSet) - Method in interface org.jCharts.chartData.interfaces.IAxisDataSeries
     
    addImage(String, ImageMap) - Method in class org.jCharts.test.HTMLGenerator
    Adds an image
    addImageMapArea(ImageMapArea) - Method in class org.jCharts.imageMap.ImageMap
     
    addImageMapData(ImageMap, String) - Method in class org.jCharts.test.HTMLGenerator
     
    addLabel(double) - Method in class org.jCharts.chartText.NumericTagGroup
     
    addLabel(String) - Method in class org.jCharts.chartText.TextTagGroup
     
    addLabel(String, Font, FontRenderContext) - Method in class org.jCharts.chartData.processors.TextProcessor
     
    addLineBreak() - Method in class org.jCharts.test.HTMLGenerator
    Add line break
    addPostRenderEventListener(PostAxisValueRenderListener) - Method in class org.jCharts.properties.AxisChartTypeProperties
    Allows you to get callbacks for custom implementations to render on the axis and to control the renderering on the axis after a value is drawn.
    addPreRenderEventListener(PreAxisValueRenderListener) - Method in class org.jCharts.properties.AxisChartTypeProperties
    Allows you to get callbacks for custom implementations to render on the axis and to control the renderering on the axis before a value is drawn.
    addString(Object) - Method in class org.jCharts.test.HTMLGenerator
    Adds a String
    addString(String, Object) - Method in class org.jCharts.test.HTMLGenerator
    Adds a String
    addTableRow(String, Object) - Method in class org.jCharts.test.HTMLGenerator
     
    addTextTags() - Method in class org.jCharts.axisChart.axis.LabelAxis
    Deprecated. Add the scale labels.
    addTextTags() - Method in class org.jCharts.axisChart.axis.DataAxis
    Deprecated. Add all text labels to be display on this axis.
    affineTransform - Variable in class org.jCharts.properties.util.ChartFont
     
    ALL_FONTS - Static variable in class org.jCharts.test.TestDataGenerator
     
    allowHorizontalPlot() - Method in class org.jCharts.axisChart.AxisChart
    We only allow horizontal plots for the Bar Chart types in this release.
    amDataAxis() - Method in class org.jCharts.axisChart.axis.LabelAxis
    Deprecated.  
    amDataAxis() - Method in class org.jCharts.axisChart.axis.DataAxis
    Deprecated.  
    amLabelAxis() - Method in class org.jCharts.axisChart.axis.LabelAxis
    Deprecated.  
    amLabelAxis() - Method in class org.jCharts.axisChart.axis.DataAxis
    Deprecated.  
    AREA - Static variable in class org.jCharts.types.ChartType
     
    AREA_STACKED - Static variable in class org.jCharts.types.ChartType
     
    AreaChart - class org.jCharts.axisChart.AreaChart.
     
    AreaChart() - Constructor for class org.jCharts.axisChart.AreaChart
     
    AreaChartProperties - class org.jCharts.properties.AreaChartProperties.
     
    AreaChartProperties() - Constructor for class org.jCharts.properties.AreaChartProperties
     
    AreaProperties - class org.jCharts.properties.AreaProperties.
     
    AreaProperties() - Constructor for class org.jCharts.properties.AreaProperties
     
    areas - Variable in class org.jCharts.imageMap.ImageMap
     
    AreaShape - class org.jCharts.imageMap.AreaShape.
     
    AreaShape(String) - Constructor for class org.jCharts.imageMap.AreaShape
     
    AreaTestDriver - class org.jCharts.test.AreaTestDriver.
    This file provides examples of how to create all the different chart types provided by this package.
    AreaTestDriver() - Constructor for class org.jCharts.test.AreaTestDriver
     
    arrayToString(boolean[]) - Static method in class org.jCharts.test.HTMLGenerator
    Adds an Array
    arrayToString(double[]) - Static method in class org.jCharts.test.HTMLGenerator
    Adds an Array
    arrayToString(double[][]) - Static method in class org.jCharts.test.HTMLGenerator
    Adds an Array
    arrayToString(float[]) - Static method in class org.jCharts.test.HTMLGenerator
    Adds an Array
    arrayToString(int[]) - Static method in class org.jCharts.test.HTMLGenerator
    Adds an Array
    arrayToString(Object[]) - Static method in class org.jCharts.test.HTMLGenerator
    Adds an Array
    AT_TOP - Static variable in class org.jCharts.axisChart.customRenderers.axisValue.renderers.ValueLabelPosition
     
    attributes - Variable in class org.jCharts.chartText.TextTag
     
    AutomaticScaleCalculator - class org.jCharts.axisChart.axis.scale.AutomaticScaleCalculator.
     
    AutomaticScaleCalculator() - Constructor for class org.jCharts.axisChart.axis.scale.AutomaticScaleCalculator
     
    Axis - class org.jCharts.axisChart.axis.Axis.
     
    AXIS_BOTTOM - Static variable in class org.jCharts.axisChart.customRenderers.axisValue.renderers.ValueLabelPosition
     
    AXIS_TOP - Static variable in class org.jCharts.axisChart.customRenderers.axisValue.renderers.ValueLabelPosition
     
    Axis(AxisChart, int) - Constructor for class org.jCharts.axisChart.axis.Axis
    Constructor
    axisChart - Variable in class org.jCharts.axisChart.axis.Axis
     
    axisChart - Variable in class org.jCharts.chartText.BarValueGroup
     
    AxisChart - class org.jCharts.axisChart.AxisChart.
    This Class is used to create all axis chart types.
    AxisChart(IAxisDataSeries, ChartProperties, AxisProperties, LegendProperties, int, int) - Constructor for class org.jCharts.axisChart.AxisChart
    Constructor
    AxisChartDataProcessor - class org.jCharts.chartData.processors.AxisChartDataProcessor.
     
    AxisChartDataProcessor() - Constructor for class org.jCharts.chartData.processors.AxisChartDataProcessor
    Constructor
    AxisChartDataSet - class org.jCharts.chartData.AxisChartDataSet.
     
    AxisChartDataSet(double[][], String[], Paint[], ChartType, ChartTypeProperties) - Constructor for class org.jCharts.chartData.AxisChartDataSet
    Constructor
    axisChartTest(String, AxisChartTestBase) - Static method in class org.jCharts.test.AxisChartTestBase
    Test for LineChart
    axisChartTest(String, ScatterChartTestBase) - Static method in class org.jCharts.test.ScatterChartTestBase
    Test for LineChart
    AxisChartTestBase - class org.jCharts.test.AxisChartTestBase.
     
    AxisChartTestBase() - Constructor for class org.jCharts.test.AxisChartTestBase
     
    AxisChartTypeProperties - class org.jCharts.properties.AxisChartTypeProperties.
    Common parent for all Chart type specific properties Objects.
    AxisChartTypeProperties() - Constructor for class org.jCharts.properties.AxisChartTypeProperties
     
    AxisDataSeries - class org.jCharts.chartData.AxisDataSeries.
    Collection of all IAxisChartDataSets to display in an AxisChart
    AxisDataSeries(String, String, String) - Constructor for class org.jCharts.chartData.AxisDataSeries
    Constructor
    axisLabels - Variable in class org.jCharts.chartData.DataSeries
     
    axisLabelsGroup - Variable in class org.jCharts.axisChart.axis.Axis
     
    axisProperties - Variable in class org.jCharts.axisChart.AxisChart
     
    axisProperties - Variable in class org.jCharts.chartText.BarValueGroup
     
    AxisProperties - class org.jCharts.properties.AxisProperties.
     
    AxisProperties() - Constructor for class org.jCharts.properties.AxisProperties
     
    AxisProperties(boolean) - Constructor for class org.jCharts.properties.AxisProperties
     
    AxisProperties(LabelAxisProperties, LabelAxisProperties) - Constructor for class org.jCharts.properties.AxisProperties
     
    axisStroke - Variable in class org.jCharts.properties.AxisTypeProperties
     
    axisTickMarkPixelLength - Variable in class org.jCharts.properties.AxisTypeProperties
     
    axisTitleChartFont - Variable in class org.jCharts.properties.AxisTypeProperties
     
    AxisTypeProperties - class org.jCharts.properties.AxisTypeProperties.
     
    AxisTypeProperties() - Constructor for class org.jCharts.properties.AxisTypeProperties
     
    AxisValueRenderEvent - class org.jCharts.axisChart.customRenderers.axisValue.AxisValueRenderEvent.
     
    AxisValueRenderEvent(AxisChart, IAxisPlotDataSet, Graphics2D, Rectangle2D.Float, float) - Constructor for class org.jCharts.axisChart.customRenderers.axisValue.AxisValueRenderEvent
     

    B

    backgroundPaint - Variable in class org.jCharts.properties.Properties
     
    BackgroundRenderer - class org.jCharts.axisChart.customRenderers.axisValue.renderers.BackgroundRenderer.
     
    BackgroundRenderer(Paint) - Constructor for class org.jCharts.axisChart.customRenderers.axisValue.renderers.BackgroundRenderer
     
    BAR - Static variable in class org.jCharts.types.ChartType
     
    BAR_CLUSTERED - Static variable in class org.jCharts.types.ChartType
     
    BAR_STACKED - Static variable in class org.jCharts.types.ChartType
     
    BarChart - class org.jCharts.axisChart.BarChart.
     
    BarChart() - Constructor for class org.jCharts.axisChart.BarChart
     
    barChartProperties - Variable in class org.jCharts.chartText.BarValueGroup
     
    BarChartProperties - class org.jCharts.properties.BarChartProperties.
     
    BarChartProperties() - Constructor for class org.jCharts.properties.BarChartProperties
    Constructor
    barOutlineStroke - Variable in class org.jCharts.properties.BarChartProperties
     
    barRect - Variable in class org.jCharts.chartText.BarValueGroup.BarValue
     
    BarTestDriver - class org.jCharts.test.BarTestDriver.
    This file provides examples of how to create all the different chart types provided by this package.
    BarTestDriver() - Constructor for class org.jCharts.test.BarTestDriver
     
    barValueFont - Variable in class org.jCharts.chartText.BarValueGroup
     
    barValueFontColor - Variable in class org.jCharts.chartText.BarValueGroup
     
    BarValueGroup - class org.jCharts.chartText.BarValueGroup.
     
    BarValueGroup.BarValue - class org.jCharts.chartText.BarValueGroup.BarValue.
    Helper class to handle a barValue - wraps TextTag Meant to be called only by BarValueGroup class.
    BarValueGroup.BarValue(String, Font, FontRenderContext, Rectangle2D.Float, int, boolean) - Constructor for class org.jCharts.chartText.BarValueGroup.BarValue
     
    BarValueGroup(AxisChart, IAxisChartDataSet) - Constructor for class org.jCharts.chartText.BarValueGroup
     
    barValueItem - Variable in class org.jCharts.chartText.BarValueGroup
     
    barValuePosition - Variable in class org.jCharts.chartText.BarValueGroup
     
    BinaryEncoderUtil - class org.jCharts.encoders.BinaryEncoderUtil.
     
    BinaryEncoderUtil() - Constructor for class org.jCharts.encoders.BinaryEncoderUtil
     
    borderPaint - Variable in class org.jCharts.properties.PieChart2DProperties
     
    borderStroke - Variable in class org.jCharts.properties.PieChart2DProperties
     
    borderStroke - Variable in class org.jCharts.properties.AreaProperties
     
    BOTTOM - Static variable in class org.jCharts.properties.LegendAreaProperties
     
    bufferedImage - Variable in class org.jCharts.Chart
     
    bug() - Static method in class org.jCharts.test.BarTestDriver
     
    bug2() - Static method in class org.jCharts.test.BarTestDriver
     

    C

    calculate() - Method in class org.jCharts.axisChart.axis.scale.ChartScale
    Compute yDelta, yStart, yEnd, segments and rounding.
    calculateDrawingValues(IData) - Method in class org.jCharts.Legend
    Calculates the width and height needed to display the Legend.
    calculateXHorizontalPlot(AxisValueRenderEvent, TextTag, boolean) - Method in class org.jCharts.axisChart.customRenderers.axisValue.renderers.ValueLabelRenderer
     
    calculateXVerticalPlot(AxisValueRenderEvent, TextTag) - Method in class org.jCharts.axisChart.customRenderers.axisValue.renderers.ValueLabelRenderer
    Calculates the label x so that the label is centered on the scale item.
    calculateYHorizontalPlot(AxisValueRenderEvent, TextTag) - Method in class org.jCharts.axisChart.customRenderers.axisValue.renderers.ValueLabelRenderer
     
    calculateYVerticalPlot(AxisValueRenderEvent, TextTag, boolean) - Method in class org.jCharts.axisChart.customRenderers.axisValue.renderers.ValueLabelRenderer
     
    centerChart - Variable in class org.jCharts.chartText.BarValueGroup
     
    chart - Variable in class org.jCharts.Legend
     
    Chart - class org.jCharts.Chart.
    Base class of all charts.
    Chart(LegendProperties, ChartProperties, int, int) - Constructor for class org.jCharts.Chart
    Constructor
    ChartDataException - exception org.jCharts.chartData.ChartDataException.
     
    ChartDataException(String) - Constructor for class org.jCharts.chartData.ChartDataException
     
    ChartDataException(String, Throwable) - Constructor for class org.jCharts.chartData.ChartDataException
     
    chartFont - Variable in class org.jCharts.chartText.TextTagGroup
     
    ChartFont - class org.jCharts.properties.util.ChartFont.
     
    ChartFont(Font, Paint) - Constructor for class org.jCharts.properties.util.ChartFont
     
    ChartItem - class org.jCharts.properties.util.ChartItem.
     
    ChartItem() - Constructor for class org.jCharts.properties.util.ChartItem
     
    ChartItem(Paint) - Constructor for class org.jCharts.properties.util.ChartItem
     
    chartPadding - Variable in class org.jCharts.properties.LegendAreaProperties
     
    chartProperties - Variable in class org.jCharts.Chart
     
    ChartProperties - class org.jCharts.properties.ChartProperties.
     
    ChartProperties() - Constructor for class org.jCharts.properties.ChartProperties
     
    ChartScale - class org.jCharts.axisChart.axis.scale.ChartScale.
     
    ChartScale() - Constructor for class org.jCharts.axisChart.axis.scale.ChartScale
     
    ChartScale(double[][]) - Constructor for class org.jCharts.axisChart.axis.scale.ChartScale
    Constructor.
    ChartStroke - class org.jCharts.properties.util.ChartStroke.
    Immutable Class to simplify the use of Strokes in Charts
    ChartStroke(Stroke, Paint) - Constructor for class org.jCharts.properties.util.ChartStroke
     
    chartTableEnd() - Method in class org.jCharts.test.HTMLGenerator
     
    chartTableRowEnd() - Method in class org.jCharts.test.HTMLGenerator
     
    chartTableRowStart() - Method in class org.jCharts.test.HTMLGenerator
     
    chartTableStart(String, String, ImageMap) - Method in class org.jCharts.test.HTMLGenerator
     
    ChartTestDriver - class org.jCharts.test.ChartTestDriver.
    This file provides examples of how to create all the different chart types provided by this package.
    ChartTestDriver() - Constructor for class org.jCharts.test.ChartTestDriver
     
    chartTitle - Variable in class org.jCharts.chartData.PieChartDataSet
     
    chartTitle - Variable in class org.jCharts.chartData.AxisDataSeries
     
    chartType - Variable in class org.jCharts.chartData.StockChartDataSet
     
    chartType - Variable in class org.jCharts.chartData.AxisChartDataSet
     
    ChartType - class org.jCharts.types.ChartType.
    Chart IntType constants to be used on data sets to specify how they should be plotted.
    ChartType(int, boolean) - Constructor for class org.jCharts.types.ChartType
     
    chartTypeProperties - Variable in class org.jCharts.chartData.DataSet
     
    ChartTypeProperties - class org.jCharts.properties.ChartTypeProperties.
    Common parent for all Chart type specific properties Objects.
    ChartTypeProperties() - Constructor for class org.jCharts.properties.ChartTypeProperties
     
    CIRCLE - Static variable in class org.jCharts.imageMap.AreaShape
     
    CircleMapArea - class org.jCharts.imageMap.CircleMapArea.
     
    CircleMapArea(float, float, double, String, String) - Constructor for class org.jCharts.imageMap.CircleMapArea
     
    CircleMapArea(float, float, Point2D.Double, String) - Constructor for class org.jCharts.imageMap.CircleMapArea
     
    close - Variable in class org.jCharts.chartData.StockChartDataSet
     
    CLOSE - Static variable in class org.jCharts.types.StockChartDataType
     
    closeLength - Variable in class org.jCharts.properties.StockChartProperties
     
    closeStroke - Variable in class org.jCharts.properties.StockChartProperties
     
    ClusteredBarChart - class org.jCharts.axisChart.ClusteredBarChart.
     
    ClusteredBarChart() - Constructor for class org.jCharts.axisChart.ClusteredBarChart
     
    ClusteredBarChartProperties - class org.jCharts.properties.ClusteredBarChartProperties.
     
    ClusteredBarChartProperties() - Constructor for class org.jCharts.properties.ClusteredBarChartProperties
     
    ClusteredBarTestDriver - class org.jCharts.test.ClusteredBarTestDriver.
    This file provides examples of how to create all the different chart types provided by this package.
    ClusteredBarTestDriver() - Constructor for class org.jCharts.test.ClusteredBarTestDriver
     
    columnPadding - Variable in class org.jCharts.properties.LegendAreaProperties
     
    COLUMNS_AS_MANY_AS_NEEDED - Static variable in class org.jCharts.properties.LegendAreaProperties
     
    COLUMNS_FIT_TO_IMAGE - Static variable in class org.jCharts.properties.LegendAreaProperties
     
    ComboTestDriver - class org.jCharts.test.ComboTestDriver.
    This file provides examples of how to create all the different chart types provided by this package.
    ComboTestDriver() - Constructor for class org.jCharts.test.ComboTestDriver
     
    computeAxisCoordinate(double) - Method in class org.jCharts.axisChart.axis.DataAxis
    Deprecated. Takes a value and determines the screen coordinate it should be drawn at.
    computeAxisCoordinate(float, double, double) - Method in class org.jCharts.axisChart.axis.YAxis
    Takes a value and determines the screen coordinate it should be drawn at.
    computeAxisCoordinate(float, double, double) - Method in class org.jCharts.axisChart.axis.XAxis
    Takes a value and determines the screen coordinate it should be drawn at.
    computeAxisTitleDimensions(String, ChartFont) - Method in class org.jCharts.axisChart.axis.Axis
     
    computeIncrement() - Method in class org.jCharts.axisChart.axis.scale.UserDefinedScaleCalculator
    Computes the axis increment WITHOUT taking into account the user specified rounding criteria and sets it to the super class increment variable.
    computeIncrement() - Method in class org.jCharts.axisChart.axis.scale.ScaleCalculator
    Computes the scale increment.
    computeIncrement() - Method in class org.jCharts.axisChart.axis.scale.AutomaticScaleCalculator
    Computes the axis increment taking into account the user specified criteria.
    computeLabelFilter() - Method in class org.jCharts.axisChart.axis.XAxis
    Method to compute the filter to use on the x-axis label display so labels do not overlap
    computeLegendXY(IAxisDataSeries, float) - Method in class org.jCharts.Legend
     
    computeMinimumHeightNeeded(String) - Method in class org.jCharts.axisChart.axis.XAxis
    Computes the minimum pixel height required for the X-Axis.
    computeMinimumWidthNeeded(String) - Method in class org.jCharts.axisChart.axis.YAxis
    Computes the minimum pixel width required for the Y-Axis.
    computeOneUnitPixelSize(float, double) - Method in class org.jCharts.axisChart.axis.Axis
    Computes the relationship of data point values to pixel values so know where along the axis a value is.
    computeScaleHeightOfValue(double, double) - Static method in class org.jCharts.axisChart.BarChart
    Takes a value and determines the number of pixels it should fill on the screen.
    computeScaleIncrement(AxisChartDataProcessor) - Method in class org.jCharts.axisChart.axis.DataAxis
    Deprecated. Calculates the axis scale increment.
    computeScalePixelWidth() - Method in class org.jCharts.axisChart.axis.XAxis
    Computes the number of pixels between each value on the axis.
    computeScalePixelWidth() - Method in class org.jCharts.axisChart.axis.Axis
    Computes the number of pixels between each value on the axis.
    computeScalePixelWidthDataAxis() - Method in class org.jCharts.axisChart.axis.Axis
    Computes the number of pixels between each value on the axis.
    computeScaleValues() - Method in class org.jCharts.axisChart.axis.scale.ScaleCalculator
    Drives the computation of the axis increment and related values taking into account the user specified rounding criteria.
    computeShouldTickStartAtYAxis(IAxisDataSeries, AxisTypeProperties) - Method in class org.jCharts.axisChart.axis.XAxis
    Determines if we should start x-axis ticks at the y-axis or space it out a half a scale item width.
    computeTickStart() - Method in class org.jCharts.axisChart.axis.XAxis
    Computes the screen pixel location of the first tick mark
    createAxisChartDataProcessor() - Method in class org.jCharts.axisChart.ScatterPlotAxisChart
    ScatterPlots create a subclass of AxisChartDataProcessor so we need this method so we can overload it.
    createAxisChartDataProcessor() - Method in class org.jCharts.axisChart.AxisChart
    ScatterPlots create a subclass of AxisChartDataProcessor so we need this method so we can overload it.
    createAxisChartDataSet(ChartType, ChartTypeProperties, int, int, int, int) - Method in class org.jCharts.test.ScatterChartTestBase
    Generates a random MultiDataSet
    createAxisChartDataSet(ChartType, ChartTypeProperties, int, int, int, int) - Method in class org.jCharts.test.AxisChartTestBase
    Generates a random MultiDataSet
    createAxisScaleLabels(ScaleCalculator) - Method in class org.jCharts.chartText.NumericTagGroup
    Creates the axis labels for the passed ScaleCalculator instance.
    createDataSeries(int) - Method in class org.jCharts.test.ScatterChartTestBase
     
    createDataSeries(int) - Method in class org.jCharts.test.AxisChartTestBase
     
    createPoint2DDouble() - Static method in class org.jCharts.chartData.ScatterPlotDataSet
    Take advantage of the face Cloning performs better than creating new for highly used Objects.
    createScatterPlotDataSet(int, int, int, int, int, int) - Method in class org.jCharts.test.ScatterPlotTestDriver
    Generates a random MultiDataSet

    D

    data - Variable in class org.jCharts.chartData.ScatterPlotDataSet
     
    data - Variable in class org.jCharts.chartData.DataSet
     
    DataAxis - class org.jCharts.axisChart.axis.DataAxis.
    Deprecated. just using the YAxis Object
    DataAxis(AxisChart) - Constructor for class org.jCharts.axisChart.axis.DataAxis
    Deprecated. this class is no longer used
    DataAxisProperties - class org.jCharts.properties.DataAxisProperties.
     
    DataAxisProperties() - Constructor for class org.jCharts.properties.DataAxisProperties
     
    DataSeries - class org.jCharts.chartData.DataSeries.
    Collection of all IAxisPlotDataSets to display in an AxisChart
    DataSeries(String[], String, String, String) - Constructor for class org.jCharts.chartData.DataSeries
    Constructor
    DataSet - class org.jCharts.chartData.DataSet.
     
    DataSet(double[][], String[], Paint[], ChartTypeProperties) - Constructor for class org.jCharts.chartData.DataSet
    Constructor
    dataSetIndex - Variable in class org.jCharts.axisChart.customRenderers.axisValue.AxisValueRenderEvent
     
    dataSets - Variable in class org.jCharts.chartData.AxisDataSeries
     
    DEFAULT_AXIS - Static variable in class org.jCharts.properties.util.ChartStroke
     
    DEFAULT_AXIS_SCALE - Static variable in class org.jCharts.properties.util.ChartFont
     
    DEFAULT_AXIS_TITLE - Static variable in class org.jCharts.properties.util.ChartFont
     
    DEFAULT_AXIS_VALUE - Static variable in class org.jCharts.properties.util.ChartFont
     
    DEFAULT_BACKGROUND_PAINT - Static variable in class org.jCharts.properties.Properties
     
    DEFAULT_BAR_OUTLINE - Static variable in class org.jCharts.properties.util.ChartStroke
     
    DEFAULT_BORDER_PAINT - Static variable in class org.jCharts.properties.PieChart2DProperties
     
    DEFAULT_BORDER_STROKE - Static variable in class org.jCharts.properties.PieChart2DProperties
     
    DEFAULT_CHART_OUTLINE - Static variable in class org.jCharts.properties.util.ChartStroke
     
    DEFAULT_CHART_TITLE - Static variable in class org.jCharts.properties.util.ChartFont
     
    DEFAULT_FONT - Static variable in class org.jCharts.properties.LegendProperties
     
    DEFAULT_FONT_PAINT - Static variable in class org.jCharts.properties.LegendProperties
     
    DEFAULT_GRIDLINES - Static variable in class org.jCharts.properties.util.ChartStroke
     
    DEFAULT_ICON_BORDER_PAINT - Static variable in class org.jCharts.properties.LegendProperties
     
    DEFAULT_ICON_BORDER_STROKE - Static variable in class org.jCharts.properties.LegendProperties
     
    DEFAULT_LEGEND_OUTLINE - Static variable in class org.jCharts.properties.util.ChartStroke
     
    DEFAULT_LINE_STROKE - Static variable in class org.jCharts.properties.ScatterPlotProperties
     
    DEFAULT_LINE_STROKE - Static variable in class org.jCharts.properties.LineChartProperties
     
    DEFAULT_PAINT - Static variable in class org.jCharts.properties.util.ChartItem
     
    DEFAULT_PIE_VALUE - Static variable in class org.jCharts.properties.util.ChartFont
     
    DEFAULT_POINT_BORDER_STROKE - Static variable in class org.jCharts.properties.PointChartProperties
     
    DEFAULT_STROKE - Static variable in class org.jCharts.properties.StockChartProperties
     
    DEFAULT_STROKE - Static variable in class org.jCharts.properties.util.ChartStroke
     
    DEFAULT_STROKE_1_5 - Static variable in class org.jCharts.properties.util.ChartStroke
     
    DEFAULT_TICKS - Static variable in class org.jCharts.properties.util.ChartStroke
     
    DEFAULT_ZERO_LINE - Static variable in class org.jCharts.properties.util.ChartStroke
     
    deriveAxisValues() - Method in class org.jCharts.axisChart.ScatterPlotAxisChart
     
    deriveAxisValues() - Method in class org.jCharts.axisChart.AxisChart
     
    derivedFont - Variable in class org.jCharts.axisChart.customRenderers.axisValue.renderers.ValueLabelRenderer
     
    derivedFont - Variable in class org.jCharts.chartText.TextTag
     
    deriveFont() - Method in class org.jCharts.properties.util.ChartFont
     
    determineWidthAndHeight(int) - Method in class org.jCharts.Legend
    Determines the dimensions needed for the Legend and creates the image for it.
    diameter - Variable in class org.jCharts.nonAxisChart.PieChart2D
     
    draw - Variable in class org.jCharts.axisChart.customRenderers.axisValue.renderers.BackgroundRenderer
     
    draw(Graphics2D, Shape) - Method in class org.jCharts.properties.util.ChartStroke
     

    E

    edgePadding - Variable in class org.jCharts.properties.AreaProperties
     
    encode(Chart, float, OutputStream) - Static method in class org.jCharts.encoders.JPEGEncoder13
    Encodes the chart to a JPEG format.
    encode(Chart, float, OutputStream) - Static method in class org.jCharts.encoders.JPEGEncoder
    Encodes the chart to a JPEG format.
    encode(Chart, OutputStream) - Static method in class org.jCharts.encoders.SVGEncoder
    Encodes the Chart to an OutputStream which can be a file or any other OutputStream implementation.
    encode(Chart, OutputStream) - Static method in class org.jCharts.encoders.PNGEncoder
    Encodes the Chart to an OutputStream which can be a file or any other OutputStream implementation.
    encodeJPEG(Chart, float, HttpServletResponse) - Static method in class org.jCharts.encoders.ServletEncoderHelper
    Convenience method to call from a Servlet or JSP.
    encodeJPEG13(Chart, float, HttpServletResponse) - Static method in class org.jCharts.encoders.ServletEncoderHelper
    Convenience method to call from a Servlet or JSP.
    encodePNG(Chart, HttpServletResponse) - Static method in class org.jCharts.encoders.ServletEncoderHelper
    Convenience method to call from a Servlet or JSP.
    encodeServlet(Chart, HttpServletResponse) - Static method in class org.jCharts.encoders.ServletEncoderHelper
    Convenience method to call from a Servlet or JSP.
    equals(ChartType) - Method in class org.jCharts.types.ChartType
    Returns flag indicating whether passed ChartType is equal to this one
    equals(PieLabelType) - Method in class org.jCharts.types.PieLabelType
     
    equals(ValueLabelPosition) - Method in class org.jCharts.axisChart.customRenderers.axisValue.renderers.ValueLabelPosition
     
    exitForm(WindowEvent) - Method in class org.jCharts.test.SwingTest
    Exit the Application
    exportImage(Chart, String) - Static method in class org.jCharts.test.ChartTestDriver
    Utility method to write the image to file so I do not have to deal with file i/o every time I write a test.
    EXTENSION - Static variable in class org.jCharts.test.ChartTestDriver
     

    F

    fileName - Variable in class org.jCharts.test.HTMLGenerator
     
    fill(Graphics2D, Shape) - Method in class org.jCharts.properties.util.ChartStroke
     
    fillPointFlags - Variable in class org.jCharts.properties.PointChartProperties
     
    fillPointsFlags - Variable in class org.jCharts.Legend
     
    firePostRender(AxisValueRenderEvent) - Method in class org.jCharts.properties.AxisChartTypeProperties
     
    firePreRender(AxisValueRenderEvent) - Method in class org.jCharts.properties.AxisChartTypeProperties
     
    font - Variable in class org.jCharts.chartText.TextTag
     
    font - Variable in class org.jCharts.properties.LegendProperties
     
    font - Variable in class org.jCharts.properties.util.ChartFont
     
    fontAscent - Variable in class org.jCharts.chartText.TextTag
     
    fontDescent - Variable in class org.jCharts.chartText.TextTag
     
    fontPaint - Variable in class org.jCharts.properties.LegendProperties
     
    fontRenderContext - Variable in class org.jCharts.axisChart.customRenderers.axisValue.AxisValueRenderEvent
     
    fontRenderContext - Variable in class org.jCharts.chartText.TextTagGroup
     
    fontRenderContext - Variable in class org.jCharts.chartText.BarValueGroup
     

    G

    generateImageMap - Variable in class org.jCharts.Chart
     
    getAreaShape() - Method in class org.jCharts.imageMap.RectMapArea
     
    getAreaShape() - Method in class org.jCharts.imageMap.PolyMapArea
     
    getAreaShape() - Method in class org.jCharts.imageMap.ImageMapArea
     
    getAreaShape() - Method in class org.jCharts.imageMap.CircleMapArea
     
    getAttribute(String) - Method in class org.jCharts.chartText.TextTag
     
    getAxisChart() - Method in class org.jCharts.axisChart.axis.Axis
    Returns reference to AxisChart Object.
    getAxisLabel(int) - Method in class org.jCharts.chartData.DataSeries
    Returns the x-axis label corresponding to the passed index
    getAxisLabel(int) - Method in interface org.jCharts.chartData.interfaces.IDataSeries
    Returns the axis label at the specified index.
    getAxisLabelsGroup() - Method in class org.jCharts.axisChart.axis.Axis
     
    getAxisProperties() - Method in class org.jCharts.axisChart.AxisChart
     
    getAxisProperties() - Method in class org.jCharts.axisChart.axis.scale.ChartScale
    * Creates and returns a new AxisProperties object based on the internally calculated values of yStart, yDelta, * segments and rounding.
    getAxisStroke() - Method in class org.jCharts.properties.AxisTypeProperties
     
    getAxisTickMarkPixelLength() - Method in class org.jCharts.properties.AxisTypeProperties
     
    getAxisTitleChartFont() - Method in class org.jCharts.properties.AxisTypeProperties
     
    getBackgroundPaint() - Method in class org.jCharts.properties.Properties
     
    getBarOutlineStroke() - Method in class org.jCharts.properties.BarChartProperties
     
    getBarRect() - Method in class org.jCharts.chartText.BarValueGroup.BarValue
     
    getBarValueAt(int, double) - Method in class org.jCharts.chartText.BarValueGroup
    Gets the text associated (by the user) for the given bar value.
    getBarValueRectangleCoordinates(int, BarValueGroup.BarValue) - Method in class org.jCharts.chartText.BarValueGroup
    Gets the rectangle coords associated (by the user) for the given bar value.
    getBorderPaint() - Method in class org.jCharts.properties.PieChart2DProperties
     
    getBorderStroke() - Method in class org.jCharts.properties.PieChart2DProperties
     
    getBorderStroke() - Method in class org.jCharts.properties.AreaProperties
    Returns the border Stroke
    getBottom(Rectangle2D.Float) - Method in class org.jCharts.chartText.BarValueGroup
    Not sure why this was left out of Rectangle2D...
    getBottomSide() - Method in class org.jCharts.chartText.TextTag
     
    getBufferedImage() - Method in class org.jCharts.Chart
    Returns the BufferedImage used to generate the ImageMap.
    getChartPadding() - Method in class org.jCharts.properties.LegendAreaProperties
    Returns the padding between chart plot and the Legend.
    getChartProperties() - Method in class org.jCharts.Chart
    Returns the general properties Object.
    getChartTitle() - Method in class org.jCharts.chartData.PieChartDataSet
    Returns the chart title.
    getChartTitle() - Method in class org.jCharts.chartData.AxisDataSeries
    Returns the chart title.
    getChartTitle() - Method in interface org.jCharts.chartData.interfaces.IPieChartDataSet
    Returns the chart title.
    getChartTitle() - Method in interface org.jCharts.chartData.interfaces.IAxisDataSeries
    Returns the chart title.
    getChartType() - Method in class org.jCharts.chartData.StockChartDataSet
    Returns the type constant that this data set should be plotted as.
    getChartType() - Method in class org.jCharts.chartData.ScatterPlotDataSet
    Returns the type constant that this data set should be plotted as.
    getChartType() - Method in class org.jCharts.chartData.AxisChartDataSet
    Returns the type constant that this data set should be plotted as.
    getChartType() - Method in interface org.jCharts.chartData.interfaces.IStockChartDataSet
    Returns the type of chart this data is to be plotted on
    getChartType() - Method in interface org.jCharts.chartData.interfaces.IAxisPlotDataSet
    Returns the type of chart this data is to be plotted on
    getChartTypeProperties() - Method in class org.jCharts.chartData.StockChartDataSet
    Returns the chart specific properties
    getChartTypeProperties() - Method in class org.jCharts.chartData.ScatterPlotDataSet
     
    getChartTypeProperties() - Method in class org.jCharts.chartData.DataSet
     
    getChartTypeProperties() - Method in interface org.jCharts.chartData.interfaces.IDataSet
    Returns ChartTypeProperties Object for the data set which will be typed into the specific chart type class.
    getChartTypeProperties(int) - Static method in class org.jCharts.test.StockTestDriver
    Separate this so can use for combo chart test
    getChartTypeProperties(int) - Static method in class org.jCharts.test.StackedAreaTestDriver
    Separate this so can use for combo chart test
    getChartTypeProperties(int) - Static method in class org.jCharts.test.PointTestDriver
    Separate this so can use for combo chart test
    getChartTypeProperties(int) - Static method in class org.jCharts.test.LineTestDriver
    Separate this so can use for combo chart test
    getChartTypeProperties(int) - Static method in class org.jCharts.test.BarTestDriver
    Separate this so can use for combo chart test
    getChartTypeProperties(int) - Static method in class org.jCharts.test.AreaTestDriver
    Separate this so can use for combo chart test
    getClosePixelLength() - Method in class org.jCharts.properties.StockChartProperties
     
    getCloseStroke() - Method in class org.jCharts.properties.StockChartProperties
     
    getCloseValue(int) - Method in class org.jCharts.chartData.StockChartDataSet
     
    getCloseValue(int) - Method in interface org.jCharts.chartData.interfaces.IStockChartDataSet
     
    getColumnPadding() - Method in class org.jCharts.properties.LegendAreaProperties
    Returns the padding between label columns.
    getCoordinates(StringBuffer) - Method in class org.jCharts.imageMap.ImageMapArea
    Appends the coordinates to the passed html buffer.
    getCoordinates(StringBuffer) - Method in class org.jCharts.imageMap.CircleMapArea
     
    getDataSeries() - Method in class org.jCharts.test.StockTestDriver
    Test for LineChart
    getDataSeries() - Method in class org.jCharts.test.StackedBarTestDriver
     
    getDataSeries() - Method in class org.jCharts.test.StackedAreaTestDriver
     
    getDataSeries() - Method in class org.jCharts.test.ScatterPlotTestDriver
     
    getDataSeries() - Method in class org.jCharts.test.ScatterChartTestBase
     
    getDataSeries() - Method in class org.jCharts.test.PointTestDriver
     
    getDataSeries() - Method in class org.jCharts.test.LineTestDriver
     
    getDataSeries() - Method in class org.jCharts.test.ComboTestDriver
    Test for LineChart
    getDataSeries() - Method in class org.jCharts.test.ClusteredBarTestDriver
     
    getDataSeries() - Method in class org.jCharts.test.BarTestDriver
     
    getDataSeries() - Method in class org.jCharts.test.AxisChartTestBase
     
    getDataSeries() - Method in class org.jCharts.test.AreaTestDriver
     
    getDataSetIndex() - Method in class org.jCharts.axisChart.customRenderers.axisValue.AxisValueRenderEvent
     
    getEdgePadding() - Method in class org.jCharts.properties.AreaProperties
    Returns the number of pixels to pad the edges of the image
    getFillPointsFlag(int) - Method in class org.jCharts.properties.PointChartProperties
     
    getFont() - Method in class org.jCharts.properties.LegendProperties
    Returns the Font used by the Legend.
    getFont() - Method in class org.jCharts.properties.util.ChartFont
     
    getFontAscent() - Method in class org.jCharts.chartText.TextTag
     
    getFontDescent() - Method in class org.jCharts.chartText.TextTag
     
    getFontPaint() - Method in class org.jCharts.properties.LegendProperties
    Returns the Font Paint used by the Legend.
    getFontRenderContext() - Method in class org.jCharts.axisChart.customRenderers.axisValue.AxisValueRenderEvent
     
    getGenerateImageMapFlag() - Method in class org.jCharts.Chart
    Returns flag indicating whether to generate an ImageMap
    getGraphics2D() - Method in class org.jCharts.Chart
    Shortcut method to get Graphics2D.
    getGraphics2D() - Method in class org.jCharts.axisChart.customRenderers.axisValue.AxisValueRenderEvent
     
    getGridLineChartStroke() - Method in class org.jCharts.properties.AxisTypeProperties
     
    getHeight() - Method in class org.jCharts.Legend
     
    getHeight() - Method in class org.jCharts.chartText.TextTag
     
    getHidden() - Method in class org.jCharts.chartText.TextTag
     
    getHighValue(int) - Method in class org.jCharts.chartData.StockChartDataSet
     
    getHighValue(int) - Method in interface org.jCharts.chartData.interfaces.IStockChartDataSet
     
    getHiLowStroke() - Method in class org.jCharts.properties.StockChartProperties
     
    getIAxisDataSeries() - Method in class org.jCharts.axisChart.AxisChart
     
    getiAxisPlotDataSet() - Method in class org.jCharts.axisChart.customRenderers.axisValue.AxisValueRenderEvent
     
    getIAxisPlotDataSet(ChartType) - Method in class org.jCharts.chartData.AxisDataSeries
    Returns the IAxisPlotDataSet for the passed chart type constant.
    getIAxisPlotDataSet(ChartType) - Method in interface org.jCharts.chartData.interfaces.IAxisDataSeries
     
    getIAxisPlotDataSetIterator() - Method in class org.jCharts.chartData.AxisDataSeries
    Returns an Iterator over a List of IAxisPlotDataSet Objects
    getIAxisPlotDataSetIterator() - Method in interface org.jCharts.chartData.interfaces.IAxisDataSeries
     
    getIconBorderPaint() - Method in class org.jCharts.properties.LegendProperties
    Returns the Icon border Color used by the Legend.
    getIconBorderStroke() - Method in class org.jCharts.properties.LegendProperties
    Returns the icon border Stroke
    getIconPadding() - Method in class org.jCharts.properties.LegendAreaProperties
    Returns the padding between the icon and the Label
    getImageHeight() - Method in class org.jCharts.Chart
    Returns the BufferedImage height
    getImageMap() - Method in class org.jCharts.Chart
     
    getImageWidth() - Method in class org.jCharts.Chart
    Returns the BufferedImage width
    getIncrement() - Method in class org.jCharts.axisChart.axis.scale.ScaleCalculator
     
    getInt() - Method in class org.jCharts.types.IntType
     
    getIsNegative() - Method in class org.jCharts.chartText.BarValueGroup.BarValue
     
    getIterator() - Method in class org.jCharts.imageMap.ImageMap
     
    getLastTickY() - Method in class org.jCharts.axisChart.axis.YAxis
    Need this value as horizontal plots start from the top of the axis and go down
    getLegend() - Method in class org.jCharts.Chart
    Returns the Legend.
    getLegendLabel(int) - Method in class org.jCharts.chartData.StockChartDataSet
    Returns the legend label for the passed index.
    getLegendLabel(int) - Method in class org.jCharts.chartData.ScatterPlotDataSet
    Returns the legend label for the passed index.
    getLegendLabel(int) - Method in class org.jCharts.chartData.DataSet
    Returns the legend label for the passed index.
    getLegendLabel(int) - Method in interface org.jCharts.chartData.interfaces.IDataSet
    Returns the Legend Label for the passed index.
    getLegendProperties() - Method in class org.jCharts.Legend
     
    getLengendLabel() - Method in class org.jCharts.imageMap.ImageMapArea
    Returns the legend label represented by this map area.
    getLineStrokes() - Method in class org.jCharts.properties.ScatterPlotProperties
     
    getLineStrokes() - Method in class org.jCharts.properties.LineChartProperties
     
    getLowValue(int) - Method in class org.jCharts.chartData.StockChartDataSet
     
    getLowValue(int) - Method in interface org.jCharts.chartData.interfaces.IStockChartDataSet
     
    getMax(double[][]) - Method in class org.jCharts.axisChart.axis.scale.ChartScale
    Helper method that finds the largest double in the 2D array of doubles.
    getMaxValue() - Method in class org.jCharts.axisChart.axis.DataAxis
    Deprecated. Returns the MAX value plotted by the axis.
    getMaxValue() - Method in class org.jCharts.axisChart.axis.scale.ScaleCalculator
     
    getMaxValue() - Method in class org.jCharts.chartData.processors.AxisChartDataProcessor
     
    getMin(double[][]) - Method in class org.jCharts.axisChart.axis.scale.ChartScale
    Helper method that finds the smallest double in the 2D array of doubles.
    getMinimumHeightNeeded() - Method in class org.jCharts.axisChart.axis.Axis
     
    getMinimumWidthNeeded() - Method in class org.jCharts.axisChart.axis.Axis
     
    getMinValue() - Method in class org.jCharts.axisChart.axis.DataAxis
    Deprecated. Returns the MIN value plotted by the axis.
    getMinValue() - Method in class org.jCharts.axisChart.axis.scale.ScaleCalculator
     
    getMinValue() - Method in class org.jCharts.chartData.processors.AxisChartDataProcessor
     
    getNumberFormatInstance(boolean, boolean, boolean, int) - Static method in class org.jCharts.chartText.NumericTagGroup
    Allow use of this logic to not only this class but to the chart label values.
    getNumberOfAxisLabels() - Method in class org.jCharts.chartData.DataSeries
    Returns the number of labels on the x-axis
    getNumberOfAxisLabels() - Method in interface org.jCharts.chartData.interfaces.IDataSeries
    Returns the number of labels on the x-axis
    getNumberOfCoordinates() - Method in class org.jCharts.imageMap.ImageMapArea
    Returns the number of x,y coordinate pairs stored for the area
    getNumberOfDataItems() - Method in class org.jCharts.chartData.StockChartDataSet
    Returns the number of elements in the data set.
    getNumberOfDataItems() - Method in class org.jCharts.chartData.ScatterPlotDataSet
    Returns the number of elements in the data set.
    getNumberOfDataItems() - Method in class org.jCharts.chartData.DataSet
    Returns the number of elements in the data set.
    getNumberOfDataItems() - Method in interface org.jCharts.chartData.interfaces.IDataSet
    Returns the number of elements in the data set.
    getNumberOfDataSets() - Method in class org.jCharts.chartData.StockChartDataSet
    Returns the number of IAxisChartDataSet Objects in this series
    getNumberOfDataSets() - Method in class org.jCharts.chartData.ScatterPlotDataSet
    Returns the number of elements in the data set.
    getNumberOfDataSets() - Method in class org.jCharts.chartData.AxisChartDataSet
    Returns the number of IAxisChartDataSet Objects in this series
    getNumberOfDataSets() - Method in interface org.jCharts.chartData.interfaces.IAxisPlotDataSet
    Returns the number of data sets contained in this Object.
    getNumberOfElementsInADataSet() - Method in class org.jCharts.chartData.processors.AxisChartDataProcessor
     
    getNumberOfLegendLabels() - Method in class org.jCharts.chartData.StockChartDataSet
    Returns the number of Legend Labels to display.
    getNumberOfLegendLabels() - Method in class org.jCharts.chartData.ScatterPlotDataSet
    Returns the number of Legend Labels to display.
    getNumberOfLegendLabels() - Method in class org.jCharts.chartData.DataSet
    Returns the number of Legend Labels to display.
    getNumberOfLegendLabels() - Method in interface org.jCharts.chartData.interfaces.IDataSet
    Returns the number of legend labels in the data set.
    getNumberOfScaleItems() - Method in class org.jCharts.axisChart.axis.Axis
     
    getNumberOfScaleItems() - Method in class org.jCharts.axisChart.axis.scale.ScaleCalculator
     
    getNumColumns() - Method in class org.jCharts.properties.LegendAreaProperties
    Gets the number of text columns the legend should display.
    getNumItems() - Method in class org.jCharts.properties.DataAxisProperties
     
    getOneUnitPixelSize() - Method in class org.jCharts.axisChart.axis.DataAxis
    Deprecated. Returns the number of pixels one value unit occupies.
    getOneUnitPixelSize() - Method in class org.jCharts.axisChart.axis.Axis
    Returns the number of pixels one value unit occupies.
    getOpenPixelLength() - Method in class org.jCharts.properties.StockChartProperties
     
    getOpenStroke() - Method in class org.jCharts.properties.StockChartProperties
     
    getOpenValue(int) - Method in class org.jCharts.chartData.StockChartDataSet
     
    getOpenValue(int) - Method in interface org.jCharts.chartData.interfaces.IStockChartDataSet
     
    getOrigin() - Method in class org.jCharts.axisChart.axis.Axis
     
    getPaddingBetweenAxisAndLabels() - Method in class org.jCharts.properties.AxisTypeProperties
     
    getPaddingBetweenAxisLabels() - Method in class org.jCharts.properties.AxisTypeProperties
     
    getPaddingBetweenAxisTitleAndLabels() - Method in class org.jCharts.properties.AxisTypeProperties
     
    getPaddingBetweenLabelsAndTicks() - Method in class org.jCharts.properties.AxisTypeProperties
     
    getPaint() - Method in class org.jCharts.properties.util.ChartItem
     
    getPaint(int) - Method in class org.jCharts.chartData.StockChartDataSet
    Returns the number of IAxisChartDataSet Objects in this series
    getPaint(int) - Method in class org.jCharts.chartData.ScatterPlotDataSet
    Returns the legend label for the passed index.
    getPaint(int) - Method in class org.jCharts.chartData.DataSet
    Returns the legend label for the passed index.
    getPaint(int) - Method in interface org.jCharts.chartData.interfaces.IDataSet
    Returns the Paint Object for the passed index.
    getPercentage() - Method in class org.jCharts.properties.BarChartProperties
     
    getPercentageOfPie(int) - Method in class org.jCharts.chartData.processors.PieChartDataProcessor
    Returns percentage of pie(360 degrees) data point at specified index.
    getPieChartDataSet(int, int, int) - Static method in class org.jCharts.test.PieTestDriver
    Generates a random NonAxisChartDataSet
    getPieLabelType() - Method in class org.jCharts.properties.PieChart2DProperties
     
    getPixelLength() - Method in class org.jCharts.axisChart.axis.Axis
     
    getPlacement() - Method in class org.jCharts.properties.LegendAreaProperties
    Returns where the Legend should be drawn in relation to the Chart.
    getPointOutlinePaints(int) - Method in class org.jCharts.properties.PointChartProperties
     
    getPosition() - Method in class org.jCharts.axisChart.customRenderers.axisValue.renderers.ValueLabelPosition
     
    getRandomColor() - Static method in class org.jCharts.test.TestDataGenerator
    Random Color generator.
    getRandomFont(double, double) - Static method in class org.jCharts.test.TestDataGenerator
    Random font generator based on the available Fonts on this machine.
    getRandomNumber(double) - Static method in class org.jCharts.test.TestDataGenerator
    Random number generator.
    getRandomNumber(double, double) - Static method in class org.jCharts.test.TestDataGenerator
    Random number generator in specified range.
    getRandomNumbers(int, double, double) - Static method in class org.jCharts.test.TestDataGenerator
    Random numbers generator in specified range.
    getRandomNumbers(int, int, double, double) - Static method in class org.jCharts.test.TestDataGenerator
    Random numbers generator in specified range.
    getRandomPaint() - Static method in class org.jCharts.test.TestDataGenerator
    Random Paint generator.
    getRandomPaints(int) - Static method in class org.jCharts.test.TestDataGenerator
    Random Color generator.
    getRandomPoints(int, double, double, double, double) - Static method in class org.jCharts.test.TestDataGenerator
    Random numbers generator in specified range.
    getRandomString(int, boolean) - Static method in class org.jCharts.test.TestDataGenerator
    Random String generator.
    getRandomStrings(int, int, boolean) - Static method in class org.jCharts.test.TestDataGenerator
    Random String generator.
    getRectangle() - Method in class org.jCharts.chartText.TextTag
     
    getRight(Rectangle2D.Float) - Method in class org.jCharts.chartText.BarValueGroup
    Not sure why this was left out of Rectangle2D...
    getRightSide() - Method in class org.jCharts.chartText.TextTag
     
    getRounding() - Method in class org.jCharts.axisChart.axis.scale.ChartScale
    * Accessor for the rounding property.
    getRoundingPowerOfTen() - Method in class org.jCharts.axisChart.axis.scale.ScaleCalculator
     
    getRoundToNearest() - Method in class org.jCharts.properties.DataAxisProperties
     
    getRowPadding() - Method in class org.jCharts.properties.LegendAreaProperties
    Returns the padding between labels in each row.
    getScaleCalculator() - Method in class org.jCharts.axisChart.axis.Axis
     
    getScaleCalculator() - Method in class org.jCharts.properties.DataAxisProperties
     
    getScaleChartFont() - Method in class org.jCharts.properties.AxisTypeProperties
     
    getScalePixelWidth() - Method in class org.jCharts.axisChart.axis.Axis
     
    getScatterPlotProperties(int) - Method in class org.jCharts.test.ScatterPlotTestDriver
    Separate this so can use for combo chart test
    getSegments() - Method in class org.jCharts.axisChart.axis.scale.ChartScale
    * Accessor for the segments property.
    getShape(int) - Method in class org.jCharts.properties.PointChartProperties
     
    getShapes() - Method in class org.jCharts.properties.ScatterPlotProperties
     
    getShapes() - Method in class org.jCharts.properties.LineChartProperties
     
    getShowEndBorder() - Method in class org.jCharts.properties.AxisTypeProperties
     
    getShowGridLines() - Method in class org.jCharts.properties.AxisTypeProperties
     
    getShowOutlinesFlag() - Method in class org.jCharts.properties.BarChartProperties
     
    getShowTicks() - Method in class org.jCharts.properties.AxisTypeProperties
     
    getSize() - Method in class org.jCharts.properties.LegendProperties
    Getter for property size.
    getSizeOfEachDataSet() - Method in class org.jCharts.chartData.AxisDataSeries
    Returns number of elements in each data set dimension, so i can validate a that all IAxisPlotDataSets on a ComboChart have the same number of elements, as well as the number of Axis Labels equal the number of data elements other charts.
    getStartPosition() - Method in class org.jCharts.chartText.BarValueGroup.BarValue
     
    getTallestLabel() - Method in class org.jCharts.chartData.processors.TextProcessor
     
    getTallestLabel() - Method in class org.jCharts.chartText.TextTagGroup
     
    getText() - Method in class org.jCharts.chartText.TextTag
     
    getText() - Method in class org.jCharts.chartText.BarValueGroup.BarValue
     
    getTextTag(int) - Method in class org.jCharts.chartData.processors.TextProcessor
     
    getTextTag(int) - Method in class org.jCharts.chartText.TextTagGroup
     
    getTickChartStroke() - Method in class org.jCharts.properties.AxisTypeProperties
     
    getTickLength() - Method in class org.jCharts.properties.PieChart2DProperties
     
    getTickStart() - Method in class org.jCharts.axisChart.axis.Axis
     
    getTitleChartFont() - Method in class org.jCharts.properties.AxisTypeProperties
     
    getTitleFont() - Method in class org.jCharts.properties.ChartProperties
     
    getTitleHeight() - Method in class org.jCharts.axisChart.axis.Axis
     
    getTitlePadding() - Method in class org.jCharts.properties.ChartProperties
    Returns the number of pixels between the Chart Title and the axis plot area
    getTitleWidth() - Method in class org.jCharts.axisChart.axis.Axis
     
    getTotalItemAxisArea() - Method in class org.jCharts.axisChart.customRenderers.axisValue.AxisValueRenderEvent
    Returns the bounding box of the total axis plot area alotted to the current scale item.
    getTotalLabelWidths() - Method in class org.jCharts.chartData.processors.TextProcessor
     
    getTotalLabelWidths() - Method in class org.jCharts.chartText.TextTagGroup
     
    getTotalNumberOfDataSets() - Method in class org.jCharts.chartData.AxisDataSeries
    Returns the total number data dimensions in all of the IAxisChartDataSets contained in this collection.
    getTotalNumberOfDataSets() - Method in interface org.jCharts.chartData.interfaces.IAxisDataSeries
    Returns the total number data dimensions in all of the IAxisChartDataSets contained in this collection.
    getTypeCode() - Method in class org.jCharts.types.Type
     
    getUserDefinedIncrement() - Method in class org.jCharts.properties.DataAxisProperties
     
    getUserDefinedMinimumValue() - Method in class org.jCharts.properties.DataAxisProperties
     
    getValue() - Method in class org.jCharts.imageMap.ImageMapArea
    Returns the data set value represented by this map.
    getValue() - Method in class org.jCharts.imageMap.AreaShape
     
    getValue(int) - Method in class org.jCharts.chartData.PieChartDataSet
    Returns the value in the data set at the specified position.
    getValue(int) - Method in interface org.jCharts.chartData.interfaces.IPieChartDataSet
    Returns the value in the data set at the specified position.
    getValue(int, int) - Method in class org.jCharts.chartData.ScatterPlotDataSet
    Returns the value in the data set at the specified position.
    getValue(int, int) - Method in class org.jCharts.chartData.AxisChartDataSet
    Returns the value in the data set at the specified position.
    getValue(int, int) - Method in interface org.jCharts.chartData.interfaces.IScatterPlotDataSet
    Returns the value in the data set at the specified position.
    getValue(int, int) - Method in interface org.jCharts.chartData.interfaces.IAxisChartDataSet
    Returns the value in the data set at the specified position.
    getValueIndex() - Method in class org.jCharts.axisChart.customRenderers.axisValue.AxisValueRenderEvent
     
    getValueLabelFont() - Method in class org.jCharts.properties.PieChart2DProperties
     
    getValueLabelRoundingPowerOfTen() - Method in class org.jCharts.properties.PieChart2DProperties
     
    getValueX() - Method in class org.jCharts.axisChart.customRenderers.axisValue.AxisValueRenderEvent
     
    getValueY() - Method in class org.jCharts.axisChart.customRenderers.axisValue.AxisValueRenderEvent
     
    getWidestLabel() - Method in class org.jCharts.chartData.processors.TextProcessor
    Calculates the width and height needed by the passed String when rendered // * @param iDataSeries / * @param font // * @param fontRenderContext public void processLabels( IDataSeries iDataSeries) { //LOOP for( int i = 0; i < iDataSeries.getNumberOfXAxisLabels(); i++ ) { this.axisLabelProcessor.processLabel( iDataSeries.getXAxisLabel( i ), axisLabelFont, fontRenderContext ); } TextLayout textLayout = new TextLayout( label, font, fontRenderContext ); //---WIDTH this.labelWidths[ counter ] = textLayout.getAdvance(); this.widestLabel = Math.max( this.labelWidths[ counter ], this.widestLabel ); this.totalLabelWidths += this.labelWidths[ counter ]; //---HEIGHT this.labelHeights[ counter ] = textLayout.getAscent() + textLayout.getDescent(); this.tallestLabel = Math.max( this.labelHeights[ counter ], this.tallestLabel ); //---need this to offset font rendering, as rendering is at the baseline not bottom or top, this.fontDescent = textLayout.getDescent(); this.counter++; } /******************************************************************************************
    getWidestLabel() - Method in class org.jCharts.chartText.TextTagGroup
    Calculates the width and height needed by the passed String when rendered // * @param iDataSeries / * @param font // * @param fontRenderContext public void processLabels( IDataSeries iDataSeries) { //LOOP for( int i = 0; i < iDataSeries.getNumberOfXAxisLabels(); i++ ) { this.axisLabelProcessor.processLabel( iDataSeries.getXAxisLabel( i ), axisLabelFont, fontRenderContext ); } TextLayout textLayout = new TextLayout( label, font, fontRenderContext ); //---WIDTH this.labelWidths[ counter ] = textLayout.getAdvance(); this.widestLabel = Math.max( this.labelWidths[ counter ], this.widestLabel ); this.totalLabelWidths += this.labelWidths[ counter ]; //---HEIGHT this.labelHeights[ counter ] = textLayout.getAscent() + textLayout.getDescent(); this.tallestLabel = Math.max( this.labelHeights[ counter ], this.tallestLabel ); //---need this to offset font rendering, as rendering is at the baseline not bottom or top, this.fontDescent = textLayout.getDescent(); this.counter++; } /******************************************************************************************
    getWidth() - Method in class org.jCharts.Legend
     
    getWidth() - Method in class org.jCharts.chartText.TextTag
     
    getXAxis() - Method in class org.jCharts.axisChart.AxisChart
     
    getXAxisLabel() - Method in class org.jCharts.imageMap.ImageMapArea
    Rather than create an AxisChart specifc map area class just for this field, i put it here.
    getXAxisProperties() - Method in class org.jCharts.properties.AxisProperties
     
    getXAxisTitle() - Method in class org.jCharts.chartData.AxisDataSeries
    Returns the x-axis title
    getXAxisTitle() - Method in interface org.jCharts.chartData.interfaces.IAxisDataSeries
    Returns the x-axis title.
    getXCoordinate(int) - Method in class org.jCharts.imageMap.ImageMapArea
    Returns the x coordinate at the specified index.
    getXPosition() - Method in class org.jCharts.chartText.TextTag
     
    getYAxis() - Method in class org.jCharts.axisChart.AxisChart
     
    getYAxisProperties() - Method in class org.jCharts.properties.AxisProperties
     
    getYAxisTitle() - Method in class org.jCharts.chartData.AxisDataSeries
    Returns the y-axis title
    getYAxisTitle() - Method in interface org.jCharts.chartData.interfaces.IAxisDataSeries
    Returns the y-axis title.
    getYCoordinate(int) - Method in class org.jCharts.imageMap.ImageMapArea
    Returns the y coordinate at the specified index.
    getYDelta() - Method in class org.jCharts.axisChart.axis.scale.ChartScale
    * Accessor for the yDelta property.
    getYEnd() - Method in class org.jCharts.axisChart.axis.scale.ChartScale
    * Accessor for the yEnd property.
    getyMax() - Method in class org.jCharts.chartData.processors.ScatterPlotDataProcessor
     
    getYMax() - Method in class org.jCharts.axisChart.axis.scale.ChartScale
    * Accessor for the yMax property.
    getyMin() - Method in class org.jCharts.chartData.processors.ScatterPlotDataProcessor
     
    getYMin() - Method in class org.jCharts.axisChart.axis.scale.ChartScale
    * Accessor for the yMin property.
    getYPosition() - Method in class org.jCharts.chartText.TextTag
     
    getYStart() - Method in class org.jCharts.axisChart.axis.scale.ChartScale
    * Accessor for the yStart property.
    getZeroDegreeOffset() - Method in class org.jCharts.properties.PieChart2DProperties
     
    getZeroLineChartStroke() - Method in class org.jCharts.properties.DataAxisProperties
     
    getZeroLineCoordinate() - Method in class org.jCharts.axisChart.axis.DataAxis
    Deprecated. Returns the screen coordinate of the zero line.
    getZeroLineCoordinate() - Method in class org.jCharts.axisChart.axis.Axis
    Returns the screen coordinate of the zero line.
    getZeroLineCoordinate() - Method in class org.jCharts.axisChart.customRenderers.axisValue.AxisValueRenderEvent
     
    graphics2D - Variable in class org.jCharts.Chart
     
    graphics2D - Variable in class org.jCharts.axisChart.customRenderers.axisValue.AxisValueRenderEvent
     
    GRID_LINES_ALL - Static variable in class org.jCharts.properties.AxisTypeProperties
     
    GRID_LINES_NONE - Static variable in class org.jCharts.properties.AxisTypeProperties
     
    GRID_LINES_ONLY_WITH_LABELS - Static variable in class org.jCharts.properties.AxisTypeProperties
     
    gridLineChartStroke - Variable in class org.jCharts.properties.AxisTypeProperties
     

    H

    hasCloseValues() - Method in class org.jCharts.chartData.StockChartDataSet
     
    hasCloseValues() - Method in interface org.jCharts.chartData.interfaces.IStockChartDataSet
     
    hasLegend() - Method in class org.jCharts.Chart
    Returns flag indicating if there is a Legend.
    hasOpenValues() - Method in class org.jCharts.chartData.StockChartDataSet
     
    hasOpenValues() - Method in interface org.jCharts.chartData.interfaces.IStockChartDataSet
     
    hasUserDefinedScale() - Method in class org.jCharts.properties.DataAxisProperties
     
    height - Variable in class org.jCharts.Legend
     
    height - Variable in class org.jCharts.Chart
     
    height - Variable in class org.jCharts.chartText.TextTag
     
    high - Variable in class org.jCharts.chartData.StockChartDataSet
     
    HIGH - Static variable in class org.jCharts.types.StockChartDataType
     
    hiLowStroke - Variable in class org.jCharts.properties.StockChartProperties
     
    horizontalPadding - Variable in class org.jCharts.chartText.BarValueGroup
     
    horizontalPlot(AxisChart, IAxisChartDataSet, BarChartProperties, DataAxisProperties, Graphics2D, Rectangle2D.Float, float) - Static method in class org.jCharts.axisChart.BarChart
     
    horizontalPlot(AxisChart, IAxisChartDataSet, ClusteredBarChartProperties, DataAxisProperties, Graphics2D, Rectangle2D.Float, float, float, float) - Static method in class org.jCharts.axisChart.ClusteredBarChart
     
    horizontalPlot(AxisChart, IAxisChartDataSet, StackedBarChartProperties, DataAxisProperties, Graphics2D, Rectangle2D.Float, float) - Static method in class org.jCharts.axisChart.StackedBarChart
     
    HTMLChartTestable - interface org.jCharts.test.HTMLChartTestable.
    Interface class for Chart Objects that can be displayed in a jCharts test.
    HTMLGenerator - class org.jCharts.test.HTMLGenerator.
    Utility class for viewing a series of tests.
    HTMLGenerator(String) - Constructor for class org.jCharts.test.HTMLGenerator
     
    HTMLTestable - interface org.jCharts.test.HTMLTestable.
    Interface class for Objects that can be displayed in a jCharts test.

    I

    IAxisChartDataSet - interface org.jCharts.chartData.interfaces.IAxisChartDataSet.
     
    iAxisDataSeries - Variable in class org.jCharts.axisChart.AxisChart
     
    IAxisDataSeries - interface org.jCharts.chartData.interfaces.IAxisDataSeries.
     
    iAxisPlotDataSet - Variable in class org.jCharts.axisChart.customRenderers.axisValue.AxisValueRenderEvent
     
    IAxisPlotDataSet - interface org.jCharts.chartData.interfaces.IAxisPlotDataSet.
     
    iconBorderPaint - Variable in class org.jCharts.properties.LegendProperties
     
    iconBorderStroke - Variable in class org.jCharts.properties.LegendProperties
     
    iconPadding - Variable in class org.jCharts.properties.LegendAreaProperties
     
    iconSide - Variable in class org.jCharts.Legend
     
    IData - interface org.jCharts.chartData.interfaces.IData.
    Provides a common base class for all data structures.
    IDataSeries - interface org.jCharts.chartData.interfaces.IDataSeries.
     
    IDataSet - interface org.jCharts.chartData.interfaces.IDataSet.
     
    imageMap - Variable in class org.jCharts.Chart
     
    ImageMap - class org.jCharts.imageMap.ImageMap.
     
    ImageMap(int) - Constructor for class org.jCharts.imageMap.ImageMap
     
    ImageMapArea - class org.jCharts.imageMap.ImageMapArea.
     
    ImageMapArea(int, double, String, String) - Constructor for class org.jCharts.imageMap.ImageMapArea
     
    ImageMapArea(int, Point2D.Double, String) - Constructor for class org.jCharts.imageMap.ImageMapArea
     
    ImageMapNotSupportedException - exception org.jCharts.imageMap.ImageMapNotSupportedException.
     
    ImageMapNotSupportedException(String) - Constructor for class org.jCharts.imageMap.ImageMapNotSupportedException
     
    increment - Variable in class org.jCharts.axisChart.axis.DataAxis
    Deprecated.  
    increment - Variable in class org.jCharts.axisChart.axis.scale.ScaleCalculator
     
    initComponents() - Method in class org.jCharts.test.SwingTest
     
    innerTableRowEnd() - Method in class org.jCharts.test.HTMLGenerator
     
    innerTableRowStart() - Method in class org.jCharts.test.HTMLGenerator
     
    IntType - class org.jCharts.types.IntType.
    Provides a common base class for all types.
    IntType(int) - Constructor for class org.jCharts.types.IntType
     
    iPieChartDataSet - Variable in class org.jCharts.chartData.processors.PieChartDataProcessor
     
    iPieChartDataSet - Variable in class org.jCharts.nonAxisChart.PieChart2D
     
    IPieChartDataSet - interface org.jCharts.chartData.interfaces.IPieChartDataSet.
     
    IScatterPlotDataSeries - interface org.jCharts.chartData.interfaces.IScatterPlotDataSeries.
     
    IScatterPlotDataSet - interface org.jCharts.chartData.interfaces.IScatterPlotDataSet.
     
    isCurrency - Variable in class org.jCharts.properties.PieChart2DProperties
     
    isDerived - Variable in class org.jCharts.chartText.TextTag
     
    isHidden - Variable in class org.jCharts.chartText.TextTag
     
    isLabelVertical - Variable in class org.jCharts.axisChart.customRenderers.axisValue.renderers.ValueLabelRenderer
     
    isNegative - Variable in class org.jCharts.chartText.BarValueGroup.BarValue
     
    isPlotHorizontal - Variable in class org.jCharts.properties.AxisProperties
     
    isPlotHorizontal() - Method in class org.jCharts.properties.AxisProperties
     
    isStacked() - Method in class org.jCharts.types.ChartType
    Returns flag indicating whether chart type has stacked data
    IStockChartDataSet - interface org.jCharts.chartData.interfaces.IStockChartDataSet.
     
    isVertical - Variable in class org.jCharts.chartText.BarValueGroup
     

    J

    JPEG - Static variable in class org.jCharts.encoders.JPEGEncoder
     
    JPEG - Static variable in class org.jCharts.test.ChartTestDriver
     
    JPEG_LEGACY - Static variable in class org.jCharts.test.ChartTestDriver
     
    JPEG_MIME_TYPE - Static variable in class org.jCharts.encoders.ServletEncoderHelper
     
    JPEGEncoder - class org.jCharts.encoders.JPEGEncoder.
    This class REQUIRES the jdk 1.4
    JPEGEncoder() - Constructor for class org.jCharts.encoders.JPEGEncoder
     
    JPEGEncoder13 - class org.jCharts.encoders.JPEGEncoder13.
    Provided for backwards compatibility for jdk 1.3
    JPEGEncoder13() - Constructor for class org.jCharts.encoders.JPEGEncoder13
     

    L

    LabelAxis - class org.jCharts.axisChart.axis.LabelAxis.
    Deprecated. just using the Axis Object
    LabelAxis(AxisChart) - Constructor for class org.jCharts.axisChart.axis.LabelAxis
    Deprecated. this class is no longer used
    LabelAxisProperties - class org.jCharts.properties.LabelAxisProperties.
     
    LabelAxisProperties() - Constructor for class org.jCharts.properties.LabelAxisProperties
     
    labels - Variable in class org.jCharts.Legend
     
    lastTickY - Variable in class org.jCharts.axisChart.axis.YAxis
     
    LEFT - Static variable in class org.jCharts.properties.LegendAreaProperties
     
    legend - Variable in class org.jCharts.Chart
     
    Legend - class org.jCharts.Legend.
     
    LEGEND_LABELS - Static variable in class org.jCharts.types.PieLabelType
     
    Legend(Chart) - Constructor for class org.jCharts.Legend
    Deprecated.  
    Legend(Chart, LegendProperties) - Constructor for class org.jCharts.Legend
     
    LegendAreaProperties - class org.jCharts.properties.LegendAreaProperties.
     
    LegendAreaProperties() - Constructor for class org.jCharts.properties.LegendAreaProperties
    Constructor for those desiring auto-calculation of the Legend width based on the number of columns.
    legendLabel - Variable in class org.jCharts.imageMap.ImageMapArea
     
    legendLabels - Variable in class org.jCharts.chartData.StockChartDataSet
     
    legendLabels - Variable in class org.jCharts.chartData.ScatterPlotDataSet
     
    legendLabels - Variable in class org.jCharts.chartData.DataSet
     
    legendProperties - Variable in class org.jCharts.Legend
     
    LegendProperties - class org.jCharts.properties.LegendProperties.
     
    LegendProperties() - Constructor for class org.jCharts.properties.LegendProperties
     
    legendTableEnd() - Method in class org.jCharts.test.HTMLGenerator
     
    legendTableStart() - Method in class org.jCharts.test.HTMLGenerator
     
    LINE - Static variable in class org.jCharts.types.ChartType
     
    LineChart - class org.jCharts.axisChart.LineChart.
     
    LineChart() - Constructor for class org.jCharts.axisChart.LineChart
     
    LineChartProperties - class org.jCharts.properties.LineChartProperties.
     
    LineChartProperties(Stroke[], Shape[]) - Constructor for class org.jCharts.properties.LineChartProperties
    Constructor
    lineStrokes - Variable in class org.jCharts.properties.ScatterPlotProperties
     
    lineStrokes - Variable in class org.jCharts.properties.LineChartProperties
     
    LineTestDriver - class org.jCharts.test.LineTestDriver.
    This file provides examples of how to create all the different chart types provided by this package.
    LineTestDriver() - Constructor for class org.jCharts.test.LineTestDriver
     
    low - Variable in class org.jCharts.chartData.StockChartDataSet
     
    LOW - Static variable in class org.jCharts.types.StockChartDataType
     

    M

    main(String[]) - Static method in class org.jCharts.axisChart.axis.scale.ChartScale
     
    main(String[]) - Static method in class org.jCharts.test.SwingTest
     
    main(String[]) - Static method in class org.jCharts.test.StackedBarTestDriver
     
    main(String[]) - Static method in class org.jCharts.test.ScatterPlotTestDriver
    DataSeries getDataSeries() throws ChartDataException { String[] xAxisLabels={"1", "2", "3", "4", "5"}; DataSeries dataSeries=new DataSeries( xAxisLabels, "numbers", "numbers", "Bug #559177" ); AxisChartDataSet axisChartDataSet; double[][] data={{1, 2, 3, 4, 5}, {7, 8, Double.NaN, Double.NaN, Double.NaN}, {Double.NaN, Double.NaN, Double.NaN, Double.NaN, 2}}; String[] legendLabels={"set 1", "set 2", "set 3"}; Paint[] paints={Color.blue, Color.red, Color.green}; axisChartDataSet=new AxisChartDataSet( data, legendLabels, paints, ChartType.LINE, this.getChartTypeProperties( 3 ) ); dataSeries.addIAxisPlotDataSet( axisChartDataSet ); return dataSeries; }
    main(String[]) - Static method in class org.jCharts.test.PointTestDriver
     
    main(String[]) - Static method in class org.jCharts.test.PieTestDriver
     
    main(String[]) - Static method in class org.jCharts.test.LineTestDriver
    DataSeries getDataSeries() throws ChartDataException { String[] xAxisLabels={"1", "2", "3", "4", "5"}; DataSeries dataSeries=new DataSeries( xAxisLabels, "numbers", "numbers", "Bug #559177" ); AxisChartDataSet axisChartDataSet; double[][] data={{1, 2, 3, 4, 5}, {7, 8, Double.NaN, Double.NaN, Double.NaN}, {Double.NaN, Double.NaN, Double.NaN, Double.NaN, 2}}; String[] legendLabels={"set 1", "set 2", "set 3"}; Paint[] paints={Color.blue, Color.red, Color.green}; axisChartDataSet=new AxisChartDataSet( data, legendLabels, paints, ChartType.LINE, this.getChartTypeProperties( 3 ) ); dataSeries.addIAxisPlotDataSet( axisChartDataSet ); return dataSeries; }
    main(String[]) - Static method in class org.jCharts.test.ClusteredBarTestDriver
     
    main(String[]) - Static method in class org.jCharts.test.ChartTestDriver
    Main method so can run as command line.
    main(String[]) - Static method in class org.jCharts.test.BarTestDriver
     
    main(String[]) - Static method in class org.jCharts.test.AreaTestDriver
     
    max - Variable in class org.jCharts.chartData.processors.AxisChartDataProcessor
     
    maxValue - Variable in class org.jCharts.axisChart.axis.DataAxis
    Deprecated.  
    maxValue - Variable in class org.jCharts.axisChart.axis.scale.ScaleCalculator
     
    min - Variable in class org.jCharts.chartData.processors.AxisChartDataProcessor
     
    minimumHeightNeeded - Variable in class org.jCharts.axisChart.axis.Axis
     
    minimumWidthNeeded - Variable in class org.jCharts.axisChart.axis.Axis
     
    minValue - Variable in class org.jCharts.axisChart.axis.DataAxis
    Deprecated.  
    minValue - Variable in class org.jCharts.axisChart.axis.scale.ScaleCalculator
     

    N

    NO_LABELS - Static variable in class org.jCharts.types.PieLabelType
     
    NonStackedDataProcessor - class org.jCharts.chartData.processors.NonStackedDataProcessor.
     
    NonStackedDataProcessor() - Constructor for class org.jCharts.chartData.processors.NonStackedDataProcessor
     
    numberFormat - Variable in class org.jCharts.axisChart.customRenderers.axisValue.renderers.ValueLabelRenderer
     
    numberFormat - Variable in class org.jCharts.chartText.NumericTagGroup
     
    numberFormat - Variable in class org.jCharts.chartText.BarValueGroup
     
    numberOfDataSets - Variable in class org.jCharts.chartData.StockChartDataSet
     
    numberOfElementsInADataSet - Variable in class org.jCharts.chartData.processors.AxisChartDataProcessor
     
    numberOfScaleItems - Variable in class org.jCharts.axisChart.axis.Axis
     
    numberOfScaleItems - Variable in class org.jCharts.axisChart.axis.scale.ScaleCalculator
     
    numColumns - Variable in class org.jCharts.Legend
     
    numColumns - Variable in class org.jCharts.properties.LegendAreaProperties
     
    numDataItems - Variable in class org.jCharts.chartData.ScatterPlotDataSet
     
    NumericTagGroup - class org.jCharts.chartText.NumericTagGroup.
     
    NumericTagGroup(ChartFont, FontRenderContext, boolean, boolean, boolean, int) - Constructor for class org.jCharts.chartText.NumericTagGroup
     
    numItems - Variable in class org.jCharts.properties.DataAxisProperties
     
    numRows - Variable in class org.jCharts.Legend
     

    O

    ON_TOP - Static variable in class org.jCharts.axisChart.customRenderers.axisValue.renderers.ValueLabelPosition
     
    oneUnitPixelSize - Variable in class org.jCharts.axisChart.axis.Axis
     
    open - Variable in class org.jCharts.chartData.StockChartDataSet
     
    OPEN - Static variable in class org.jCharts.types.StockChartDataType
     
    openLength - Variable in class org.jCharts.properties.StockChartProperties
     
    openStroke - Variable in class org.jCharts.properties.StockChartProperties
     
    org.jCharts - package org.jCharts
     
    org.jCharts.axisChart - package org.jCharts.axisChart
     
    org.jCharts.axisChart.axis - package org.jCharts.axisChart.axis
     
    org.jCharts.axisChart.axis.scale - package org.jCharts.axisChart.axis.scale
     
    org.jCharts.axisChart.customRenderers.axisValue - package org.jCharts.axisChart.customRenderers.axisValue
     
    org.jCharts.axisChart.customRenderers.axisValue.renderers - package org.jCharts.axisChart.customRenderers.axisValue.renderers
     
    org.jCharts.chartData - package org.jCharts.chartData
     
    org.jCharts.chartData.interfaces - package org.jCharts.chartData.interfaces
     
    org.jCharts.chartData.processors - package org.jCharts.chartData.processors
     
    org.jCharts.chartText - package org.jCharts.chartText
     
    org.jCharts.encoders - package org.jCharts.encoders
     
    org.jCharts.imageMap - package org.jCharts.imageMap
     
    org.jCharts.nonAxisChart - package org.jCharts.nonAxisChart
     
    org.jCharts.properties - package org.jCharts.properties
     
    org.jCharts.properties.util - package org.jCharts.properties.util
     
    org.jCharts.test - package org.jCharts.test
     
    org.jCharts.types - package org.jCharts.types
     
    origin - Variable in class org.jCharts.axisChart.axis.Axis
     
    outlinePaints - Variable in class org.jCharts.properties.PointChartProperties
     
    OUTPUT_PATH - Static variable in class org.jCharts.test.ChartTestDriver
     
    overlayCharts() - Method in class org.jCharts.axisChart.ScatterPlotAxisChart
    Draws the charts over the axis.
    overlayCharts() - Method in class org.jCharts.axisChart.AxisChart
    Draws the charts over the axis.

    P

    paddingBetweenAxisAndLabels - Variable in class org.jCharts.properties.AxisTypeProperties
     
    paddingBetweenAxisLabels - Variable in class org.jCharts.properties.AxisTypeProperties
     
    paddingBetweenAxisTitleAndLabels - Variable in class org.jCharts.properties.AxisTypeProperties
     
    paddingBetweenLabelsAndTicks - Variable in class org.jCharts.properties.AxisTypeProperties
     
    paint - Variable in class org.jCharts.axisChart.customRenderers.axisValue.renderers.BackgroundRenderer
     
    paint - Variable in class org.jCharts.properties.util.ChartItem
     
    paints - Variable in class org.jCharts.Legend
     
    paints - Variable in class org.jCharts.chartData.StockChartDataSet
     
    paints - Variable in class org.jCharts.chartData.ScatterPlotDataSet
     
    paints - Variable in class org.jCharts.chartData.DataSet
     
    panel - Variable in class org.jCharts.test.SwingTest
     
    PieChart2D - class org.jCharts.nonAxisChart.PieChart2D.
     
    PieChart2D(IPieChartDataSet, LegendProperties, ChartProperties, int, int) - Constructor for class org.jCharts.nonAxisChart.PieChart2D
    Constructor
    PieChart2DProperties - class org.jCharts.properties.PieChart2DProperties.
     
    PieChart2DProperties() - Constructor for class org.jCharts.properties.PieChart2DProperties
     
    pieChartDataProcessor - Variable in class org.jCharts.nonAxisChart.PieChart2D
     
    PieChartDataProcessor - class org.jCharts.chartData.processors.PieChartDataProcessor.
    Utility class to process the PieChartDataSet
    PieChartDataProcessor(IPieChartDataSet) - Constructor for class org.jCharts.chartData.processors.PieChartDataProcessor
    Constructor
    PieChartDataSet - class org.jCharts.chartData.PieChartDataSet.
    Implementation of the IPieChartDataSet Interface for use with the PieChart2D Object.
    PieChartDataSet(String, double[], String[], Paint[], PieChart2DProperties) - Constructor for class org.jCharts.chartData.PieChartDataSet
    Constructor
    pieLabelType - Variable in class org.jCharts.properties.PieChart2DProperties
     
    PieLabelType - class org.jCharts.types.PieLabelType.
     
    PieLabelType(int) - Constructor for class org.jCharts.types.PieLabelType
     
    PieTestDriver - class org.jCharts.test.PieTestDriver.
    This file provides examples of how to create all the different chart types provided by this package.
    PieTestDriver() - Constructor for class org.jCharts.test.PieTestDriver
     
    pieX - Variable in class org.jCharts.nonAxisChart.PieChart2D
     
    pieY - Variable in class org.jCharts.nonAxisChart.PieChart2D
     
    pixelLength - Variable in class org.jCharts.axisChart.axis.Axis
     
    pixelValuePadding - Variable in class org.jCharts.axisChart.customRenderers.axisValue.renderers.ValueLabelRenderer
     
    placement - Variable in class org.jCharts.properties.LegendAreaProperties
     
    PNG - Static variable in class org.jCharts.encoders.PNGEncoder
     
    PNG - Static variable in class org.jCharts.test.ChartTestDriver
     
    PNG_MIME_TYPE - Static variable in class org.jCharts.encoders.ServletEncoderHelper
     
    PNGEncoder - class org.jCharts.encoders.PNGEncoder.
    This class REQUIRES the jdk 1.4
    PNGEncoder() - Constructor for class org.jCharts.encoders.PNGEncoder
     
    POINT - Static variable in class org.jCharts.chartData.ScatterPlotDataSet
     
    POINT - Static variable in class org.jCharts.types.ChartType
     
    PointChart - class org.jCharts.axisChart.PointChart.
     
    PointChart() - Constructor for class org.jCharts.axisChart.PointChart
     
    PointChartProperties - class org.jCharts.properties.PointChartProperties.
     
    PointChartProperties(Shape[], boolean[], Paint[]) - Constructor for class org.jCharts.properties.PointChartProperties
    Constructor
    pointOutlinePaints - Variable in class org.jCharts.Legend
     
    PointTestDriver - class org.jCharts.test.PointTestDriver.
    This file provides examples of how to create all the different chart types provided by this package.
    PointTestDriver() - Constructor for class org.jCharts.test.PointTestDriver
     
    POLYGON - Static variable in class org.jCharts.imageMap.AreaShape
     
    PolyMapArea - class org.jCharts.imageMap.PolyMapArea.
     
    PolyMapArea(int, double, String, String) - Constructor for class org.jCharts.imageMap.PolyMapArea
     
    position - Variable in class org.jCharts.axisChart.customRenderers.axisValue.renderers.ValueLabelPosition
     
    PostAxisValueRenderListener - interface org.jCharts.axisChart.customRenderers.axisValue.PostAxisValueRenderListener.
    This Class is used to recieve callbacks from the chart renderers after they render their value to the chart, with value meaning their bar, point, line, etc...
    postRender(AxisValueRenderEvent) - Method in interface org.jCharts.axisChart.customRenderers.axisValue.PostAxisValueRenderListener
     
    postRender(AxisValueRenderEvent) - Method in class org.jCharts.axisChart.customRenderers.axisValue.renderers.ValueLabelRenderer
     
    postRenderEventListeners - Variable in class org.jCharts.properties.AxisChartTypeProperties
     
    PreAxisValueRenderListener - interface org.jCharts.axisChart.customRenderers.axisValue.PreAxisValueRenderListener.
     
    preRender(AxisValueRenderEvent) - Method in interface org.jCharts.axisChart.customRenderers.axisValue.PreAxisValueRenderListener
     
    preRender(AxisValueRenderEvent) - Method in class org.jCharts.axisChart.customRenderers.axisValue.renderers.BackgroundRenderer
     
    preRenderEventListeners - Variable in class org.jCharts.properties.AxisChartTypeProperties
     
    processData() - Method in class org.jCharts.chartData.processors.PieChartDataProcessor
    This method should do a single pass through the data set and calculate all needed values, such as: min, max, sum, etc...
    processData(AxisChart, FontRenderContext) - Method in class org.jCharts.chartData.processors.ScatterPlotDataProcessor
    Method to perform all chart data processing.
    processData(AxisChart, FontRenderContext) - Method in class org.jCharts.chartData.processors.AxisChartDataProcessor
    Method to perform all chart data processing.
    processData(IAxisChartDataSet, AxisChartDataProcessor) - Static method in class org.jCharts.chartData.processors.StackedDataProcessor
    This method should do a single pass through the data set and calculate all needed values, such as: min, max, sum, etc...
    processData(IAxisChartDataSet, AxisChartDataProcessor) - Static method in class org.jCharts.chartData.processors.NonStackedDataProcessor
    Does a single pass through the data set and calculates the min, max, and label dimensions.
    processData(IAxisDataSeries) - Method in class org.jCharts.Legend
    Central method for processing data; try to minimize looping.
    processData(IPieChartDataSet) - Method in class org.jCharts.Legend
    Central method for processing data; try to minimize looping.
    processData(IStockChartDataSet, AxisChartDataProcessor) - Static method in class org.jCharts.chartData.processors.StockDataProcessor
    Only need to loop through the 'high' to find MAX and 'low' to find MIN.
    processDataSet(IDataSeries) - Method in class org.jCharts.chartData.processors.AxisChartDataProcessor
    Processes the numeric values in the chart data.
    processDataSet(IScatterPlotDataSeries) - Method in class org.jCharts.chartData.processors.ScatterPlotDataProcessor
    Processes the numeric values in the chart data.
    processLegendLabels(IAxisPlotDataSet) - Method in class org.jCharts.Legend
    Method for processing data for AxisPlot datasets; try to minimize looping.
    processLegendLabels(IPieChartDataSet) - Method in class org.jCharts.Legend
    Method for processing data for PieCharts; try to minimize looping.
    Properties - class org.jCharts.properties.Properties.
     
    Properties() - Constructor for class org.jCharts.properties.Properties
     
    propertiesTableEnd() - Method in class org.jCharts.test.HTMLGenerator
     
    propertiesTableRowEnd() - Method in class org.jCharts.test.HTMLGenerator
     
    propertiesTableRowStart() - Method in class org.jCharts.test.HTMLGenerator
     
    propertiesTableStart(String) - Method in class org.jCharts.test.HTMLGenerator
     
    PropertyException - exception org.jCharts.properties.PropertyException.
     
    PropertyException(String) - Constructor for class org.jCharts.properties.PropertyException
     

    R

    radius - Variable in class org.jCharts.imageMap.CircleMapArea
     
    randomizeAxisProperties(AxisProperties) - Static method in class org.jCharts.test.TestDataGenerator
    Takes the passed AxisProperties and randomizes it.
    randomizeLegend(LegendProperties) - Static method in class org.jCharts.test.TestDataGenerator
    Takes the passed Legend and randomizes it.
    RECTANGLE - Static variable in class org.jCharts.imageMap.AreaShape
     
    RectMapArea - class org.jCharts.imageMap.RectMapArea.
     
    RectMapArea(Rectangle2D.Float, double, String, String) - Constructor for class org.jCharts.imageMap.RectMapArea
     
    render() - Method in class org.jCharts.Legend
    Renders the legend.
    render() - Method in class org.jCharts.Chart
    Call this to kick off rendering of the chart
    render(AxisChart, IAxisChartDataSet) - Static method in class org.jCharts.axisChart.StackedBarChart
    Draws the chart
    render(AxisChart, IAxisChartDataSet) - Static method in class org.jCharts.axisChart.StackedAreaChart
    Draws the chart
    render(AxisChart, IAxisChartDataSet) - Static method in class org.jCharts.axisChart.PointChart
    Draws the chart
    render(AxisChart, IAxisChartDataSet) - Static method in class org.jCharts.axisChart.LineChart
    Draws the chart
    render(AxisChart, IAxisChartDataSet) - Static method in class org.jCharts.axisChart.ClusteredBarChart
    Draws the chart uses Rectangle2D......keep having rounding problems.
    render(AxisChart, IAxisChartDataSet) - Static method in class org.jCharts.axisChart.BarChart
    Draws the chart uses Rectangle2D......keep having rounding problems.
    render(AxisChart, IAxisChartDataSet) - Static method in class org.jCharts.axisChart.AreaChart
    Draws the chart
    render(AxisChart, IStockChartDataSet) - Static method in class org.jCharts.axisChart.StockChart
    Draws the chart
    render(Chart) - Static method in class org.jCharts.encoders.BinaryEncoderUtil
     
    render(Graphics2D) - Method in class org.jCharts.chartText.BarValueGroup
    renders any barValues
    render(Graphics2D, AxisProperties, String) - Method in class org.jCharts.axisChart.axis.YAxis
    Renders the YAxis on the passes Graphics2D object
    render(Graphics2D, AxisProperties, String) - Method in class org.jCharts.axisChart.axis.XAxis
    Renders the YAxis on the passes Graphics2D object
    render(Graphics2D, float, float) - Method in class org.jCharts.chartText.TextTag
    Renders the text, at the position - renders from the top (instead of baseline)
    render(Graphics2D, IDataSeries) - Method in class org.jCharts.axisChart.axis.LabelAxis
    Deprecated. Renders the axis on the passed Graphics2D object
    render(Graphics2D, IDataSeries) - Method in class org.jCharts.axisChart.axis.DataAxis
    Deprecated. Renders the DataAxis on the passes Graphics2D object
    render(Graphics2D, Paint) - Method in class org.jCharts.chartText.TextTag
    Renders the text, at the position - renders from the top (instead of baseline)
    render(int, Graphics2D, float, float) - Method in class org.jCharts.chartText.TextTagGroup
    Renders the text, at the position - renders from the top (instead of baseline)
    render(PieChart2D) - Static method in class org.jCharts.nonAxisChart.PieChart2D
    Implement the method to render the Chart.
    render(ScatterPlotAxisChart, IScatterPlotDataSet) - Static method in class org.jCharts.axisChart.ScatterPlotChart
    Draws the chart
    renderAxisTitle(String, Graphics2D, AxisTypeProperties) - Method in class org.jCharts.axisChart.axis.YAxis
     
    renderAxisTitle(String, Graphics2D, AxisTypeProperties) - Method in class org.jCharts.axisChart.axis.XAxis
    Computes the number of pixels between each value on the axis.
    renderChart() - Method in class org.jCharts.Chart
     
    renderChart() - Method in class org.jCharts.axisChart.AxisChart
    Implement the method to render the Axis based chart
    renderChart() - Method in class org.jCharts.nonAxisChart.PieChart2D
    Draws the chart
    renderChartTitle(String, FontRenderContext) - Method in class org.jCharts.Chart
    Displays the chart title and returns the height of the title PLUS title padding.
    renderWithImageMap() - Method in class org.jCharts.Chart
    Renders the chart into a BufferedImage so that we can calculate all the Image Map coordinates.
    reverse() - Method in class org.jCharts.chartText.TextTagGroup
    Horizontal plots render the data from top down so rendering alogorithm needs to get the labels in reverse order to make things easier.
    RIGHT - Static variable in class org.jCharts.properties.LegendAreaProperties
     
    round(double, double) - Method in class org.jCharts.axisChart.axis.DataAxis
    Deprecated. Rounds the scale increment up by the power of ten specified in the properties.
    round(double, double) - Method in class org.jCharts.axisChart.axis.scale.ScaleCalculator
    Rounds the passed value by the power of ten specified
    rounding - Variable in class org.jCharts.axisChart.axis.scale.ChartScale
    * The suggested value for the rounding of the data.
    roundingPowerOfTen - Variable in class org.jCharts.axisChart.axis.scale.ScaleCalculator
     
    roundingPowerOfTen - Variable in class org.jCharts.properties.PieChart2DProperties
     
    roundTheIncrement(double) - Method in class org.jCharts.axisChart.axis.DataAxis
    Deprecated. Rounds the scale increment up by the power of ten specified in the properties.
    roundTheIncrement(double) - Method in class org.jCharts.axisChart.axis.scale.ScaleCalculator
    Rounds the scale increment up by the power of ten specified in the properties.
    roundToNearest - Variable in class org.jCharts.properties.DataAxisProperties
     
    rowPadding - Variable in class org.jCharts.properties.LegendAreaProperties
     

    S

    saveFile() - Method in class org.jCharts.test.HTMLGenerator
    Writes the file.
    scaleCalculator - Variable in class org.jCharts.axisChart.axis.Axis
     
    scaleCalculator - Variable in class org.jCharts.properties.DataAxisProperties
     
    ScaleCalculator - class org.jCharts.axisChart.axis.scale.ScaleCalculator.
    Base class for the logic used to compute the scale on the charts.
    ScaleCalculator() - Constructor for class org.jCharts.axisChart.axis.scale.ScaleCalculator
     
    scaleChartFont - Variable in class org.jCharts.properties.AxisTypeProperties
     
    scalePixelWidth - Variable in class org.jCharts.axisChart.axis.Axis
     
    SCATTER_PLOT - Static variable in class org.jCharts.types.ChartType
     
    ScatterChartTestBase - class org.jCharts.test.ScatterChartTestBase.
     
    ScatterChartTestBase() - Constructor for class org.jCharts.test.ScatterChartTestBase
     
    ScatterPlotAxisChart - class org.jCharts.axisChart.ScatterPlotAxisChart.
    This Class is used to create all axis chart types.
    ScatterPlotAxisChart(IScatterPlotDataSeries, ChartProperties, AxisProperties, LegendProperties, int, int) - Constructor for class org.jCharts.axisChart.ScatterPlotAxisChart
    Constructor
    ScatterPlotChart - class org.jCharts.axisChart.ScatterPlotChart.
     
    ScatterPlotChart() - Constructor for class org.jCharts.axisChart.ScatterPlotChart
     
    ScatterPlotDataProcessor - class org.jCharts.chartData.processors.ScatterPlotDataProcessor.
     
    ScatterPlotDataProcessor() - Constructor for class org.jCharts.chartData.processors.ScatterPlotDataProcessor
    Constructor
    ScatterPlotDataSeries - class org.jCharts.chartData.ScatterPlotDataSeries.
    Collection of all IAxisPlotDataSets to display in an AxisChart
    ScatterPlotDataSeries(IScatterPlotDataSet, String, String, String) - Constructor for class org.jCharts.chartData.ScatterPlotDataSeries
    Constructor
    ScatterPlotDataSet - class org.jCharts.chartData.ScatterPlotDataSet.
     
    ScatterPlotDataSet(ScatterPlotProperties) - Constructor for class org.jCharts.chartData.ScatterPlotDataSet
    Constructor
    scatterPlotProperties - Variable in class org.jCharts.chartData.ScatterPlotDataSet
     
    ScatterPlotProperties - class org.jCharts.properties.ScatterPlotProperties.
     
    ScatterPlotProperties(Stroke[], Shape[]) - Constructor for class org.jCharts.properties.ScatterPlotProperties
    Constructor
    ScatterPlotTestDriver - class org.jCharts.test.ScatterPlotTestDriver.
    This file provides examples of how to create all the different chart types provided by this package.
    ScatterPlotTestDriver() - Constructor for class org.jCharts.test.ScatterPlotTestDriver
     
    segments - Variable in class org.jCharts.axisChart.axis.scale.ChartScale
    * The number of segments that the suggested yStart, yEnd and yDelta produce.
    ServletEncoderHelper - class org.jCharts.encoders.ServletEncoderHelper.
     
    ServletEncoderHelper() - Constructor for class org.jCharts.encoders.ServletEncoderHelper
     
    setAxisLabelsGroup(TextTagGroup) - Method in class org.jCharts.axisChart.axis.Axis
     
    setAxisStroke(ChartStroke) - Method in class org.jCharts.properties.AxisTypeProperties
     
    setAxisTickMarkPixelLength(float) - Method in class org.jCharts.properties.AxisTypeProperties
     
    setAxisTitleChartFont(ChartFont) - Method in class org.jCharts.properties.AxisTypeProperties
     
    setBackgroundPaint(Paint) - Method in class org.jCharts.properties.Properties
     
    setBarOutlineStroke(ChartStroke) - Method in class org.jCharts.properties.BarChartProperties
     
    setBarValuePosition(BarValueGroup.BarValue, Rectangle2D.Float) - Method in class org.jCharts.chartText.BarValueGroup
    Gets the rectangle associated (by the user) for the given bar value.
    setBorderPaint(Paint) - Method in class org.jCharts.properties.PieChart2DProperties
     
    setBorderStroke(ChartStroke) - Method in class org.jCharts.properties.AreaProperties
    Sets the border Stroke.
    setBorderStroke(Stroke) - Method in class org.jCharts.properties.PieChart2DProperties
     
    setChartPadding(int) - Method in class org.jCharts.properties.LegendAreaProperties
    Sets the padding between chart plot and the Legend.
    setClosePixelLength(int) - Method in class org.jCharts.properties.StockChartProperties
     
    setCloseStroke(Stroke) - Method in class org.jCharts.properties.StockChartProperties
     
    setCloseValues(double[], String, Paint) - Method in class org.jCharts.chartData.StockChartDataSet
    Sets the 'Close' values
    setColumnPadding(int) - Method in class org.jCharts.properties.LegendAreaProperties
    Sets the padding between label columns, in pixels.
    setCurrency(boolean) - Method in class org.jCharts.properties.PieChart2DProperties
     
    setDataSetIndex(int) - Method in class org.jCharts.axisChart.customRenderers.axisValue.AxisValueRenderEvent
     
    setEdgePadding(float) - Method in class org.jCharts.properties.AreaProperties
    Sets the number of pixels to pad the edges of the image
    setFont(Font) - Method in class org.jCharts.properties.LegendProperties
    Sets the Font used by the Legend.
    setFontPaint(Paint) - Method in class org.jCharts.properties.LegendProperties
    Sets the Font color used by the Legend.
    setGraphics2D(Graphics2D) - Method in class org.jCharts.Chart
    Sets the graphics object to render the chart on by the encoder.
    setGridLineChartStroke(ChartStroke) - Method in class org.jCharts.properties.AxisTypeProperties
     
    setHidden(boolean) - Method in class org.jCharts.chartText.TextTag
     
    setHiLowStroke(Stroke) - Method in class org.jCharts.properties.StockChartProperties
     
    setIconBorderPaint(Paint) - Method in class org.jCharts.properties.LegendProperties
    Sets the Icon border color used by the Legend.
    setIconBorderStroke(Stroke) - Method in class org.jCharts.properties.LegendProperties
    Sets the icon border Stroke.
    setIconPadding(int) - Method in class org.jCharts.properties.LegendAreaProperties
    Sets the padding between the icon and the Label, in pixels.
    setImageMap(ImageMap) - Method in class org.jCharts.Chart
    To optimze performance of the ImageMap Object, we create it once we know how many data elements are in the chart which is dependent on the AxisChart or PieChart2D
    setMaxValue(double) - Method in class org.jCharts.axisChart.axis.scale.ScaleCalculator
     
    setMaxValue(double) - Method in class org.jCharts.chartData.processors.AxisChartDataProcessor
     
    setMinimumHeightNeeded(float) - Method in class org.jCharts.axisChart.axis.Axis
     
    setMinimumWidthNeeded(float) - Method in class org.jCharts.axisChart.axis.Axis
     
    setMinValue(double) - Method in class org.jCharts.axisChart.axis.scale.ScaleCalculator
     
    setMinValue(double) - Method in class org.jCharts.chartData.processors.AxisChartDataProcessor
     
    setNumberOfScaleItems(int) - Method in class org.jCharts.axisChart.axis.scale.ScaleCalculator
     
    setNumColumns(int) - Method in class org.jCharts.properties.LegendAreaProperties
    Sets the number of text columns the legend should display.
    setNumItems(int) - Method in class org.jCharts.properties.DataAxisProperties
     
    setOneUnitPixelSize(double) - Method in class org.jCharts.axisChart.axis.Axis
     
    setOpenPixelLength(int) - Method in class org.jCharts.properties.StockChartProperties
     
    setOpenStroke(Stroke) - Method in class org.jCharts.properties.StockChartProperties
     
    setOpenValues(double[], String, Paint) - Method in class org.jCharts.chartData.StockChartDataSet
    Sets the 'Open' values
    setOrigin(float) - Method in class org.jCharts.axisChart.axis.Axis
     
    setPaddingBetweenAxisAndLabels(float) - Method in class org.jCharts.properties.AxisTypeProperties
     
    setPaddingBetweenAxisTitleAndLabels(float) - Method in class org.jCharts.properties.AxisTypeProperties
     
    setPaddingBetweenLabelsAndTicks(float) - Method in class org.jCharts.properties.AxisTypeProperties
     
    setPaddingBetweenXAxisLabels(float) - Method in class org.jCharts.properties.AxisTypeProperties
     
    setPieLabelType(PieLabelType) - Method in class org.jCharts.properties.PieChart2DProperties
    Sets the type of label to draw on the PieChart.
    setPixelLength(float) - Method in class org.jCharts.axisChart.axis.Axis
     
    setPixelValuePadding(int) - Method in class org.jCharts.axisChart.customRenderers.axisValue.renderers.ValueLabelRenderer
    The pixel padding between the label and the data point.
    setPlacement(int) - Method in class org.jCharts.properties.LegendAreaProperties
    Sets where the Legend should be drawn in relation to the Chart.
    setPosition(float, float) - Method in class org.jCharts.chartText.TextTag
     
    setRadius(int) - Method in class org.jCharts.imageMap.CircleMapArea
    Allows user to specify the radius for each circle
    setRoundingPowerOfTen(int) - Method in class org.jCharts.axisChart.axis.scale.ScaleCalculator
    Sets the exponent power of ten to round values to.
    setRoundingPowerOfTen(int) - Method in class org.jCharts.properties.PieChart2DProperties
     
    setRoundToNearest(int) - Method in class org.jCharts.properties.DataAxisProperties
     
    setRowPadding(int) - Method in class org.jCharts.properties.LegendAreaProperties
    Sets the padding between labels in each row, in pixels.
    setScaleCalculator(ScaleCalculator) - Method in class org.jCharts.axisChart.axis.Axis
     
    setScaleCalculator(ScaleCalculator) - Method in class org.jCharts.properties.DataAxisProperties
    You do not have to explicitly set a ScaleCalculator implementation as jCharts will create one, but if you do not like the way Scale ranges are created, you could create your own implementation of ScaleCalculator and jCharts will use it!
    setScaleChartFont(ChartFont) - Method in class org.jCharts.properties.AxisTypeProperties
     
    setScalePixelWidth(float) - Method in class org.jCharts.axisChart.axis.Axis
     
    setShowAxisLabels(boolean) - Method in class org.jCharts.properties.AxisTypeProperties
     
    setShowEndBorder(boolean) - Method in class org.jCharts.properties.AxisTypeProperties
     
    setShowGridLines(int) - Method in class org.jCharts.properties.AxisTypeProperties
     
    setShowGrouping(boolean) - Method in class org.jCharts.properties.PieChart2DProperties
     
    setShowOutlinesFlag(boolean) - Method in class org.jCharts.properties.BarChartProperties
     
    setShowTicks(int) - Method in class org.jCharts.properties.AxisTypeProperties
     
    setShowZeroLine(boolean) - Method in class org.jCharts.properties.DataAxisProperties
     
    setSize(Dimension) - Method in class org.jCharts.properties.LegendProperties
    Setter for property size.
    setTickChartStroke(ChartStroke) - Method in class org.jCharts.properties.AxisTypeProperties
     
    setTickLength(float) - Method in class org.jCharts.properties.PieChart2DProperties
     
    setTickStart(float) - Method in class org.jCharts.axisChart.axis.Axis
     
    setTitleChartFont(ChartFont) - Method in class org.jCharts.properties.AxisTypeProperties
     
    setTitleFont(ChartFont) - Method in class org.jCharts.properties.ChartProperties
     
    setTitlePadding(float) - Method in class org.jCharts.properties.ChartProperties
     
    setupAxis(AxisChartDataProcessor, FontRenderContext) - Method in class org.jCharts.axisChart.ScatterPlotAxisChart
     
    setupAxis(AxisChartDataProcessor, FontRenderContext) - Method in class org.jCharts.axisChart.AxisChart
     
    setupDataAxisProperties(Axis, DataAxisProperties, AxisChartDataProcessor, FontRenderContext) - Method in class org.jCharts.axisChart.ScatterPlotAxisChart
    Once we determine which axis is the data axis, the logic to set it up is the same whether it is a horizontal or vertical plot.
    setupDataAxisProperties(Axis, DataAxisProperties, AxisChartDataProcessor, FontRenderContext) - Method in class org.jCharts.axisChart.AxisChart
    Once we determine which axis is the data axis, the logic to set it up is the same whether it is a horizontal or vertical plot.
    setupGraphics2D(Graphics2D) - Method in class org.jCharts.properties.util.ChartStroke
    Sets the Paint and Stroke implementations on the Graphics2D Object
    setupGraphics2D(Graphics2D) - Method in class org.jCharts.properties.util.ChartItem
    Sets the Paint and Stroke implementations on the Graphics2D Object
    setupGraphics2D(Graphics2D) - Method in class org.jCharts.properties.util.ChartFont
    Sets the Paint and Stroke implementations on the Graphics2D Object
    setUseCommas(boolean) - Method in class org.jCharts.properties.DataAxisProperties
     
    setUseDollarSigns(boolean) - Method in class org.jCharts.properties.DataAxisProperties
     
    setUsePercentSigns(boolean) - Method in class org.jCharts.properties.DataAxisProperties
     
    setUserDefinedScale(double, double) - Method in class org.jCharts.properties.DataAxisProperties
     
    setValidate(boolean) - Method in class org.jCharts.properties.ChartProperties
    Toggles the validation of data and properties for the charts.
    setValueChartFont(ChartFont) - Method in class org.jCharts.axisChart.customRenderers.axisValue.renderers.ValueLabelRenderer
     
    setValueIndex(int) - Method in class org.jCharts.axisChart.customRenderers.axisValue.AxisValueRenderEvent
     
    setValueLabelFont(ChartFont) - Method in class org.jCharts.properties.PieChart2DProperties
    Sets the ChartFont used to draw the chart value labels.
    setValueLabelPosition(ValueLabelPosition) - Method in class org.jCharts.axisChart.customRenderers.axisValue.renderers.ValueLabelRenderer
    Sets where you would like to position the label
    setValueX(float) - Method in class org.jCharts.axisChart.customRenderers.axisValue.AxisValueRenderEvent
     
    setValueY(float) - Method in class org.jCharts.axisChart.customRenderers.axisValue.AxisValueRenderEvent
     
    setWidthPercentage(float) - Method in class org.jCharts.properties.BarChartProperties
     
    setX(float) - Method in class org.jCharts.Legend
     
    setXAxisLabelsAreVertical(boolean) - Method in class org.jCharts.properties.AxisProperties
     
    setXPosition(float) - Method in class org.jCharts.chartText.TextTag
     
    setY(float) - Method in class org.jCharts.Legend
     
    setyMax(double) - Method in class org.jCharts.chartData.processors.ScatterPlotDataProcessor
     
    setyMin(double) - Method in class org.jCharts.chartData.processors.ScatterPlotDataProcessor
     
    setYPosition(float) - Method in class org.jCharts.chartText.TextTag
     
    setZeroDegreeOffset(float) - Method in class org.jCharts.properties.PieChart2DProperties
    The offset from zero degrees which the first slice of pie is drawn.
    setZeroLineChartStroke(ChartStroke) - Method in class org.jCharts.properties.DataAxisProperties
     
    setZeroLineCoordinate(float) - Method in class org.jCharts.axisChart.axis.Axis
    Sets the screen coordinate of the zero line.
    SHAPE_CIRCLE - Static variable in class org.jCharts.properties.PointChartProperties
     
    SHAPE_DIAMOND - Static variable in class org.jCharts.properties.PointChartProperties
     
    SHAPE_SQUARE - Static variable in class org.jCharts.properties.PointChartProperties
     
    SHAPE_TRIANGLE - Static variable in class org.jCharts.properties.PointChartProperties
     
    shapes - Variable in class org.jCharts.Legend
     
    shapes - Variable in class org.jCharts.properties.ScatterPlotProperties
     
    shapes - Variable in class org.jCharts.properties.PointChartProperties
     
    shapes - Variable in class org.jCharts.properties.LineChartProperties
     
    showAxisLabels - Variable in class org.jCharts.properties.AxisTypeProperties
     
    showAxisLabels() - Method in class org.jCharts.properties.AxisTypeProperties
     
    showBarValues - Variable in class org.jCharts.chartText.BarValueGroup
     
    showEndBorder - Variable in class org.jCharts.properties.AxisTypeProperties
     
    showGridLines - Variable in class org.jCharts.properties.AxisTypeProperties
     
    showGrouping - Variable in class org.jCharts.properties.PieChart2DProperties
     
    showOutlines - Variable in class org.jCharts.properties.BarChartProperties
     
    showTicks - Variable in class org.jCharts.properties.AxisTypeProperties
     
    showValueLabelCurrency() - Method in class org.jCharts.properties.PieChart2DProperties
     
    showValueLabelGrouping() - Method in class org.jCharts.properties.PieChart2DProperties
     
    showZeroLine - Variable in class org.jCharts.properties.DataAxisProperties
     
    showZeroLine() - Method in class org.jCharts.properties.DataAxisProperties
     
    size - Variable in class org.jCharts.properties.LegendProperties
     
    size() - Method in class org.jCharts.chartData.AxisDataSeries
    Returns the number of IAxisPlotDataSet Objects in this series
    size() - Method in interface org.jCharts.chartData.interfaces.IAxisDataSeries
    Returns the number of IAxisPlotDataSet Objects in this series
    size() - Method in class org.jCharts.chartData.processors.TextProcessor
    Returns the number of labels
    size() - Method in class org.jCharts.chartText.TextTagGroup
    Returns the number of labels
    sizeAndPositionAxis(float, float, float) - Method in class org.jCharts.axisChart.AxisChart
    Finalizes the size of both Axis and sets the origin position
    sizeOfEachDataSet - Variable in class org.jCharts.chartData.AxisDataSeries
     
    StackedAreaChart - class org.jCharts.axisChart.StackedAreaChart.
     
    StackedAreaChart() - Constructor for class org.jCharts.axisChart.StackedAreaChart
     
    StackedAreaChartProperties - class org.jCharts.properties.StackedAreaChartProperties.
     
    StackedAreaChartProperties() - Constructor for class org.jCharts.properties.StackedAreaChartProperties
     
    StackedAreaTestDriver - class org.jCharts.test.StackedAreaTestDriver.
    This file provides examples of how to create all the different chart types provided by this package.
    StackedAreaTestDriver() - Constructor for class org.jCharts.test.StackedAreaTestDriver
     
    StackedBarChart - class org.jCharts.axisChart.StackedBarChart.
     
    StackedBarChart() - Constructor for class org.jCharts.axisChart.StackedBarChart
     
    StackedBarChartProperties - class org.jCharts.properties.StackedBarChartProperties.
     
    StackedBarChartProperties() - Constructor for class org.jCharts.properties.StackedBarChartProperties
     
    StackedBarTestDriver - class org.jCharts.test.StackedBarTestDriver.
    This file provides examples of how to create all the different chart types provided by this package.
    StackedBarTestDriver() - Constructor for class org.jCharts.test.StackedBarTestDriver
     
    stackedData - Variable in class org.jCharts.types.ChartType
     
    StackedDataProcessor - class org.jCharts.chartData.processors.StackedDataProcessor.
    Notes: 1) Stacked data cannot have any negative values.
    StackedDataProcessor() - Constructor for class org.jCharts.chartData.processors.StackedDataProcessor
     
    start - Variable in class org.jCharts.test.StopWatch
     
    start() - Method in class org.jCharts.test.StopWatch
     
    startPosition - Variable in class org.jCharts.chartText.BarValueGroup.BarValue
     
    startTicksAtAxis - Variable in class org.jCharts.axisChart.axis.XAxis
     
    STOCK - Static variable in class org.jCharts.types.ChartType
     
    StockChart - class org.jCharts.axisChart.StockChart.
     
    StockChart() - Constructor for class org.jCharts.axisChart.StockChart
     
    StockChartDataSet - class org.jCharts.chartData.StockChartDataSet.
     
    StockChartDataSet(double[], String, double[], String, Paint, StockChartProperties) - Constructor for class org.jCharts.chartData.StockChartDataSet
    Constructor
    StockChartDataType - class org.jCharts.types.StockChartDataType.
     
    StockChartDataType(int) - Constructor for class org.jCharts.types.StockChartDataType
     
    stockChartProperties - Variable in class org.jCharts.chartData.StockChartDataSet
     
    StockChartProperties - class org.jCharts.properties.StockChartProperties.
     
    StockChartProperties() - Constructor for class org.jCharts.properties.StockChartProperties
     
    StockChartProperties(Stroke, Stroke, int, Stroke, int) - Constructor for class org.jCharts.properties.StockChartProperties
     
    StockDataProcessor - class org.jCharts.chartData.processors.StockDataProcessor.
    Custom processor for the Stock Chart as data is semi-processed by default.
    StockDataProcessor() - Constructor for class org.jCharts.chartData.processors.StockDataProcessor
     
    StockTestDriver - class org.jCharts.test.StockTestDriver.
    This file provides examples of how to create all the different chart types provided by this package.
    StockTestDriver() - Constructor for class org.jCharts.test.StockTestDriver
     
    stop - Variable in class org.jCharts.test.StopWatch
     
    stop() - Method in class org.jCharts.test.StopWatch
     
    StopWatch - class org.jCharts.test.StopWatch.
     
    StopWatch() - Constructor for class org.jCharts.test.StopWatch
     
    stringBuffer - Variable in class org.jCharts.test.HTMLGenerator
     
    stroke - Variable in class org.jCharts.properties.util.ChartStroke
     
    sumOfData - Variable in class org.jCharts.chartData.processors.PieChartDataProcessor
     
    supportsImageMap() - Method in class org.jCharts.test.StockTestDriver
     
    supportsImageMap() - Method in class org.jCharts.test.StackedBarTestDriver
     
    supportsImageMap() - Method in class org.jCharts.test.StackedAreaTestDriver
     
    supportsImageMap() - Method in class org.jCharts.test.ScatterPlotTestDriver
     
    supportsImageMap() - Method in class org.jCharts.test.ScatterChartTestBase
     
    supportsImageMap() - Method in class org.jCharts.test.PointTestDriver
     
    supportsImageMap() - Method in class org.jCharts.test.LineTestDriver
     
    supportsImageMap() - Method in class org.jCharts.test.ComboTestDriver
     
    supportsImageMap() - Method in class org.jCharts.test.ClusteredBarTestDriver
     
    supportsImageMap() - Method in class org.jCharts.test.BarTestDriver
     
    supportsImageMap() - Method in class org.jCharts.test.AxisChartTestBase
     
    supportsImageMap() - Method in class org.jCharts.test.AreaTestDriver
     
    SVG - Static variable in class org.jCharts.test.ChartTestDriver
     
    SVG_MIME_TYPE - Static variable in class org.jCharts.encoders.ServletEncoderHelper
     
    SVGEncoder - class org.jCharts.encoders.SVGEncoder.
    This class REQUIRES the Apache XML Batik libraries to run.
    SVGEncoder() - Constructor for class org.jCharts.encoders.SVGEncoder
     
    SwingTest - class org.jCharts.test.SwingTest.
     
    SwingTest() - Constructor for class org.jCharts.test.SwingTest
     

    T

    tallestLabel - Variable in class org.jCharts.chartData.processors.TextProcessor
     
    tallestLabel - Variable in class org.jCharts.chartText.TextTagGroup
     
    test() - Static method in class org.jCharts.test.PieTestDriver
    Test for PieChart2D
    testAxisScale() - Static method in class org.jCharts.test.ChartTestDriver
     
    TestDataGenerator - class org.jCharts.test.TestDataGenerator.
     
    TestDataGenerator() - Constructor for class org.jCharts.test.TestDataGenerator
     
    text - Variable in class org.jCharts.chartText.TextTag
     
    text - Variable in class org.jCharts.chartText.BarValueGroup.BarValue
     
    textLayout - Variable in class org.jCharts.chartText.TextTag
     
    textProcessor - Variable in class org.jCharts.Legend
     
    TextProcessor - class org.jCharts.chartData.processors.TextProcessor.
     
    TextProcessor() - Constructor for class org.jCharts.chartData.processors.TextProcessor
    Constructor
    TextTag - class org.jCharts.chartText.TextTag.
     
    TextTag(String, Font, Font, FontRenderContext) - Constructor for class org.jCharts.chartText.TextTag
    Constructor when using transformed (derived) fonts The need for this arises because the java metrics classes return either 0 or very strange values for the width and height of a string (TextLayout, LineMetrics, etc..) when the font is derived
    TextTag(String, Font, FontRenderContext) - Constructor for class org.jCharts.chartText.TextTag
    Default constructor - for untransformed fonts.
    textTagGroup - Variable in class org.jCharts.nonAxisChart.PieChart2D
     
    TextTagGroup - class org.jCharts.chartText.TextTagGroup.
     
    TextTagGroup(ChartFont, FontRenderContext) - Constructor for class org.jCharts.chartText.TextTagGroup
    Constructor
    textTagList - Variable in class org.jCharts.chartText.BarValueGroup
     
    textTags - Variable in class org.jCharts.chartData.processors.TextProcessor
     
    textTags - Variable in class org.jCharts.chartText.TextTagGroup
     
    throwable - Variable in class org.jCharts.chartData.ChartDataException
     
    tickChartStroke - Variable in class org.jCharts.properties.AxisTypeProperties
     
    tickLength - Variable in class org.jCharts.properties.PieChart2DProperties
     
    TICKS_ALL - Static variable in class org.jCharts.properties.AxisTypeProperties
     
    TICKS_NONE - Static variable in class org.jCharts.properties.AxisTypeProperties
     
    TICKS_ONLY_WITH_LABELS - Static variable in class org.jCharts.properties.AxisTypeProperties
     
    tickStart - Variable in class org.jCharts.axisChart.axis.Axis
     
    titleChartFont - Variable in class org.jCharts.properties.ChartProperties
     
    titleChartFont - Variable in class org.jCharts.properties.AxisTypeProperties
     
    titleHeight - Variable in class org.jCharts.axisChart.axis.Axis
     
    titlePadding - Variable in class org.jCharts.properties.ChartProperties
     
    titleWidth - Variable in class org.jCharts.axisChart.axis.Axis
     
    toHTML() - Method in class org.jCharts.imageMap.ImageMap
     
    toHTML(HTMLGenerator) - Method in class org.jCharts.Legend
    Enables the testing routines to display the contents of this Object.
    toHTML(HTMLGenerator) - Method in class org.jCharts.axisChart.axis.YAxis
    Enables the testing routines to display the contents of this Object.
    toHTML(HTMLGenerator) - Method in class org.jCharts.axisChart.axis.XAxis
    Enables the testing routines to display the contents of this Object.
    toHTML(HTMLGenerator) - Method in class org.jCharts.axisChart.axis.LabelAxis
    Deprecated. Enables the testing routines to display the contents of this Object.
    toHTML(HTMLGenerator) - Method in class org.jCharts.axisChart.axis.DataAxis
    Deprecated. Enables the testing routines to display the contents of this Object.
    toHTML(HTMLGenerator) - Method in class org.jCharts.axisChart.axis.Axis
    Enables the testing routines to display the contents of this Object.
    toHTML(HTMLGenerator) - Method in class org.jCharts.chartData.StockChartDataSet
    Enables the testing routines to display the contents of this Object.
    toHTML(HTMLGenerator) - Method in class org.jCharts.chartData.ScatterPlotDataSet
    Enables the testing routines to display the contents of this Object.
    toHTML(HTMLGenerator) - Method in class org.jCharts.chartData.ScatterPlotDataSeries
    Returns the total number data dimensions in all of the IAxisChartDataSets contained in this collection.
    toHTML(HTMLGenerator) - Method in class org.jCharts.chartData.DataSet
    Enables the testing routines to display the contents of this Object.
    toHTML(HTMLGenerator) - Method in class org.jCharts.chartData.DataSeries
    Enables the testing routines to display the contents of this Object.
    toHTML(HTMLGenerator) - Method in class org.jCharts.chartData.AxisDataSeries
    Enables the testing routines to display the contents of this Object.
    toHTML(HTMLGenerator) - Method in class org.jCharts.chartData.AxisChartDataSet
    Enables the testing routines to display the contents of this Object.
    toHTML(HTMLGenerator) - Method in class org.jCharts.chartText.TextTagGroup
    Renders all the text in this group.
    toHTML(HTMLGenerator) - Method in class org.jCharts.chartText.TextTag
    Enables the testing routines to display the contents of this Object.
    toHTML(HTMLGenerator) - Method in class org.jCharts.properties.StockChartProperties
    Enables the testing routines to display the contents of this Object.
    toHTML(HTMLGenerator) - Method in class org.jCharts.properties.ScatterPlotProperties
    Enables the testing routines to display the contents of this Object.
    toHTML(HTMLGenerator) - Method in class org.jCharts.properties.Properties
    Enables the testing routines to display the contents of this Object.
    toHTML(HTMLGenerator) - Method in class org.jCharts.properties.PointChartProperties
    Enables the testing routines to display the contents of this Object.
    toHTML(HTMLGenerator) - Method in class org.jCharts.properties.PieChart2DProperties
    Enables the testing routines to display the contents of this Object.
    toHTML(HTMLGenerator) - Method in class org.jCharts.properties.LineChartProperties
    Enables the testing routines to display the contents of this Object.
    toHTML(HTMLGenerator) - Method in class org.jCharts.properties.LegendProperties
    Enables the testing routines to display the contents of this Object.
    toHTML(HTMLGenerator) - Method in class org.jCharts.properties.LegendAreaProperties
    Enables the testing routines to display the contents of this Object.
    toHTML(HTMLGenerator) - Method in class org.jCharts.properties.DataAxisProperties
    Enables the testing routines to display the contents of this Object.
    toHTML(HTMLGenerator) - Method in class org.jCharts.properties.ChartProperties
    Enables the testing routines to display the contents of this Object.
    toHTML(HTMLGenerator) - Method in class org.jCharts.properties.BarChartProperties
    Enables the testing routines to display the contents of this Object.
    toHTML(HTMLGenerator) - Method in class org.jCharts.properties.AxisTypeProperties
    Enables the testing routines to display the contents of this Object.
    toHTML(HTMLGenerator) - Method in class org.jCharts.properties.AxisProperties
    Enables the testing routines to display the contents of this Object.
    toHTML(HTMLGenerator) - Method in class org.jCharts.properties.AreaProperties
    Enables the testing routines to display the contents of this Object.
    toHTML(HTMLGenerator) - Method in class org.jCharts.properties.AreaChartProperties
    Enables the testing routines to display the contents of this Object.
    toHTML(HTMLGenerator) - Method in interface org.jCharts.test.HTMLTestable
    Enables the testing routines to display the contents of this Object.
    toHTML(HTMLGenerator, String) - Method in class org.jCharts.nonAxisChart.PieChart2D
    Enables the testing routines to display the contents of this Object.
    toHTML(HTMLGenerator, String, ImageMap) - Method in class org.jCharts.Chart
    Enables the testing routines to display the contents of this Object.
    toHTML(HTMLGenerator, String, ImageMap) - Method in class org.jCharts.axisChart.ScatterPlotAxisChart
    Enables the testing routines to display the contents of this Object.
    toHTML(HTMLGenerator, String, ImageMap) - Method in class org.jCharts.axisChart.AxisChart
    Enables the testing routines to display the contents of this Object.
    toHTML(HTMLGenerator, String, ImageMap) - Method in interface org.jCharts.test.HTMLChartTestable
     
    toHTML(String) - Method in class org.jCharts.imageMap.ImageMapArea
    Returns a
    TOP - Static variable in class org.jCharts.properties.LegendAreaProperties
     
    toString() - Method in class org.jCharts.axisChart.axis.scale.ScaleCalculator
     
    toString() - Method in class org.jCharts.chartData.processors.ScatterPlotDataProcessor
     
    toString() - Method in class org.jCharts.chartText.TextTag
     
    toString() - Method in class org.jCharts.test.StopWatch
     
    totalDataValue - Variable in class org.jCharts.chartText.BarValueGroup
     
    totalItemAxisArea - Variable in class org.jCharts.axisChart.customRenderers.axisValue.AxisValueRenderEvent
     
    totalLabelWidths - Variable in class org.jCharts.chartData.processors.TextProcessor
     
    totalLabelWidths - Variable in class org.jCharts.chartText.TextTagGroup
     
    totalNumberOfDataSets - Variable in class org.jCharts.chartData.AxisDataSeries
     
    type - Variable in class org.jCharts.types.IntType
     
    Type - class org.jCharts.types.Type.
    Provides a common base class for all types.
    Type(int) - Constructor for class org.jCharts.types.Type
     
    typeCode - Variable in class org.jCharts.types.Type
     

    U

    useCommas - Variable in class org.jCharts.properties.DataAxisProperties
     
    useCommas() - Method in class org.jCharts.properties.DataAxisProperties
     
    useDollarSigns - Variable in class org.jCharts.properties.DataAxisProperties
     
    useDollarSigns() - Method in class org.jCharts.properties.DataAxisProperties
     
    usePercentSigns - Variable in class org.jCharts.properties.DataAxisProperties
     
    usePercentSigns() - Method in class org.jCharts.properties.DataAxisProperties
     
    userDefinedIncrement - Variable in class org.jCharts.axisChart.axis.scale.UserDefinedScaleCalculator
     
    userDefinedIncrement - Variable in class org.jCharts.properties.DataAxisProperties
     
    userDefinedMinimum - Variable in class org.jCharts.axisChart.axis.scale.UserDefinedScaleCalculator
     
    userDefinedMinimumValue - Variable in class org.jCharts.properties.DataAxisProperties
     
    userDefinedScale - Variable in class org.jCharts.properties.DataAxisProperties
     
    UserDefinedScaleCalculator - class org.jCharts.axisChart.axis.scale.UserDefinedScaleCalculator.
     
    UserDefinedScaleCalculator(double, double) - Constructor for class org.jCharts.axisChart.axis.scale.UserDefinedScaleCalculator
    It would seem to make sense to pass in the min and the max, but we want to allow people to use custom implementations which will be created when the AxisChart constructor gets called and we will not have looped the data to find the min and max yet.
    useVerticalLabels(boolean) - Method in class org.jCharts.axisChart.customRenderers.axisValue.renderers.ValueLabelRenderer
     

    V

    validate - Variable in class org.jCharts.properties.ChartProperties
     
    validate() - Method in class org.jCharts.chartData.StockChartDataSet
    Performs a limited validation of data passed to Constructor.
    validate() - Method in class org.jCharts.chartData.ScatterPlotDataSet
    Performs a limited validation of data.
    validate() - Method in class org.jCharts.chartData.DataSeries
     
    validate() - Method in class org.jCharts.chartData.AxisDataSeries
     
    validate() - Method in class org.jCharts.chartData.AxisChartDataSet
    Performs a limited validation of data.
    validate() - Method in interface org.jCharts.chartData.interfaces.IAxisPlotDataSet
    Allows validations to be performed on the data structures
    validate() - Method in interface org.jCharts.chartData.interfaces.IAxisDataSeries
    Validates the DataSeries implementation.
    validate() - Method in class org.jCharts.properties.ChartProperties
     
    validate(Chart) - Method in class org.jCharts.properties.PieChart2DProperties
    Validates the properties.
    validate(IAxisPlotDataSet) - Method in class org.jCharts.properties.StockChartProperties
    Validates the properties.
    validate(IAxisPlotDataSet) - Method in class org.jCharts.properties.ScatterPlotProperties
    Validates the properties.
    validate(IAxisPlotDataSet) - Method in class org.jCharts.properties.PointChartProperties
    Validates the properties.
    validate(IAxisPlotDataSet) - Method in class org.jCharts.properties.LineChartProperties
    Validates the properties.
    validate(IAxisPlotDataSet) - Method in class org.jCharts.properties.BarChartProperties
    Validates the properties.
    validate(IAxisPlotDataSet) - Method in class org.jCharts.properties.AxisChartTypeProperties
     
    validate(IAxisPlotDataSet) - Method in class org.jCharts.properties.AreaChartProperties
    Validates the properties.
    validateData(double[], String[], Paint[]) - Method in class org.jCharts.chartData.PieChartDataSet
    Perform some limited validation of the structure of the passed data.
    validateHorizontalPlot() - Method in class org.jCharts.axisChart.AxisChart
    Currently, we only support the bar chart types being horizontal, and you can not have a horizontally plotted bar chart in a combo chart.
    value - Variable in class org.jCharts.imageMap.ImageMapArea
     
    value - Variable in class org.jCharts.imageMap.AreaShape
     
    VALUE_LABELS - Static variable in class org.jCharts.types.PieLabelType
     
    valueChartFont - Variable in class org.jCharts.axisChart.customRenderers.axisValue.renderers.ValueLabelRenderer
     
    valueIndex - Variable in class org.jCharts.axisChart.customRenderers.axisValue.AxisValueRenderEvent
     
    valueLabelFont - Variable in class org.jCharts.properties.PieChart2DProperties
     
    valueLabelPosition - Variable in class org.jCharts.axisChart.customRenderers.axisValue.renderers.ValueLabelRenderer
     
    ValueLabelPosition - class org.jCharts.axisChart.customRenderers.axisValue.renderers.ValueLabelPosition.
     
    ValueLabelPosition(int) - Constructor for class org.jCharts.axisChart.customRenderers.axisValue.renderers.ValueLabelPosition
     
    ValueLabelRenderer - class org.jCharts.axisChart.customRenderers.axisValue.renderers.ValueLabelRenderer.
     
    ValueLabelRenderer(boolean, boolean, boolean, int) - Constructor for class org.jCharts.axisChart.customRenderers.axisValue.renderers.ValueLabelRenderer
     
    ValueLabelRenderer(boolean, boolean, int) - Constructor for class org.jCharts.axisChart.customRenderers.axisValue.renderers.ValueLabelRenderer
    Deprecated.  
    valueX - Variable in class org.jCharts.axisChart.customRenderers.axisValue.AxisValueRenderEvent
     
    valueY - Variable in class org.jCharts.axisChart.customRenderers.axisValue.AxisValueRenderEvent
     
    VERTICAL_ROTATION - Static variable in class org.jCharts.properties.util.ChartFont
     
    verticalPadding - Variable in class org.jCharts.chartText.BarValueGroup
     
    verticalPlot(AxisChart, IAxisChartDataSet, BarChartProperties, DataAxisProperties, Graphics2D, Rectangle2D.Float, float) - Static method in class org.jCharts.axisChart.BarChart
     
    verticalPlot(AxisChart, IAxisChartDataSet, BarChartProperties, DataAxisProperties, Graphics2D, Rectangle2D.Float, float, float, float) - Static method in class org.jCharts.axisChart.ClusteredBarChart
     
    verticalPlot(AxisChart, IAxisChartDataSet, StackedBarChartProperties, DataAxisProperties, Graphics2D, Rectangle2D.Float, float) - Static method in class org.jCharts.axisChart.StackedBarChart
     

    W

    widestLabel - Variable in class org.jCharts.chartData.processors.TextProcessor
     
    widestLabel - Variable in class org.jCharts.chartText.TextTagGroup
     
    widestLabelAndColumnPadding - Variable in class org.jCharts.Legend
     
    width - Variable in class org.jCharts.Legend
     
    width - Variable in class org.jCharts.Chart
     
    width - Variable in class org.jCharts.chartText.TextTag
     
    widthPercentage - Variable in class org.jCharts.properties.BarChartProperties
     

    X

    x - Variable in class org.jCharts.Legend
     
    x - Variable in class org.jCharts.imageMap.ImageMapArea
     
    xAxis - Variable in class org.jCharts.axisChart.AxisChart
     
    XAxis - class org.jCharts.axisChart.axis.XAxis.
     
    XAxis(AxisChart, int) - Constructor for class org.jCharts.axisChart.axis.XAxis
     
    xAxisLabel - Variable in class org.jCharts.imageMap.ImageMapArea
     
    xAxisLabelsAreVertical - Variable in class org.jCharts.properties.AxisProperties
     
    xAxisLabelsAreVertical() - Method in class org.jCharts.properties.AxisProperties
     
    xAxisProperties - Variable in class org.jCharts.properties.AxisProperties
     
    xAxisTitle - Variable in class org.jCharts.chartData.AxisDataSeries
     
    xLabelFilter - Variable in class org.jCharts.axisChart.axis.XAxis
     
    xPosition - Variable in class org.jCharts.chartText.TextTag
     

    Y

    y - Variable in class org.jCharts.Legend
     
    y - Variable in class org.jCharts.imageMap.ImageMapArea
     
    yAxis - Variable in class org.jCharts.axisChart.AxisChart
     
    YAxis - class org.jCharts.axisChart.axis.YAxis.
     
    YAxis(AxisChart, int) - Constructor for class org.jCharts.axisChart.axis.YAxis
    Constructor
    yAxisProperties - Variable in class org.jCharts.properties.AxisProperties
     
    yAxisTitle - Variable in class org.jCharts.chartData.AxisDataSeries
     
    yDelta - Variable in class org.jCharts.axisChart.axis.scale.ChartScale
    * The difference between two points on adjacent grid lines.
    yEnd - Variable in class org.jCharts.axisChart.axis.scale.ChartScale
    * The value which the last grid line represents.
    yMax - Variable in class org.jCharts.axisChart.axis.scale.ChartScale
    * The largest number in the dataset.
    yMax - Variable in class org.jCharts.chartData.processors.ScatterPlotDataProcessor
     
    yMin - Variable in class org.jCharts.axisChart.axis.scale.ChartScale
    * The smallest number in the dataset.
    yMin - Variable in class org.jCharts.chartData.processors.ScatterPlotDataProcessor
     
    yPosition - Variable in class org.jCharts.chartText.TextTag
     
    yStart - Variable in class org.jCharts.axisChart.axis.scale.ChartScale
    * The value which the first grid line represents.

    Z

    zeroDegreeOffset - Variable in class org.jCharts.properties.PieChart2DProperties
     
    zeroLineChartStroke - Variable in class org.jCharts.properties.DataAxisProperties
     
    zeroLineCoordinate - Variable in class org.jCharts.axisChart.axis.DataAxis
    Deprecated.  
    zeroLineCoordinate - Variable in class org.jCharts.axisChart.axis.Axis
     
    zeroLineCoordinate - Variable in class org.jCharts.axisChart.customRenderers.axisValue.AxisValueRenderEvent
     

    A B C D E F G H I J L M N O P R S T U V W X Y Z

    jcharts-0.7.5/javadocs/index.html0000644000175000001440000000140007751071376016011 0ustar onkarusers jCharts-0.7.5 API <H2> Frame Alert</H2> <P> This document is designed to be viewed using the frames feature. If you see this message, you are using a non-frame-capable web client. <BR> Link to<A HREF="overview-summary.html">Non-frame version.</A> jcharts-0.7.5/javadocs/overview-frame.html0000644000175000001440000000670307751071376017653 0ustar onkarusers Overview (jCharts-0.7.5 API)
    All Classes

    Packages
    org.jCharts
    org.jCharts.axisChart
    org.jCharts.axisChart.axis
    org.jCharts.axisChart.axis.scale
    org.jCharts.axisChart.customRenderers.axisValue
    org.jCharts.axisChart.customRenderers.axisValue.renderers
    org.jCharts.chartData
    org.jCharts.chartData.interfaces
    org.jCharts.chartData.processors
    org.jCharts.chartText
    org.jCharts.encoders
    org.jCharts.imageMap
    org.jCharts.nonAxisChart
    org.jCharts.properties
    org.jCharts.properties.util
    org.jCharts.test
    org.jCharts.types

      jcharts-0.7.5/javadocs/overview-summary.html0000644000175000001440000001732107751071376020254 0ustar onkarusers Overview (jCharts-0.7.5 API)


    jCharts-0.7.5

    Packages
    org.jCharts  
    org.jCharts.axisChart  
    org.jCharts.axisChart.axis  
    org.jCharts.axisChart.axis.scale  
    org.jCharts.axisChart.customRenderers.axisValue  
    org.jCharts.axisChart.customRenderers.axisValue.renderers  
    org.jCharts.chartData  
    org.jCharts.chartData.interfaces  
    org.jCharts.chartData.processors  
    org.jCharts.chartText  
    org.jCharts.encoders  
    org.jCharts.imageMap  
    org.jCharts.nonAxisChart  
    org.jCharts.properties  
    org.jCharts.properties.util  
    org.jCharts.test  
    org.jCharts.types  

     



    jcharts-0.7.5/javadocs/overview-tree.html0000644000175000001440000006714407751071376017526 0ustar onkarusers Class Hierarchy (jCharts-0.7.5 API)

    Hierarchy For All Packages

    Package Hierarchies:
    org.jCharts, org.jCharts.axisChart, org.jCharts.axisChart.axis, org.jCharts.axisChart.axis.scale, org.jCharts.axisChart.customRenderers.axisValue, org.jCharts.axisChart.customRenderers.axisValue.renderers, org.jCharts.chartData, org.jCharts.chartData.interfaces, org.jCharts.chartData.processors, org.jCharts.chartText, org.jCharts.encoders, org.jCharts.imageMap, org.jCharts.nonAxisChart, org.jCharts.properties, org.jCharts.properties.util, org.jCharts.test, org.jCharts.types

    Class Hierarchy

    Interface Hierarchy



    jcharts-0.7.5/javadocs/package-list0000644000175000001440000000074007751071402016277 0ustar onkarusersorg.jCharts org.jCharts.axisChart org.jCharts.axisChart.axis org.jCharts.axisChart.axis.scale org.jCharts.axisChart.customRenderers.axisValue org.jCharts.axisChart.customRenderers.axisValue.renderers org.jCharts.chartData org.jCharts.chartData.interfaces org.jCharts.chartData.processors org.jCharts.chartText org.jCharts.encoders org.jCharts.imageMap org.jCharts.nonAxisChart org.jCharts.properties org.jCharts.properties.util org.jCharts.test org.jCharts.types jcharts-0.7.5/javadocs/packages.html0000644000175000001440000000143607751071376016471 0ustar onkarusers (jCharts-0.7.5 API)


    The front page has been relocated.Please see:
              Frame version
              Non-frame version.
    jcharts-0.7.5/javadocs/serialized-form.html0000644000175000001440000015154007751071402017777 0ustar onkarusers Serialized Form (jCharts-0.7.5 API)

    Serialized Form


    Package org.jCharts

    Class org.jCharts.Chart implements Serializable

    Serialized Fields

    graphics2D

    java.awt.Graphics2D graphics2D

    width

    int width

    height

    int height

    legend

    Legend legend

    chartProperties

    ChartProperties chartProperties

    generateImageMap

    boolean generateImageMap

    imageMap

    ImageMap imageMap

    bufferedImage

    java.awt.image.BufferedImage bufferedImage

    Class org.jCharts.Legend implements Serializable

    Serialized Fields

    chart

    Chart chart

    legendProperties

    LegendProperties legendProperties

    iconSide

    float iconSide

    widestLabelAndColumnPadding

    float widestLabelAndColumnPadding

    numColumns

    int numColumns

    numRows

    int numRows

    textProcessor

    TextProcessor textProcessor

    x

    float x

    y

    float y

    width

    float width

    height

    float height

    labels

    java.util.ArrayList labels

    paints

    java.util.ArrayList paints

    shapes

    java.util.ArrayList shapes

    fillPointsFlags

    java.util.ArrayList fillPointsFlags

    pointOutlinePaints

    java.util.ArrayList pointOutlinePaints


    Package org.jCharts.axisChart

    Class org.jCharts.axisChart.AxisChart implements Serializable

    Serialized Fields

    xAxis

    XAxis xAxis

    yAxis

    YAxis yAxis

    axisProperties

    AxisProperties axisProperties

    iAxisDataSeries

    IAxisDataSeries iAxisDataSeries

    Class org.jCharts.axisChart.ScatterPlotAxisChart implements Serializable


    Package org.jCharts.axisChart.axis

    Class org.jCharts.axisChart.axis.Axis implements Serializable

    Serialized Fields

    axisChart

    AxisChart axisChart

    scalePixelWidth

    float scalePixelWidth

    pixelLength

    float pixelLength

    origin

    float origin

    titleHeight

    float titleHeight

    titleWidth

    float titleWidth

    minimumWidthNeeded

    float minimumWidthNeeded

    minimumHeightNeeded

    float minimumHeightNeeded

    axisLabelsGroup

    TextTagGroup axisLabelsGroup

    numberOfScaleItems

    int numberOfScaleItems

    tickStart

    float tickStart

    oneUnitPixelSize

    double oneUnitPixelSize

    zeroLineCoordinate

    float zeroLineCoordinate

    scaleCalculator

    ScaleCalculator scaleCalculator

    Class org.jCharts.axisChart.axis.DataAxis implements Serializable

    Serialized Fields

    minValue

    double minValue
    Deprecated. 

    maxValue

    double maxValue
    Deprecated. 

    increment

    double increment
    Deprecated. 

    zeroLineCoordinate

    float zeroLineCoordinate
    Deprecated. 

    Class org.jCharts.axisChart.axis.LabelAxis implements Serializable

    Class org.jCharts.axisChart.axis.XAxis implements Serializable

    Serialized Fields

    xLabelFilter

    int xLabelFilter

    startTicksAtAxis

    boolean startTicksAtAxis

    Class org.jCharts.axisChart.axis.YAxis implements Serializable

    Serialized Fields

    lastTickY

    float lastTickY


    Package org.jCharts.axisChart.customRenderers.axisValue

    Class org.jCharts.axisChart.customRenderers.axisValue.AxisValueRenderEvent implements Serializable

    Serialized Fields

    graphics2D

    java.awt.Graphics2D graphics2D

    fontRenderContext

    java.awt.font.FontRenderContext fontRenderContext

    iAxisPlotDataSet

    IAxisPlotDataSet iAxisPlotDataSet

    totalItemAxisArea

    java.awt.geom.Rectangle2D.Float totalItemAxisArea

    zeroLineCoordinate

    float zeroLineCoordinate

    valueX

    float valueX

    valueY

    float valueY

    dataSetIndex

    int dataSetIndex

    valueIndex

    int valueIndex


    Package org.jCharts.chartData

    Class org.jCharts.chartData.AxisChartDataSet implements Serializable

    Serialized Fields

    chartType

    ChartType chartType

    Class org.jCharts.chartData.AxisDataSeries implements Serializable

    Serialized Fields

    chartTitle

    java.lang.String chartTitle

    xAxisTitle

    java.lang.String xAxisTitle

    yAxisTitle

    java.lang.String yAxisTitle

    dataSets

    java.util.HashMap dataSets

    totalNumberOfDataSets

    int totalNumberOfDataSets

    sizeOfEachDataSet

    int sizeOfEachDataSet

    Class org.jCharts.chartData.ChartDataException implements Serializable

    Serialized Fields

    throwable

    java.lang.Throwable throwable

    Class org.jCharts.chartData.DataSeries implements Serializable

    Serialized Fields

    axisLabels

    java.lang.String[] axisLabels

    Class org.jCharts.chartData.DataSet implements Serializable

    Serialized Fields

    chartTypeProperties

    ChartTypeProperties chartTypeProperties

    data

    double[][] data

    legendLabels

    java.lang.String[] legendLabels

    paints

    java.awt.Paint[] paints

    Class org.jCharts.chartData.PieChartDataSet implements Serializable

    Serialized Fields

    chartTitle

    java.lang.String chartTitle

    Class org.jCharts.chartData.ScatterPlotDataSeries implements Serializable

    Class org.jCharts.chartData.ScatterPlotDataSet implements Serializable

    Serialized Fields

    data

    java.util.ArrayList data

    legendLabels

    java.util.ArrayList legendLabels

    paints

    java.util.ArrayList paints

    scatterPlotProperties

    ScatterPlotProperties scatterPlotProperties

    numDataItems

    int numDataItems

    Class org.jCharts.chartData.StockChartDataSet implements Serializable

    Serialized Fields

    chartType

    ChartType chartType

    high

    double[] high

    low

    double[] low

    open

    double[] open

    close

    double[] close

    numberOfDataSets

    int numberOfDataSets

    legendLabels

    java.lang.String[] legendLabels

    paints

    java.awt.Paint[] paints

    stockChartProperties

    StockChartProperties stockChartProperties


    Package org.jCharts.chartText

    Class org.jCharts.chartText.BarValueGroup.BarValue implements Serializable

    Serialized Fields

    barRect

    java.awt.geom.Rectangle2D.Float barRect

    startPosition

    int startPosition

    isNegative

    boolean isNegative

    text

    java.lang.String text

    Class org.jCharts.chartText.NumericTagGroup implements Serializable

    Serialized Fields

    numberFormat

    java.text.NumberFormat numberFormat

    Class org.jCharts.chartText.TextTag implements Serializable

    Serialized Fields

    xPosition

    float xPosition

    yPosition

    float yPosition

    textLayout

    java.awt.font.TextLayout textLayout

    attributes

    java.util.Hashtable attributes

    isHidden

    boolean isHidden

    width

    float width

    height

    float height

    fontAscent

    float fontAscent

    fontDescent

    float fontDescent

    isDerived

    boolean isDerived

    derivedFont

    java.awt.Font derivedFont

    text

    java.lang.String text

    font

    java.awt.Font font

    Class org.jCharts.chartText.TextTagGroup implements Serializable

    Serialized Fields

    widestLabel

    float widestLabel

    tallestLabel

    float tallestLabel

    totalLabelWidths

    float totalLabelWidths

    textTags

    java.util.ArrayList textTags

    chartFont

    ChartFont chartFont

    fontRenderContext

    java.awt.font.FontRenderContext fontRenderContext


    Package org.jCharts.imageMap

    Class org.jCharts.imageMap.AreaShape implements Serializable

    Serialized Fields

    value

    java.lang.String value

    Class org.jCharts.imageMap.CircleMapArea implements Serializable

    Serialized Fields

    radius

    int radius

    Class org.jCharts.imageMap.ImageMap implements Serializable

    Serialized Fields

    areas

    java.util.ArrayList areas

    Class org.jCharts.imageMap.ImageMapArea implements Serializable

    Serialized Fields

    x

    int[] x

    y

    int[] y

    value

    double value

    xAxisLabel

    java.lang.String xAxisLabel

    legendLabel

    java.lang.String legendLabel

    Class org.jCharts.imageMap.ImageMapNotSupportedException implements Serializable

    Class org.jCharts.imageMap.PolyMapArea implements Serializable

    Class org.jCharts.imageMap.RectMapArea implements Serializable


    Package org.jCharts.nonAxisChart

    Class org.jCharts.nonAxisChart.PieChart2D implements Serializable

    Serialized Fields

    pieX

    float pieX

    pieY

    float pieY

    diameter

    float diameter

    iPieChartDataSet

    IPieChartDataSet iPieChartDataSet

    pieChartDataProcessor

    PieChartDataProcessor pieChartDataProcessor

    textTagGroup

    TextTagGroup textTagGroup


    Package org.jCharts.properties

    Class org.jCharts.properties.AreaProperties implements Serializable

    Serialized Fields

    edgePadding

    float edgePadding

    borderStroke

    ChartStroke borderStroke

    Class org.jCharts.properties.AxisProperties implements Serializable

    Serialized Fields

    xAxisProperties

    AxisTypeProperties xAxisProperties

    yAxisProperties

    AxisTypeProperties yAxisProperties

    isPlotHorizontal

    boolean isPlotHorizontal

    xAxisLabelsAreVertical

    boolean xAxisLabelsAreVertical

    Class org.jCharts.properties.AxisTypeProperties implements Serializable

    Serialized Fields

    showTicks

    int showTicks

    tickChartStroke

    ChartStroke tickChartStroke

    showGridLines

    int showGridLines

    gridLineChartStroke

    ChartStroke gridLineChartStroke

    scaleChartFont

    ChartFont scaleChartFont

    axisTitleChartFont

    ChartFont axisTitleChartFont

    axisStroke

    ChartStroke axisStroke

    paddingBetweenAxisTitleAndLabels

    float paddingBetweenAxisTitleAndLabels

    axisTickMarkPixelLength

    float axisTickMarkPixelLength

    paddingBetweenLabelsAndTicks

    float paddingBetweenLabelsAndTicks

    paddingBetweenAxisAndLabels

    float paddingBetweenAxisAndLabels

    paddingBetweenAxisLabels

    float paddingBetweenAxisLabels

    showEndBorder

    boolean showEndBorder

    showAxisLabels

    boolean showAxisLabels

    titleChartFont

    ChartFont titleChartFont

    Class org.jCharts.properties.ChartProperties implements Serializable

    Serialized Fields

    titleChartFont

    ChartFont titleChartFont

    titlePadding

    float titlePadding

    validate

    boolean validate

    Class org.jCharts.properties.DataAxisProperties implements Serializable

    Serialized Fields

    roundToNearest

    int roundToNearest

    showZeroLine

    boolean showZeroLine

    zeroLineChartStroke

    ChartStroke zeroLineChartStroke

    userDefinedScale

    boolean userDefinedScale

    userDefinedMinimumValue

    double userDefinedMinimumValue

    userDefinedIncrement

    double userDefinedIncrement

    numItems

    int numItems

    useDollarSigns

    boolean useDollarSigns

    useCommas

    boolean useCommas

    usePercentSigns

    boolean usePercentSigns

    scaleCalculator

    ScaleCalculator scaleCalculator

    Class org.jCharts.properties.LabelAxisProperties implements Serializable

    Class org.jCharts.properties.LegendAreaProperties implements Serializable

    Serialized Fields

    numColumns

    int numColumns

    rowPadding

    int rowPadding

    columnPadding

    int columnPadding

    iconPadding

    int iconPadding

    chartPadding

    int chartPadding

    placement

    int placement

    Class org.jCharts.properties.LegendProperties implements Serializable

    Serialized Fields

    font

    java.awt.Font font

    fontPaint

    java.awt.Paint fontPaint

    iconBorderPaint

    java.awt.Paint iconBorderPaint

    iconBorderStroke

    java.awt.Stroke iconBorderStroke

    size

    java.awt.Dimension size

    Class org.jCharts.properties.Properties implements Serializable

    Serialized Fields

    backgroundPaint

    java.awt.Paint backgroundPaint

    Class org.jCharts.properties.PropertyException implements Serializable


    Package org.jCharts.test

    Class org.jCharts.test.SwingTest implements Serializable

    Serialized Fields

    panel

    javax.swing.JPanel panel


    Package org.jCharts.types

    Class org.jCharts.types.ChartType implements Serializable

    Serialized Fields

    stackedData

    boolean stackedData

    Class org.jCharts.types.IntType implements Serializable

    Serialized Fields

    type

    int type

    Class org.jCharts.types.PieLabelType implements Serializable

    Class org.jCharts.types.StockChartDataType implements Serializable

    Class org.jCharts.types.Type implements Serializable

    Serialized Fields

    typeCode

    int typeCode



    jcharts-0.7.5/javadocs/stylesheet.css0000644000175000001440000000246007751071402016714 0ustar onkarusers/* Javadoc style sheet */ /* Define colors, fonts and other style attributes here to override the defaults */ /* Page background color */ body { background-color: #FFFFFF } /* Table colors */ .TableHeadingColor { background: #CCCCFF } /* Dark mauve */ .TableSubHeadingColor { background: #EEEEFF } /* Light mauve */ .TableRowColor { background: #FFFFFF } /* White */ /* Font used in left-hand frame lists */ .FrameTitleFont { font-size: 10pts; font-family: Helvetica, Arial, san-serif } .FrameHeadingFont { font-size: 10pts; font-family: Helvetica, Arial, san-serif } .FrameItemFont { font-size: 10pts; font-family: Helvetica, Arial, san-serif } /* Example of smaller, sans-serif font in frames */ /* .FrameItemFont { font-size: 10pt; font-family: Helvetica, Arial, sans-serif } */ /* Navigation bar fonts and colors */ .NavBarCell1 { background-color:#EEEEFF;}/* Light mauve */ .NavBarCell1Rev { background-color:#00008B;}/* Dark Blue */ .NavBarFont1 { font-family: Arial, Helvetica, sans-serif; color:#000000;} .NavBarFont1Rev { font-family: Arial, Helvetica, sans-serif; color:#FFFFFF;} .NavBarCell2 { font-family: Arial, Helvetica, sans-serif; background-color:#FFFFFF;} .NavBarCell3 { font-family: Arial, Helvetica, sans-serif; background-color:#FFFFFF;} jcharts-0.7.5/lib/0000755000175000001440000000000007751071404012765 5ustar onkarusersjcharts-0.7.5/src/0000755000175000001440000000000007751071402013004 5ustar onkarusersjcharts-0.7.5/src/org/0000755000175000001440000000000007751071402013573 5ustar onkarusersjcharts-0.7.5/src/org/jCharts/0000755000175000001440000000000007751071402015171 5ustar onkarusersjcharts-0.7.5/src/org/jCharts/axisChart/0000755000175000001440000000000007751071402017117 5ustar onkarusersjcharts-0.7.5/src/org/jCharts/axisChart/axis/0000755000175000001440000000000007751071402020063 5ustar onkarusersjcharts-0.7.5/src/org/jCharts/axisChart/axis/scale/0000755000175000001440000000000007751071402021152 5ustar onkarusersjcharts-0.7.5/src/org/jCharts/axisChart/axis/scale/AutomaticScaleCalculator.java0000644000175000001440000001546507751071402026740 0ustar onkarusers/*********************************************************************************************** * File Info: $Id: AutomaticScaleCalculator.java,v 1.3 2003/02/04 23:55:33 nathaniel_auvil Exp $ * Copyright (C) 2002 * Author: Nathaniel G. Auvil, Mike Lissick * Contributor(s): * * Copyright 2002 (C) Nathaniel G. Auvil. All Rights Reserved. * * Redistribution and use of this software and associated documentation ("Software"), with or * without modification, are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain copyright statements and notices. * Redistributions must also contain a copy of this document. * * 2. Redistributions in binary form must reproduce the above copyright notice, this list of * conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. * * 3. The name "jCharts" or "Nathaniel G. Auvil" must not be used to endorse or promote * products derived from this Software without prior written permission of Nathaniel G. * Auvil. For written permission, please contact nathaniel_auvil@users.sourceforge.net * * 4. Products derived from this Software may not be called "jCharts" nor may "jCharts" appear * in their names without prior written permission of Nathaniel G. Auvil. jCharts is a * registered trademark of Nathaniel G. Auvil. * * 5. Due credit should be given to the jCharts Project (http://jcharts.sourceforge.net/). * * THIS SOFTWARE IS PROVIDED BY Nathaniel G. Auvil AND CONTRIBUTORS ``AS IS'' AND ANY * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL * jCharts OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE ************************************************************************************************/ package org.jCharts.axisChart.axis.scale; import org.jCharts.axisChart.axis.scale.ScaleCalculator; public class AutomaticScaleCalculator extends ScaleCalculator { /**************************************************************************************** * ***************************************************************************************/ public AutomaticScaleCalculator() { } /********************************************************************************************* * Computes the axis increment taking into account the user specified criteria. * ********************************************************************************************/ public void computeIncrement() { double powerOfTen = Math.pow( 10.0d, Math.abs( ( double ) super.getRoundingPowerOfTen() ) ); double range; //---if MIN >= 0, MAX is the range, if MAX < 0, -MIN is the range if( ( super.getMinValue() >= 0 ) || ( super.getMaxValue() < 0 ) ) { range = Math.max( super.getMaxValue(), -super.getMinValue() ); super.increment = range / ( super.getNumberOfScaleItems() - 1 ); this.roundTheIncrement( powerOfTen ); if( super.getMinValue() >= 0 ) { super.setMinValue( 0.0d ); super.setMaxValue( super.increment * super.getNumberOfScaleItems() ); } else { super.setMaxValue( 0.0d ); super.setMinValue( -( super.increment * super.getNumberOfScaleItems() ) ); } } //---else MIN is negative and MAX is positive, so add values together (minus a negative is a positive) else { super.setMinValue( super.round( super.getMinValue(), powerOfTen ) ); //---round min value down to get the start value for axis. Compute range from this value. if( super.getRoundingPowerOfTen() > 0 ) { super.setMinValue( super.getMinValue() - powerOfTen ); } else { super.setMinValue( super.getMinValue()- ( 1 / powerOfTen ) ); } //---we want the rounded Axis min for range //---MIN is always negative at this point so minus a negative is a positive range = super.getMaxValue() - super.getMinValue(); super.increment = range / ( super.getNumberOfScaleItems() - 1 ); super.roundTheIncrement( powerOfTen ); //---axis starts at minValue, not zero! super.setMaxValue( super.getMinValue() + ( this.increment * super.getNumberOfScaleItems() ) ); } } /********************************************************************************************* * Drives the computation of the axis increment and related values taking into account the * user specified rounding criteria and sets it to the super class increment variable. * * So if you specify to round to the nearest 100 and give an increment of 2.5, the increment * will become 100. * * @param numberOfScaleItems ******************************************************************************************** public void roundScaleValues( double powerOfTen, int numberOfScaleItems ) { this.roundTheIncrement( powerOfTen ); //---if MIN >= 0, MAX is the range, if MAX < 0, -MIN is the range if( ( super.getMinValue() >= 0 ) || ( super.getMaxValue() < 0 ) ) { if( super.getMinValue() >= 0 ) { super.setMinValue( 0.0d ); super.setMaxValue( super.increment * numberOfScaleItems ); } else { super.setMaxValue( 0.0d ); super.setMinValue( -( super.increment * numberOfScaleItems ) ); } } //---else MIN is negative and MAX is positive, so add values together (minus a negative is a positive) else { super.setMinValue( super.round( super.getMinValue(), powerOfTen ) ); //---round min value down to get the start value for axis. Compute range from this value. if( super.getRoundingPowerOfTen() > 0 ) { super.setMinValue( super.getMinValue() - powerOfTen ); } else { super.setMinValue( super.getMinValue()- ( 1 / powerOfTen ) ); } //---we want the rounded Axis min for range //---MIN is always negative at this point so minus a negative is a positive range = super.getMaxValue() - super.getMinValue(); super.increment = range / numberOfScaleItems; super.roundTheIncrement( powerOfTen ); //---axis starts at minValue, not zero! super.setMaxValue( super.getMinValue() + ( this.increment * numberOfScaleItems ) ); } } */ /* public static void main( String[] args ) { AutomaticScaleCalculator s= new AutomaticScaleCalculator(); } */ } jcharts-0.7.5/src/org/jCharts/axisChart/axis/scale/ChartScale.java0000644000175000001440000001513407751071402024032 0ustar onkarusers package org.jCharts.axisChart.axis.scale; import org.jCharts.properties.AxisProperties; import org.jCharts.properties.PropertyException; public class ChartScale { /** * The largest number in the dataset. */ double yMax; /** * The smallest number in the dataset. */ double yMin; /** * The difference between two points on adjacent grid lines. */ double yDelta = 0.0; /** * The value which the first grid line represents. */ double yStart = 0.0; /** * The value which the last grid line represents. */ double yEnd = 0.0; /** * The suggested value for the rounding of the data. */ int rounding = 0; /** * The number of segments that the suggested yStart, yEnd and yDelta produce. */ int segments = 20; public static void main( String[] args ) { ChartScale c = new ChartScale(); c.yMin = -30; c.yMax = 200; c.calculate(); System.out.println( "yStart= " + c.yStart + " yEnd= " + c.yEnd + " segments= " + c.segments + " rounding= " + c.rounding ); } public ChartScale() { } /** * Constructor. Creates a ChartScale object and initializes all of its properties as appropriate for the given * data's minimum and maximum values. * * @param data double[] the data for which you would like suggested graph values */ public ChartScale( double[][] data ) { this.yMax = getMax( data ); this.yMin = getMin( data ); calculate(); } /** * Compute yDelta, yStart, yEnd, segments and rounding. */ private void calculate() { // In the following line, note that Math.log is actually Natural Logarithm. // log base a of b = ln b / ln a => log base 10 of x = ln x / ln 10 // yDelta is a nice, even, power-of-ten difference between yMax and yMin yDelta = Math.pow( 10.0, Math.round( Math.log( yMax - yMin ) / Math.log( 10 ) ) ); yStart = yMin - (yMin % yDelta); // the first point on an even power of ten on or below yMin yEnd = yMax - (yMax % yDelta) + yDelta; // the first point on an even power of ten on or above yMax // At this point, we have a yStart, yEnd and yDelta that are guaranteed to include all points in the graph. // However, there are probably too few segments. Perhaps only two. Reduce the delta according to the // number of segments that we already have. Note that we will reduce delta only in a way that produces some // nice round numbers. yDelta is a power of ten, and therefore will alway divide nicely by 10, 4, and 2. // We will need to recalculate yStart and yEnd to get rid of any unneeded blank segments. // Count the number of segments this gives us and use this number to determine the factor by which to reduce // yDelta. Note: to get larger numbers of segments, fiddle with the if statements below. segments = (int) ((yEnd - yStart) / yDelta); if( segments <= 2 ) { // we need 10 times as many segments (before recalculating start and end, which may reduce the number) yDelta = yDelta / 10.0; } else if( segments <= 5 ) { // we need 4 times as many segments (before recalculating start and end, which may reduce the number) yDelta = yDelta / 4.0; } else if( segments <= 10 ) { // we need twice as many segments (before recalculating start and end, which may reduce the number) yDelta = yDelta / 2.0; } // Recalc yStart and yEnd to match with new delta. yStart = yMin - (yMin % yDelta); yEnd = yMax - (yMax % yDelta) + yDelta; segments = (int) ((yEnd - yStart) / yDelta); rounding = (int) (Math.round( Math.log( yDelta ) / Math.log( 10 ) ) - 3); } /** * Helper method that finds the largest double in the 2D array of doubles. * * @param data double[][] to look into for the max * @return double the largest value found */ private double getMax( double[][] data ) { double max = Double.MIN_VALUE; for( int i = 0; i < data.length; i++ ) { double[] doubles = data[ i ]; for( int j = 0; j < doubles.length; j++ ) { double aDouble = doubles[ j ]; if( aDouble > max ) { max = aDouble; } } } return max; } /** * Helper method that finds the smallest double in the 2D array of doubles. * * @param data double[][] to look into for the min * @return double the smallest value found */ private double getMin( double[][] data ) { double min = Double.MAX_VALUE; for( int i = 0; i < data.length; i++ ) { double[] doubles = data[ i ]; for( int j = 0; j < doubles.length; j++ ) { double aDouble = doubles[ j ]; if( aDouble < min ) { min = aDouble; } } } return min; } /** * Accessor for the yMax property. This property represents the largest value in the dataset. * * @return double largest value in the associated dataset */ public double getYMax() { return yMax; } /** * Accessor for the yMin property. This property represents the smallest value in the dataset. * * @return double smallest value in the associated dataset */ public double getYMin() { return yMin; } /** * Accessor for the yDelta property. The difference between any two points on adjacent grid lines. * * @return double grid line spacing */ public double getYDelta() { return yDelta; } /** * Accessor for the yStart property. The value which the first grid line represents. * * @return double y axis value for the bottom horizontal grid line. */ public double getYStart() { return yStart; } /** * Accessor for the yEnd property. The value which the last grid line represents. * * @return double y axis value for the top horizontal grid line. */ public double getYEnd() { return yEnd; } /** * Accessor for the rounding property. The suggested value for the rounding of the data. * * @return double rounding value suggestion. */ public int getRounding() { return rounding; } /** * Accessor for the segments property. The number of segments that the suggested yStart, yEnd and yDelta produce. * * @return double segments in the graph as suggested. */ public int getSegments() { return segments; } /** * Creates and returns a new AxisProperties object based on the internally calculated values of yStart, yDelta, * segments and rounding. * * @return AxisProperties with yStart, yDelta, segments and rounding set. */ public AxisProperties getAxisProperties() throws PropertyException { /* AxisProperties axisProperties = new AxisProperties(yStart, yDelta); axisProperties.setYAxisRoundValuesToNearest(rounding); axisProperties.setYAxisNumItems(segments); return axisProperties; */ return null; } } jcharts-0.7.5/src/org/jCharts/axisChart/axis/scale/ScaleCalculator.java0000644000175000001440000001562507751071402025067 0ustar onkarusers/*********************************************************************************************** * File Info: $Id: ScaleCalculator.java,v 1.4 2003/02/26 01:04:31 nathaniel_auvil Exp $ * Copyright (C) 2002 * Author: Nathaniel G. Auvil, Mike Lissick * Contributor(s): * * Copyright 2002 (C) Nathaniel G. Auvil. All Rights Reserved. * * Redistribution and use of this software and associated documentation ("Software"), with or * without modification, are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain copyright statements and notices. * Redistributions must also contain a copy of this document. * * 2. Redistributions in binary form must reproduce the above copyright notice, this list of * conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. * * 3. The name "jCharts" or "Nathaniel G. Auvil" must not be used to endorse or promote * products derived from this Software without prior written permission of Nathaniel G. * Auvil. For written permission, please contact nathaniel_auvil@users.sourceforge.net * * 4. Products derived from this Software may not be called "jCharts" nor may "jCharts" appear * in their names without prior written permission of Nathaniel G. Auvil. jCharts is a * registered trademark of Nathaniel G. Auvil. * * 5. Due credit should be given to the jCharts Project (http://jcharts.sourceforge.net/). * * THIS SOFTWARE IS PROVIDED BY Nathaniel G. Auvil AND CONTRIBUTORS ``AS IS'' AND ANY * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL * jCharts OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE ************************************************************************************************/ package org.jCharts.axisChart.axis.scale; /*************************************************************************************** * Base class for the logic used to compute the scale on the charts. There are two * implementations provided and you are free to implement your own if you do not like * the default implementations provided. * * ***************************************************************************************/ public abstract class ScaleCalculator { private double minValue; private double maxValue; private int roundingPowerOfTen; private int numberOfScaleItems; protected double increment; /*************************************************************************************** * Computes the scale increment. * **************************************************************************************/ protected abstract void computeIncrement(); /********************************************************************************************* * Drives the computation of the axis increment and related values taking into account the * user specified rounding criteria. * * So if you specify to round to the nearest 100 and give an increment of 2.5, the increment * will become 100. * ********************************************************************************************/ public final void computeScaleValues() { this.computeIncrement(); //double powerOfTen = Math.pow( 10, Math.abs( this.getRoundingPowerOfTen() ) ); //this.roundScaleValues( powerOfTen, numberOfScaleItems ); } public final void setMinValue( double minValue ) { this.minValue = minValue; } public final double getMinValue() { return this.minValue; } public final void setMaxValue( double maxValue ) { this.maxValue = maxValue; } public final double getMaxValue() { return this.maxValue; } public final double getIncrement() { return increment; } public int getNumberOfScaleItems() { return numberOfScaleItems; } public void setNumberOfScaleItems( int numberOfScaleItems ) { this.numberOfScaleItems = numberOfScaleItems; } /*********************************************************************************************** * Sets the exponent power of ten to round values to. * * @param powerOfTen exponent of ten to round to: 1=10, 2=100, -2=.01 ***********************************************************************************************/ public final void setRoundingPowerOfTen( int powerOfTen ) { this.roundingPowerOfTen = powerOfTen; } public final int getRoundingPowerOfTen() { return this.roundingPowerOfTen; } /*********************************************************************************************** * Rounds the passed value by the power of ten specified * * @param value the value to round * @param powerOfTen the product of 10 times the rounding property. * @return double the rounded result ************************************************************************************************/ protected double round( double value, double powerOfTen ) { if( this.roundingPowerOfTen > 0 ) { return ( Math.round( value / powerOfTen ) * powerOfTen ); } else if( this.roundingPowerOfTen < 0 ) { return ( Math.round( value * powerOfTen ) / powerOfTen ); } else { return ( Math.round( value ) ); } } /*********************************************************************************************** * Rounds the scale increment up by the power of ten specified in the properties. * * @param powerOfTen the value of 10 times the rounding property. ************************************************************************************************/ protected void roundTheIncrement( double powerOfTen ) { this.increment = this.round( this.increment, powerOfTen ); //---round the increment up or down if( this.roundingPowerOfTen > 0 ) { this.increment += powerOfTen; } else { this.increment += ( 1 / powerOfTen ); } } /******************************************************************************* * * @return *******************************************************************************/ public String toString() { StringBuffer s= new StringBuffer( 90 ); s.append( "ScaleCalculator-> min= " ); s.append( this.minValue ); s.append( " max= " ); s.append( this.maxValue ); s.append( " increment= " ); s.append( this.increment ); return s.toString(); } } jcharts-0.7.5/src/org/jCharts/axisChart/axis/scale/UserDefinedScaleCalculator.java0000644000175000001440000001324207751071402027176 0ustar onkarusers/*********************************************************************************************** * File Info: $Id: UserDefinedScaleCalculator.java,v 1.2 2003/02/01 03:33:27 nathaniel_auvil Exp $ * Copyright (C) 2002 * Author: Nathaniel G. Auvil * Contributor(s): Mike Lissick * * Copyright 2002 (C) Nathaniel G. Auvil. All Rights Reserved. * * Redistribution and use of this software and associated documentation ("Software"), with or * without modification, are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain copyright statements and notices. * Redistributions must also contain a copy of this document. * * 2. Redistributions in binary form must reproduce the above copyright notice, this list of * conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. * * 3. The name "jCharts" or "Nathaniel G. Auvil" must not be used to endorse or promote * products derived from this Software without prior written permission of Nathaniel G. * Auvil. For written permission, please contact nathaniel_auvil@users.sourceforge.net * * 4. Products derived from this Software may not be called "jCharts" nor may "jCharts" appear * in their names without prior written permission of Nathaniel G. Auvil. jCharts is a * registered trademark of Nathaniel G. Auvil. * * 5. Due credit should be given to the jCharts Project (http://jcharts.sourceforge.net/). * * THIS SOFTWARE IS PROVIDED BY Nathaniel G. Auvil AND CONTRIBUTORS ``AS IS'' AND ANY * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL * jCharts OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE ************************************************************************************************/ package org.jCharts.axisChart.axis.scale; import org.jCharts.axisChart.axis.scale.ScaleCalculator; public class UserDefinedScaleCalculator extends ScaleCalculator { private double userDefinedMinimum; private double userDefinedIncrement; /**************************************************************************************** * * It would seem to make sense to pass in the min and the max, but we want to allow * people to use custom implementations which will be created when the AxisChart * constructor gets called and we will not have looped the data to find the min * and max yet. No sense in making people do that when we will do that already. * * @param userDefinedMinimum * @param userDefinedIncrement ***************************************************************************************/ public UserDefinedScaleCalculator( double userDefinedMinimum, double userDefinedIncrement ) { this.userDefinedMinimum = userDefinedMinimum; this.userDefinedIncrement = userDefinedIncrement; } /********************************************************************************************* * Computes the axis increment WITHOUT taking into account the user specified rounding * criteria and sets it to the super class increment variable. You can extend this class * and override this method to compute you own scale. * ********************************************************************************************/ protected void computeIncrement() { super.increment = this.userDefinedIncrement; double powerOfTen = Math.pow( 10, Math.abs( this.getRoundingPowerOfTen() ) ); //---round the increment according to user defined power super.increment = super.round( super.increment, powerOfTen ); //---if we round this down to zero, force it to the power of ten. //---for example, round to nearest 100, value = 35...would push down to 0 which is illegal. if( super.increment == 0 ) { super.increment = powerOfTen; } super.setMinValue( super.round( this.userDefinedMinimum, powerOfTen ) ); super.setMaxValue( super.getMinValue() + ( super.increment * super.getNumberOfScaleItems() ) ); } /********************************************************************************************* * Drives the computation of the axis increment and related values taking into account the * user specified rounding criteria and sets it to the super class increment variable. * * So if you specify to round to the nearest 100 and give an increment of 2.5, the increment * will become 100. * * @param numberOfScaleItems ******************************************************************************************** public void roundScaleValues( double powerOfTen, int numberOfScaleItems ) { //---round the increment according to user defined power super.increment = super.round( super.increment, powerOfTen ); //---if we round this down to zero, force it to the power of ten. //---for example, round to nearest 100, value = 35...would push down to 0 which is illegal. if( super.increment == 0 ) { super.increment = powerOfTen; } super.setMinValue( super.round( this.userDefinedMinimum, powerOfTen ) ); super.setMaxValue( super.getMinValue() + ( super.increment * numberOfScaleItems ) ); } */ } jcharts-0.7.5/src/org/jCharts/axisChart/axis/Axis.java0000644000175000001440000002535107751071402021640 0ustar onkarusers/*********************************************************************************************** * File Info: $Id: Axis.java,v 1.11 2003/03/09 22:42:10 nathaniel_auvil Exp $ * Copyright (C) 2002 * Author: Nathaniel G. Auvil * Contributor(s): * * Copyright 2002 (C) Nathaniel G. Auvil. All Rights Reserved. * * Redistribution and use of this software and associated documentation ("Software"), with or * without modification, are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain copyright statements and notices. * Redistributions must also contain a copy of this document. * * 2. Redistributions in binary form must reproduce the above copyright notice, this list of * conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. * * 3. The name "jCharts" or "Nathaniel G. Auvil" must not be used to endorse or promote * products derived from this Software without prior written permission of Nathaniel G. * Auvil. For written permission, please contact nathaniel_auvil@users.sourceforge.net * * 4. Products derived from this Software may not be called "jCharts" nor may "jCharts" appear * in their names without prior written permission of Nathaniel G. Auvil. jCharts is a * registered trademark of Nathaniel G. Auvil. * * 5. Due credit should be given to the jCharts Project (http://jcharts.sourceforge.net/). * * THIS SOFTWARE IS PROVIDED BY Nathaniel G. Auvil AND CONTRIBUTORS ``AS IS'' AND ANY * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL * jCharts OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE ************************************************************************************************/ package org.jCharts.axisChart.axis; import org.jCharts.axisChart.AxisChart; import org.jCharts.axisChart.axis.scale.ScaleCalculator; import org.jCharts.chartText.TextTagGroup; import org.jCharts.properties.util.ChartFont; import org.jCharts.test.HTMLGenerator; import org.jCharts.test.HTMLTestable; import java.awt.font.TextLayout; import java.io.Serializable; import java.lang.reflect.Field; abstract public class Axis implements HTMLTestable, Serializable { //---reference to containing chart private AxisChart axisChart; //---number of pixels between each label private float scalePixelWidth; //---the length of the axis private float pixelLength; //---the pixel coordinate of the start of the axis private float origin; private float titleHeight; private float titleWidth; private float minimumWidthNeeded; private float minimumHeightNeeded; //---Note, if no labels are displayed, axisLabelsGroup will be NULL! private TextTagGroup axisLabelsGroup; //---this number of items to plot on the Axis. Note, if no labels are displayed, axisLabelsGroup will be NULL so we can not depend on that. private int numberOfScaleItems; //---pixel location of tick start needed for reference when start drawing charts. private float tickStart; //---multiplication value used to determine the coordinate location of values on YAxis private double oneUnitPixelSize; private float zeroLineCoordinate; private ScaleCalculator scaleCalculator; /************************************************************************************************** * Constructor * * @param axisChart * @param numberOfScaleItems ***************************************************************************************************/ public Axis( AxisChart axisChart, int numberOfScaleItems ) { this.axisChart = axisChart; this.numberOfScaleItems= numberOfScaleItems; } /************************************************************************************************** * Returns reference to AxisChart Object. * * @return axisChart ***************************************************************************************************/ public final AxisChart getAxisChart() { return this.axisChart; } public int getNumberOfScaleItems() { return numberOfScaleItems; } public TextTagGroup getAxisLabelsGroup() { return axisLabelsGroup; } public void setAxisLabelsGroup( TextTagGroup axisLabelsGroup ) { this.axisLabelsGroup = axisLabelsGroup; } public final float getTitleWidth() { return this.titleWidth; } public final float getTitleHeight() { return this.titleHeight; } public final float getPixelLength() { return this.pixelLength; } public final void setPixelLength( float pixelLength ) { this.pixelLength = pixelLength; } public final float getOrigin() { return this.origin; } public final void setOrigin( float origin ) { this.origin = origin; } public final float getMinimumWidthNeeded() { return this.minimumWidthNeeded; } public final void setMinimumWidthNeeded( float minimumWidthNeeded ) { this.minimumWidthNeeded = minimumWidthNeeded; } public final float getMinimumHeightNeeded() { return this.minimumHeightNeeded; } public final void setMinimumHeightNeeded( float minimumHeightNeeded ) { this.minimumHeightNeeded = minimumHeightNeeded; } public final float getScalePixelWidth() { return this.scalePixelWidth; } public final void setScalePixelWidth( float scalePixelWidth ) { this.scalePixelWidth = scalePixelWidth; } public float getTickStart() { return tickStart; } public void setTickStart( float tickStart ) { this.tickStart = tickStart; } public ScaleCalculator getScaleCalculator() { return scaleCalculator; } public void setScaleCalculator( ScaleCalculator scaleCalculator ) { this.scaleCalculator = scaleCalculator; } /********************************************************************************************* * * * @param title * @param axisTitleFont **********************************************************************************************/ public final void computeAxisTitleDimensions( String title, ChartFont axisTitleFont ) { TextLayout textLayout = new TextLayout( title, axisTitleFont.getFont(), this.getAxisChart().getGraphics2D().getFontRenderContext() ); this.titleWidth = textLayout.getAdvance(); this.titleHeight = textLayout.getAscent() + textLayout.getDescent(); } /********************************************************************************************* * Enables the testing routines to display the contents of this Object. * * Can only see 'private' fields from this class. * * @param htmlGenerator **********************************************************************************************/ public void toHTML( HTMLGenerator htmlGenerator ) { String name = this.getClass().getSuperclass().getName() + "->"; //---calling on instance of YAxis or XAxis Field[] fields = this.getClass().getSuperclass().getDeclaredFields(); for( int i = 0; i < fields.length; i++ ) { try { htmlGenerator.addField( name + fields[ i ].getName(), fields[ i ].get( this ) ); } catch( IllegalAccessException illegalAccessException ) { illegalAccessException.printStackTrace(); } } } /************************************************************************************************* * Computes the number of pixels between each value on the axis. * **************************************************************************************************/ public void computeScalePixelWidth() { setScalePixelWidth( getPixelLength() / this.getNumberOfScaleItems() ); } /************************************************************************************************* * Computes the number of pixels between each value on the axis. * **************************************************************************************************/ public void computeScalePixelWidthDataAxis() { setScalePixelWidth( getPixelLength() / ( this.numberOfScaleItems - 1) ); } public void setOneUnitPixelSize( double oneUnitPixelSize ) { this.oneUnitPixelSize = oneUnitPixelSize; } /************************************************************************************************** * Returns the number of pixels one value unit occupies. * * @return double the number of pixels one value unit occupies. ***************************************************************************************************/ public double getOneUnitPixelSize() { return this.oneUnitPixelSize; } /************************************************************************************************** * Returns the screen coordinate of the zero line. This will not always be the same as the origin * as not all charts start at zero. This is needed not only by the Axis, but some of the Chart * implementations as well. * * @return float the screen pixel location of the zero line. ***************************************************************************************************/ public float getZeroLineCoordinate() { return this.zeroLineCoordinate; } /************************************************************************************************** * Sets the screen coordinate of the zero line. This will not always be the same as the origin * as not all charts start at zero. * * @param value the screen pixel location of the zero line. ***************************************************************************************************/ public void setZeroLineCoordinate( float value ) { this.zeroLineCoordinate = value; } /************************************************************************************************* * Computes the relationship of data point values to pixel values so know where along the axis * a value is. * * @param scalePixelLength * @param increment **************************************************************************************************/ public void computeOneUnitPixelSize( float scalePixelLength, double increment ) { this.oneUnitPixelSize = scalePixelLength / increment; } } jcharts-0.7.5/src/org/jCharts/axisChart/axis/DataAxis.java0000644000175000001440000004140407751071402022427 0ustar onkarusers/*********************************************************************************************** * File: DataAxis - derived from YAxis.java * Last Modified: $Id: DataAxis.java,v 1.4 2003/03/09 22:42:10 nathaniel_auvil Exp $ * Copyright (C) 2000 * Author: John Thomsen * Contributor(s): * * Copyright 2002 (C) Nathaniel G. Auvil. All Rights Reserved. * * Redistribution and use of this software and associated documentation * ("Software"), with or without modification, are permitted provided * that the following conditions are met: * * 1. Redistributions of source code must retain copyright * statements and notices. Redistributions must also contain a * copy of this document. * * 2. Redistributions in binary form must reproduce the * above copyright notice, this list of conditions and the * following disclaimer in the documentation and/or other * materials provided with the distribution. * * 3. The name "jCharts" or "Nathaniel G. Auvil" must not be used to * endorse or promote products derived from this Software without * prior written permission of Nathaniel G. Auvil. For written * permission, please contact nathaniel_auvil@users.sourceforge.net * * 4. Products derived from this Software may not be called "jCharts" * nor may "jCharts" appear in their names without prior written * permission of Nathaniel G. Auvil. jCharts is a registered * trademark of Nathaniel G. Auvil. * * 5. Due credit should be given to the jCharts Project * (http://jcharts.sourceforge.net/). * * THIS SOFTWARE IS PROVIDED BY Nathaniel G. Auvil AND CONTRIBUTORS * ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT * NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL * jCharts OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED * OF THE POSSIBILITY OF SUCH DAMAGE. ************************************************************************************************/ package org.jCharts.axisChart.axis; import org.jCharts.chartData.interfaces.IDataSeries; import org.jCharts.chartData.processors.AxisChartDataProcessor; import org.jCharts.test.HTMLGenerator; import org.jCharts.test.HTMLTestable; import org.jCharts.axisChart.AxisChart; import java.awt.*; /**** * * @deprecated just using the YAxis Object */ public class DataAxis extends Axis implements HTMLTestable { //---these values are not the same as the data set min and max; //---these are what is displayed on screen which includes padding. private double minValue; private double maxValue; //---Difference between the points on the axis. //---ie-> if 10 and the origin was 0, the values would be 0,10,20,30,etc... private double increment; //---multiplication value used to determine the coordinate location of values on YAxis //private double oneUnitPixelSize; //---not always equal to the origin as charts may not start at zero. protected float zeroLineCoordinate; /***** * * @param axisChart * @deprecated this class is no longer used */ public DataAxis( AxisChart axisChart ) { super( axisChart, 0 ); } protected boolean amDataAxis() { return true; } protected boolean amLabelAxis() { return false; } /************************************************************************************************* * Add all text labels to be display on this axis. * **************************************************************************************************/ public void addTextTags() { /* NumberFormat numberFormat; AxisProperties axisProperties = super.getAxisChart().getAxisProperties(); Font font = axisProperties.getScaleFont(); Font derivedFont = null; if( super.getVerticalScaleFlag() ) { derivedFont = font.deriveFont( Axis.VERTICAL_LABEL_ROTATION ); } this.textTagGroup = new TextTagGroup( font, derivedFont, axisProperties.getScaleFontColor(), super.getAxisChart().getGraphics2D().getFontRenderContext() ); super.setNumberOfLabelsOnAxis( super.getAxisChart().getAxisProperties().getDataAxisNumItems() ); if( showText() == false ) return; double value = this.minValue; //---DOLLAR SIGNS if( axisProperties.getDataAxisUseDollarSigns() ) { numberFormat = NumberFormat.getCurrencyInstance(); } else { numberFormat = NumberFormat.getInstance(); } //---COMMAS if( axisProperties.getDataAxisUseCommas() ) { numberFormat.setGroupingUsed( true ); } else { numberFormat.setGroupingUsed( false ); } //---TRIM OFF DECIMAL PLACES IF ROUND TO WHOLE NUMBER if( axisProperties.getDataAxisRoundValuesToNearest() >= 0 ) { numberFormat.setMaximumFractionDigits( 0 ); numberFormat.setMinimumFractionDigits( 0 ); } else { numberFormat.setMaximumFractionDigits( -axisProperties.getDataAxisRoundValuesToNearest() ); numberFormat.setMinimumFractionDigits( -axisProperties.getDataAxisRoundValuesToNearest() ); } //LOOP for( int i = 0; i <= super.getAxisChart().getAxisProperties().getDataAxisNumItems(); i++ ) { textTagGroup.addTextTag( numberFormat.format( value ) ); value += this.increment; } super.setWidestLabel( textTagGroup.getWidestTextTag() ); super.setTallestLabel( textTagGroup.getTallestTextTag() ); */ } /******************************************************************************************* * Calculates the axis scale increment. * * If the user does not specify a scale, it is auto computed in the followin way: *
  • if all values are positive, the MIN value will be zero.
  • *
  • if all values are negative, the MAX value will be zero.
  • *
  • Padding is done by either adding or subtracting the increment by the rounding power of ten * specified in the properties.
  • * * @param axisChartDataProcessor need to get the min/max ********************************************************************************************/ void computeScaleIncrement( AxisChartDataProcessor axisChartDataProcessor ) { /* AxisProperties axisProperties = super.getAxisChart().getAxisProperties(); int numScaleItems = axisProperties.getDataAxisNumItems(); double powerOfTen = Math.pow( 10.0d, Math.abs( (double) super.getAxisChart().getAxisProperties().getDataAxisRoundValuesToNearest() ) ); if( axisProperties.hasUserDefinedScale() ) { this.increment = this.round( axisProperties.getUserDefinedDataAxisIncrement(), powerOfTen ); //---if we round this down to zero, force it to the power of ten. //---for example, round to nearest 100, value = 35...would push down to 0 which is illegal. if( this.increment == 0 ) { this.increment = powerOfTen; } this.minValue = this.round( axisProperties.getUserDefinedDataAxisMinimum(), powerOfTen ); this.maxValue = this.minValue + ( this.increment * numScaleItems ); } //---else, we will determine the axis scale to use else { double range; //---if MIN >= 0, MAX is the range, if MAX < 0, -MIN is the range if( ( axisChartDataProcessor.getMinValue() >= 0 ) || ( axisChartDataProcessor.getMaxValue() < 0 ) ) { range = Math.max( axisChartDataProcessor.getMaxValue(), -axisChartDataProcessor.getMinValue() ); this.increment = range / numScaleItems; this.roundTheIncrement( powerOfTen ); if( axisChartDataProcessor.getMinValue() >= 0 ) { this.minValue = 0.0d; this.maxValue = this.increment * numScaleItems; } else { this.maxValue = 0.0d; this.minValue = -( this.increment * numScaleItems ); } // data is the double[][] with the chart values. getMax just finds the largest point anywhere in the array. double yMax = this.maxValue; double yMin = this.minValue; // In the following line, note that Math.log is actually Natural Logarithm. // log base a of b = ln b / ln a => log base 10 of x = ln 10 / ln x //double yDelta = Math.pow( 10.0, Math.round( Math.log( yMax - yMin ) / Math.log( 10 ) ) ); double yDelta = Math.pow( 10.0, Math.round( Math.log( range ) / Math.log( 10 ) ) ); double yStart = yMin - ( yMin % yDelta ); double yEnd = yMax - ( yMax % yDelta ) + yDelta; // Count the number of segments this gives us. Shoot for 20 segments or so. int segments = (int) ( ( yEnd - yStart ) / yDelta ); if( segments <= 2 ) { // we need 10 times this many yDelta = yDelta / 10.0; } else if( segments <= 5 ) { // we need 4 times this many yDelta = yDelta / 4.0; } else if( segments <= 10 ) { yDelta = yDelta / 2.0; } // Recalc start and end to match with new delta. yStart = yMin - ( yMin % yDelta ); yEnd = yMax - ( yMax % yDelta ) + yDelta; segments = (int) ( ( yEnd - yStart ) / yDelta ); //axisProperties = new AxisProperties(yStart, yDelta); //axisProperties.setYAxisNumItems(segments); this.increment= yDelta; } //---else MIN is negative and MAX is positive, so add values together (minus a negative is a positive) else { this.minValue = this.round( axisChartDataProcessor.getMinValue(), powerOfTen ); //---round min value down to get the start value for axis. Compute range from this value. if( super.getAxisChart().getAxisProperties().getDataAxisRoundValuesToNearest() > 0 ) { this.minValue -= powerOfTen; } else { this.minValue -= ( 1 / powerOfTen ); } //---we want the rounded Axis min for range //---MIN is always negative at this point so minus a negative is a positive range = axisChartDataProcessor.getMaxValue() - this.minValue; this.increment = range / numScaleItems; this.roundTheIncrement( powerOfTen ); //---axis starts at minValue, not zero! this.maxValue = this.minValue + ( this.increment * numScaleItems ); } } */ } /*********************************************************************************************** * Rounds the scale increment up by the power of ten specified in the properties. * * @param value the value to round * @param powerOfTen the product of 10 times the rounding property. * @return double the rounded result ************************************************************************************************/ private double round( double value, double powerOfTen ) { /* if( super.getAxisChart().getAxisProperties().getDataAxisRoundValuesToNearest() > 0 ) { return ( Math.round( value / powerOfTen ) * powerOfTen ); } else if( super.getAxisChart().getAxisProperties().getDataAxisRoundValuesToNearest() < 0 ) { return ( Math.round( value * powerOfTen ) / powerOfTen ); } else { return ( Math.round( value ) ); } */ return 0; } /*********************************************************************************************** * Rounds the scale increment up by the power of ten specified in the properties. * * @param powerOfTen the value of 10 times the rounding property. ************************************************************************************************/ private void roundTheIncrement( double powerOfTen ) { /* this.increment = this.round( this.increment, powerOfTen ); //---round the increment up if( super.getAxisChart().getAxisProperties().getDataAxisRoundValuesToNearest() > 0 ) { this.increment += powerOfTen; } else { this.increment += ( 1 / powerOfTen ); } */ } /************************************************************************************************** * Returns the screen coordinate of the zero line. This will not always be the same as the origin * as not all charts start at zero. * * @return float the screen pixel location of the zero line. ***************************************************************************************************/ public float getZeroLineCoordinate() { return this.zeroLineCoordinate; } /************************************************************************************************* * Takes a value and determines the screen coordinate it should be drawn at. * * @param value * @return float the screen pixel coordinate **************************************************************************************************/ float computeAxisCoordinate( double value ) { /* double returnValue; if( amHorizontal() == false ) { returnValue = super.getOrigin() - ( value - this.getMinValue() ) * this.getOneUnitPixelSize(); } else { returnValue = super.getOrigin() + ( value - this.getMinValue() ) * this.getOneUnitPixelSize(); } */ /* -- Debug for various settings.. System.out.println("Pix:"+this.getOneUnitPixelSize()); System.out.println("origin:"+super.getOrigin()); System.out.println("Ret"+returnValue); */ // return (float) returnValue; return 0; } /************************************************************************************************** * Returns the MAX value plotted by the axis. * * @return double the MAX value plotted by the axis ***************************************************************************************************/ public double getMaxValue() { return this.maxValue; } /************************************************************************************************** * Returns the MIN value plotted by the axis. * * @return double the MIN value plotted by the axis ***************************************************************************************************/ public double getMinValue() { return this.minValue; } /************************************************************************************************** * Returns the number of pixels one value unit occupies. * * @return double the number of pixels one value unit occupies. ***************************************************************************************************/ public double getOneUnitPixelSize() { /* -- Debug for various settings System.out.println("inc:"+this.increment); System.out.println("Scale:"+this.getScalePixelLength()); */ //return ( super.getScalePixelLength() / this.increment ); return 0; // return this.oneUnitPixelSize; // Old code } /********************************************************************************************* * Renders the DataAxis on the passes Graphics2D object * * @param graphics2D * @param iDataSeries **********************************************************************************************/ protected void render( Graphics2D graphics2D, IDataSeries iDataSeries ) { /* super.render( graphics2D, iDataSeries ); Line2D.Float line2D = new Line2D.Float(); if( amHorizontal() ) { line2D = super.getAxisChart().getVerticalAxis().getAxisLine( line2D ); } else { line2D = super.getAxisChart().getHorizontalAxis().getAxisLine( line2D ); } float offset = super.getScalePixelLength(); offset *= (float) -this.minValue; offset /= (float) this.increment; offset = ( amHorizontal() ) ? offset : -offset; float start = ( amHorizontal() ) ? line2D.x1 : line2D.y1; //---need this regardless if draw line or not. this.zeroLineCoordinate = start + offset; // System.out.println("Zero Line:"+zeroLineCoordinate); //---ZERO LINE if( super.getAxisChart().getAxisProperties().getShowZeroLine() && this.minValue < 0.0d && this.maxValue > 0.0d ) { if( amHorizontal() ) { line2D.x1 = this.zeroLineCoordinate; line2D.x2 = line2D.x1; } else { line2D.y1 = this.zeroLineCoordinate; line2D.y2 = line2D.y1; } graphics2D.setStroke( super.getAxisChart().getAxisProperties().getZeroLineStroke() ); graphics2D.setPaint( super.getAxisChart().getAxisProperties().getZeroLinePaint() ); graphics2D.draw( line2D ); } */ } /********************************************************************************************* * Enables the testing routines to display the contents of this Object. * * @param htmlGenerator **********************************************************************************************/ public void toHTML( HTMLGenerator htmlGenerator ) { super.toHTML( htmlGenerator ); } } jcharts-0.7.5/src/org/jCharts/axisChart/axis/LabelAxis.java0000644000175000001440000001214107751071402022571 0ustar onkarusers/*********************************************************************************************** * File Info: $Id: LabelAxis.java,v 1.5 2003/03/09 22:42:10 nathaniel_auvil Exp $ * Copyright (C) 2002 * Author: Nathaniel G. Auvil * Contributor(s): * * Copyright 2002 (C) Nathaniel G. Auvil. All Rights Reserved. * * Redistribution and use of this software and associated documentation ("Software"), with or * without modification, are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain copyright statements and notices. * Redistributions must also contain a copy of this document. * * 2. Redistributions in binary form must reproduce the above copyright notice, this list of * conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. * * 3. The name "jCharts" or "Nathaniel G. Auvil" must not be used to endorse or promote * products derived from this Software without prior written permission of Nathaniel G. * Auvil. For written permission, please contact nathaniel_auvil@users.sourceforge.net * * 4. Products derived from this Software may not be called "jCharts" nor may "jCharts" appear * in their names without prior written permission of Nathaniel G. Auvil. jCharts is a * registered trademark of Nathaniel G. Auvil. * * 5. Due credit should be given to the jCharts Project (http://jcharts.sourceforge.net/). * * THIS SOFTWARE IS PROVIDED BY Nathaniel G. Auvil AND CONTRIBUTORS ``AS IS'' AND ANY * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL * jCharts OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE ************************************************************************************************/ package org.jCharts.axisChart.axis; import org.jCharts.chartData.interfaces.IDataSeries; import org.jCharts.properties.AxisProperties; import org.jCharts.test.HTMLGenerator; import org.jCharts.test.HTMLTestable; import org.jCharts.axisChart.AxisChart; import java.awt.*; /**** * * @deprecated just using the Axis Object */ public class LabelAxis extends Axis implements HTMLTestable { /************************************************************************************************** * * @param axisChart * @deprecated this class is no longer used ***************************************************************************************************/ public LabelAxis( AxisChart axisChart ) { super( axisChart, 0 ); } protected boolean amDataAxis() { return false; } protected boolean amLabelAxis() { return true; } /************************************************************************************************* * Add the scale labels. * **************************************************************************************************/ protected void addTextTags() { AxisProperties axisProperties = super.getAxisChart().getAxisProperties(); IDataSeries iDataSeries= (IDataSeries) super.getAxisChart().getIAxisDataSeries(); //Font font = axisProperties.getScaleFont(); Font derivedFont = null; /* if( super.getVerticalScaleFlag() ) { derivedFont = font.deriveFont( Axis.VERTICAL_LABEL_ROTATION ); } this.textTagGroup = new TextTagGroup( font, derivedFont, axisProperties.getScaleFontColor(), super.getAxisChart().getGraphics2D().getFontRenderContext() ); super.setNumberOfLabelsOnAxis( iDataSeries.getNumberOfLabels() ); if( showText() == false ) return; for( int i = 0; i < iDataSeries.getNumberOfLabels(); i++ ) { textTagGroup.addTextTag( iDataSeries.getLabelAxisLabel( i ) ); } */ } /********************************************************************************************* * Renders the axis on the passed Graphics2D object * * @param graphics2D * @param iDataSeries **********************************************************************************************/ protected void render( Graphics2D graphics2D, IDataSeries iDataSeries ) { // super.render( graphics2D, iDataSeries ); } /********************************************************************************************* * Enables the testing routines to display the contents of this Object. * * @param htmlGenerator **********************************************************************************************/ public void toHTML( HTMLGenerator htmlGenerator ) { super.toHTML( htmlGenerator ); } } jcharts-0.7.5/src/org/jCharts/axisChart/axis/XAxis.java0000644000175000001440000004520607751071402021771 0ustar onkarusers/*********************************************************************************************** * File Info: $Id: XAxis.java,v 1.20 2003/10/15 03:23:15 nathaniel_auvil Exp $ * Copyright (C) 2002 * Author: Nathaniel G. Auvil * Contributor(s): John Thomsen * * Copyright 2002 (C) Nathaniel G. Auvil. All Rights Reserved. * * Redistribution and use of this software and associated documentation ("Software"), with or * without modification, are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain copyright statements and notices. * Redistributions must also contain a copy of this document. * * 2. Redistributions in binary form must reproduce the above copyright notice, this list of * conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. * * 3. The name "jCharts" or "Nathaniel G. Auvil" must not be used to endorse or promote * products derived from this Software without prior written permission of Nathaniel G. * Auvil. For written permission, please contact nathaniel_auvil@users.sourceforge.net * * 4. Products derived from this Software may not be called "jCharts" nor may "jCharts" appear * in their names without prior written permission of Nathaniel G. Auvil. jCharts is a * registered trademark of Nathaniel G. Auvil. * * 5. Due credit should be given to the jCharts Project (http://jcharts.sourceforge.net/). * * THIS SOFTWARE IS PROVIDED BY Nathaniel G. Auvil AND CONTRIBUTORS ``AS IS'' AND ANY * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL * jCharts OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE ************************************************************************************************/ package org.jCharts.axisChart.axis; import org.jCharts.axisChart.AxisChart; import org.jCharts.properties.*; import org.jCharts.test.HTMLGenerator; import org.jCharts.test.HTMLTestable; import org.jCharts.chartData.interfaces.IAxisPlotDataSet; import org.jCharts.chartData.interfaces.IAxisDataSeries; import org.jCharts.types.ChartType; import java.awt.*; import java.awt.geom.Line2D; import java.lang.reflect.Field; import java.util.Iterator; public final class XAxis extends Axis implements HTMLTestable { //---indicates which labels to display 1=every, 2=every other, 3=every third, etc... private int xLabelFilter = 1; //---for some charts such as line, point, area, etc... we want to start plot at y-axis private boolean startTicksAtAxis; /************************************************************************************************** * * @param axisChart * @param numberOfScaleItems ***************************************************************************************************/ public XAxis( AxisChart axisChart, int numberOfScaleItems ) { super( axisChart, numberOfScaleItems ); } /************************************************************************************************* * Computes the minimum pixel height required for the X-Axis. * Includes space, if needed, for: axis title + padding, axis values + tick padding, and tick marks. * * @param axisTitle **************************************************************************************************/ public void computeMinimumHeightNeeded( String axisTitle ) { float heightNeeded = 0; AxisProperties axisProperties = super.getAxisChart().getAxisProperties(); AxisTypeProperties axisTypeProperties = axisProperties.getXAxisProperties(); if( axisTypeProperties.showAxisLabels() ) { if( axisProperties.xAxisLabelsAreVertical() ) { //---widest label for vertical labels //heightNeeded = axisChartDataProcessor.getAxisLabelProcessor().getWidestLabel(); heightNeeded = super.getAxisLabelsGroup().getWidestLabel(); } else { //---tallest label for horizontal labels //heightNeeded = axisChartDataProcessor.getAxisLabelProcessor().getTallestLabel(); heightNeeded = super.getAxisLabelsGroup().getTallestLabel(); //---not sure why i need more padding heightNeeded += 3; } } if( axisTypeProperties.getShowTicks() != AxisTypeProperties.TICKS_NONE ) { if( axisTypeProperties.showAxisLabels() ) { //---add the padding between scale labels and tick marks heightNeeded += axisTypeProperties.getPaddingBetweenLabelsAndTicks(); } //---add width of tick marks heightNeeded += axisTypeProperties.getAxisTickMarkPixelLength(); } else { //---use specified distance between labels and axis heightNeeded += axisTypeProperties.getPaddingBetweenAxisAndLabels(); } //---include axis title height if needed. Remember it is vertical for y-axis if( axisTitle != null ) { super.computeAxisTitleDimensions( axisTitle, axisTypeProperties.getTitleChartFont() ); heightNeeded += super.getTitleHeight(); heightNeeded += axisTypeProperties.getPaddingBetweenAxisTitleAndLabels(); } super.setMinimumHeightNeeded( heightNeeded ); } /************************************************************************************************* * Computes the number of pixels between each value on the axis. * ************************************************************************************************** public void computeScalePixelWidth( int numberOfValuesOnXAxis ) { super.setScalePixelWidth( super.getPixelLength() / numberOfValuesOnXAxis ); } /**************************************************************************************************** * * @param axisTitle * @param graphics2D * @param axisTypeProperties ***************************************************************************************************/ private void renderAxisTitle( String axisTitle, Graphics2D graphics2D, AxisTypeProperties axisTypeProperties ) { if( axisTitle != null ) { float titleX; float titleY = super.getAxisChart().getYAxis().getOrigin() + this.getMinimumHeightNeeded() - super.getTitleHeight(); //---if title is larger than the axis itself, place at top. if( super.getTitleWidth() > super.getPixelLength() ) { titleX = ((super.getAxisChart().getImageWidth() - super.getTitleWidth()) / 2); } //---else, center on XAxis. else { titleX = super.getOrigin() + ((super.getPixelLength() - super.getTitleWidth()) / 2); } axisTypeProperties.getAxisTitleChartFont().setupGraphics2D( graphics2D ); graphics2D.drawString( axisTitle, titleX, titleY ); } } /*************************************************************************************** * Determines if we should start x-axis ticks at the y-axis or space it out a half * a scale item width. * * @param iAxisDataSeries * @param axisTypeProperties **************************************************************************************/ public void computeShouldTickStartAtYAxis( IAxisDataSeries iAxisDataSeries, AxisTypeProperties axisTypeProperties ) { //---if horizontal plot, x-axis is the data axis, so always start data points at y-axis if( axisTypeProperties instanceof DataAxisProperties ) { this.startTicksAtAxis= true; } else { this.startTicksAtAxis= true; //---else, there are a couple of plots we do not start x-axis values at the y-axis IAxisPlotDataSet iAxisPlotDataSet; Iterator iterator= iAxisDataSeries.getIAxisPlotDataSetIterator(); while( iterator.hasNext() ) { iAxisPlotDataSet= (IAxisPlotDataSet) iterator.next(); if( iAxisPlotDataSet.getChartType().equals( ChartType.BAR ) || iAxisPlotDataSet.getChartType().equals( ChartType.BAR_CLUSTERED ) || iAxisPlotDataSet.getChartType().equals( ChartType.BAR_STACKED ) || iAxisPlotDataSet.getChartType().equals( ChartType.LINE ) || iAxisPlotDataSet.getChartType().equals( ChartType.POINT ) || iAxisPlotDataSet.getChartType().equals( ChartType.STOCK ) ) { this.startTicksAtAxis= false; break; } } } } /*************************************************************************************** * Computes the screen pixel location of the first tick mark * **************************************************************************************/ public void computeTickStart() { float tickStart= super.getOrigin(); if( ! this.startTicksAtAxis ) { tickStart+= (super.getScalePixelWidth() / 2); } super.setTickStart( tickStart ); } /************************************************************************************************* * Computes the number of pixels between each value on the axis. * **************************************************************************************************/ public void computeScalePixelWidth() { if( this.startTicksAtAxis ) { super.computeScalePixelWidthDataAxis(); } else { super.setScalePixelWidth( getPixelLength() / this.getNumberOfScaleItems() ); } } /********************************************************************************************* * Renders the YAxis on the passes Graphics2D object * * @param graphics2D * @param axisProperties * @param axisTitle **********************************************************************************************/ public void render( Graphics2D graphics2D, AxisProperties axisProperties, String axisTitle ) { AxisTypeProperties axisTypeProperties = axisProperties.getXAxisProperties(); //---AXIS TITLE this.renderAxisTitle( axisTitle, graphics2D, axisTypeProperties ); Line2D.Float line2D = new Line2D.Float( super.getTickStart(), 0.0f, super.getTickStart(), 0.0f ); float tickY1 = super.getAxisChart().getYAxis().getOrigin(); float tickY2 = super.getAxisChart().getYAxis().getOrigin() + axisTypeProperties.getAxisTickMarkPixelLength(); float gridLineY1 = super.getAxisChart().getYAxis().getOrigin(); float gridLineY2 = super.getAxisChart().getYAxis().getOrigin() - super.getAxisChart().getYAxis().getPixelLength(); float stringX = super.getTickStart(); float stringY = super.getAxisChart().getYAxis().getOrigin(); if( axisTypeProperties.getShowTicks() != AxisTypeProperties.TICKS_NONE ) { stringY += axisTypeProperties.getAxisTickMarkPixelLength() + axisTypeProperties.getPaddingBetweenLabelsAndTicks(); } else { stringY += axisTypeProperties.getPaddingBetweenAxisAndLabels(); } if( axisTypeProperties.showAxisLabels() ) { //---if the scale labels are horizontal, simply add the tallest label height. //---Otherwise we will have to calculate it when we draw the label if( !axisProperties.xAxisLabelsAreVertical() ) { stringY += super.getAxisLabelsGroup().getTallestLabel(); graphics2D.setFont( axisTypeProperties.getScaleChartFont().getFont() ); } else { stringX -= super.getAxisLabelsGroup().getTextTag( 0 ).getFontDescent(); graphics2D.setFont( axisTypeProperties.getScaleChartFont().deriveFont() ); } } //LOOP //for( int i = 0; i < super.getAxisLabelsGroup().size(); i++ ) for( int i = 0; i < super.getNumberOfScaleItems(); i++ ) { //---GRID LINES if( axisTypeProperties.getShowGridLines() != AxisTypeProperties.GRID_LINES_NONE ) { if( ( i == 0 && !( axisTypeProperties instanceof DataAxisProperties ) ) || ( i > 0 && ( (axisTypeProperties.getShowGridLines() == AxisTypeProperties.GRID_LINES_ALL) || (axisTypeProperties.getShowGridLines() == AxisTypeProperties.GRID_LINES_ONLY_WITH_LABELS && (i % this.xLabelFilter == 0)) ) ) ) { line2D.y1 = gridLineY1; line2D.y2 = gridLineY2; if( i < super.getAxisLabelsGroup().size() || (i == super.getAxisLabelsGroup().size() && !axisTypeProperties.getShowEndBorder()) ) { axisTypeProperties.getGridLineChartStroke().draw( graphics2D, line2D ); } } } //---TICK MARKS //if( i != super.getAxisLabelsGroup().size() ) if( i != super.getNumberOfScaleItems() ) { if( (axisTypeProperties.getShowTicks() == AxisTypeProperties.TICKS_ALL) || (axisTypeProperties.getShowTicks() == AxisTypeProperties.TICKS_ONLY_WITH_LABELS && (i % this.xLabelFilter == 0)) ) { line2D.y1 = tickY1; line2D.y2 = tickY2; axisTypeProperties.getTickChartStroke().setupGraphics2D( graphics2D ); graphics2D.draw( line2D ); } } line2D.x1 += super.getScalePixelWidth(); line2D.x2 = line2D.x1; //---AXIS LABEL if( axisTypeProperties.showAxisLabels() && (i % this.xLabelFilter == 0) ) { graphics2D.setPaint( axisTypeProperties.getScaleChartFont().getPaint() ); if( !axisProperties.xAxisLabelsAreVertical() ) { //graphics2D.drawString( iDataSeries.getXAxisLabel( i ), stringX - super.getAxisLabelsGroup().getTextTag( i ).getWidth() / 2, stringY ); float x = stringX - super.getAxisLabelsGroup().getTextTag( i ).getWidth() / 2; //---we can not only look at the last label as there could be a filter and labels near the last might go off the edge of the screen. if( x + super.getAxisLabelsGroup().getTextTag( i ).getWidth() < super.getAxisChart().getImageWidth() ) { super.getAxisLabelsGroup().getTextTag( i ).render( graphics2D, x, stringY ); } } else { float x = stringX + super.getAxisLabelsGroup().getTextTag( i ).getHeight() / 2; //---we can not only look at the last label as there could be a filter and labels near the last might go off the edge of the screen. if( x + super.getAxisLabelsGroup().getTextTag( i ).getHeight() < super.getAxisChart().getImageWidth() ) { graphics2D.drawString( super.getAxisLabelsGroup().getTextTag( i ).getText(), x, stringY + super.getAxisLabelsGroup().getTextTag( i ).getWidth() ); } } } stringX += super.getScalePixelWidth(); } //---RIGHT BORDER----------------------------------------------------------- if( axisTypeProperties.getShowEndBorder() ) { //---make sure no rounding errors line2D.x1 = super.getOrigin() + super.getPixelLength() + 1; line2D.x2 = line2D.x1; line2D.y1 = gridLineY1; line2D.y2 = gridLineY2; axisProperties.getYAxisProperties().getAxisStroke().draw( graphics2D, line2D ); } //---AXIS------------------------------------------------------------------- line2D.x1 = super.getOrigin(); line2D.x2 = super.getOrigin() + super.getPixelLength(); line2D.y1 = super.getAxisChart().getYAxis().getOrigin(); line2D.y2 = line2D.y1; axisTypeProperties.getAxisStroke().setupGraphics2D( graphics2D ); graphics2D.draw( line2D ); //---ZERO LINE----------------------------------------------------------------- if( axisTypeProperties instanceof DataAxisProperties ) { DataAxisProperties dataAxisProperties = (DataAxisProperties) axisTypeProperties; if( dataAxisProperties.showZeroLine() && super.getScaleCalculator().getMinValue() < 0.0d && super.getScaleCalculator().getMaxValue() > 0.0d ) { line2D.x1 = super.getZeroLineCoordinate(); line2D.x2 = line2D.x1; line2D.y1 = super.getAxisChart().getYAxis().getOrigin(); line2D.y2 = super.getAxisChart().getYAxis().getOrigin() - super.getAxisChart().getYAxis().getPixelLength(); dataAxisProperties.getZeroLineChartStroke().draw( graphics2D, line2D ); } } } /************************************************************************************************ * Method to compute the filter to use on the x-axis label display so labels do not overlap * *************************************************************************************************/ public void computeLabelFilter() { if( super.getAxisChart().getAxisProperties().getXAxisProperties().showAxisLabels() ) { float widestLabelSize; AxisTypeProperties axisTypeProperties = super.getAxisChart().getAxisProperties().getXAxisProperties(); if( super.getAxisChart().getAxisProperties().xAxisLabelsAreVertical() ) { widestLabelSize = super.getAxisLabelsGroup().getTallestLabel(); } else { widestLabelSize = super.getAxisLabelsGroup().getWidestLabel(); } double numberLabelsCanDisplay = this.getPixelLength() / (widestLabelSize + axisTypeProperties.getPaddingBetweenAxisLabels()); this.xLabelFilter = (int) Math.ceil( super.getAxisLabelsGroup().size() / numberLabelsCanDisplay ); } else { this.xLabelFilter= 1; } } /********************************************************************************************* * Enables the testing routines to display the contents of this Object. * * @param htmlGenerator **********************************************************************************************/ public void toHTML( HTMLGenerator htmlGenerator ) { htmlGenerator.propertiesTableStart( this.getClass().getName() ); super.toHTML( htmlGenerator ); Field[] fields = this.getClass().getDeclaredFields(); for( int i = 0; i < fields.length; i++ ) { try { htmlGenerator.addField( fields[ i ].getName(), fields[ i ].get( this ) ); } catch( IllegalAccessException illegalAccessException ) { illegalAccessException.printStackTrace(); } } htmlGenerator.propertiesTableEnd(); } /************************************************************************************************* * Takes a value and determines the screen coordinate it should be drawn at. THe only difference * between this and the y-axis is we add to the origin versus subtract from it. * * @param origin * @param value * @param axisMinValue the minimum value on the axis * @return float the screen pixel coordinate **************************************************************************************************/ public float computeAxisCoordinate( float origin, double value, double axisMinValue ) { double returnValue = origin + (value - axisMinValue) * this.getOneUnitPixelSize(); //System.out.println( "computeAxisCoordinate( " + origin + ", " + value + ", " + axisMinValue + " ) = " + returnValue ); return (float) returnValue; } } jcharts-0.7.5/src/org/jCharts/axisChart/axis/YAxis.java0000644000175000001440000003334307751071402021771 0ustar onkarusers/*********************************************************************************************** * File Info: $Id: YAxis.java,v 1.24 2003/06/29 13:28:37 nathaniel_auvil Exp $ * Copyright (C) 2002 * Author: Nathaniel G. Auvil * Contributor(s): John Thomsen * * Copyright 2002 (C) Nathaniel G. Auvil. All Rights Reserved. * * Redistribution and use of this software and associated documentation ("Software"), with or * without modification, are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain copyright statements and notices. * Redistributions must also contain a copy of this document. * * 2. Redistributions in binary form must reproduce the above copyright notice, this list of * conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. * * 3. The name "jCharts" or "Nathaniel G. Auvil" must not be used to endorse or promote * products derived from this Software without prior written permission of Nathaniel G. * Auvil. For written permission, please contact nathaniel_auvil@users.sourceforge.net * * 4. Products derived from this Software may not be called "jCharts" nor may "jCharts" appear * in their names without prior written permission of Nathaniel G. Auvil. jCharts is a * registered trademark of Nathaniel G. Auvil. * * 5. Due credit should be given to the jCharts Project (http://jcharts.sourceforge.net/). * * THIS SOFTWARE IS PROVIDED BY Nathaniel G. Auvil AND CONTRIBUTORS ``AS IS'' AND ANY * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL * jCharts OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE ************************************************************************************************/ package org.jCharts.axisChart.axis; import org.jCharts.axisChart.AxisChart; import org.jCharts.properties.*; import org.jCharts.properties.util.ChartFont; import org.jCharts.test.HTMLGenerator; import org.jCharts.test.HTMLTestable; import java.awt.*; import java.awt.geom.Line2D; import java.lang.reflect.Field; public final class YAxis extends Axis implements HTMLTestable { private float lastTickY; /************************************************************************************************** * Constructor * * @param axisChart ***************************************************************************************************/ public YAxis( AxisChart axisChart, int numberOfScaleItems ) { super( axisChart, numberOfScaleItems ); } /************************************************************************************ * Need this value as horizontal plots start from the top of the axis and go down * * @return ************************************************************************************/ public float getLastTickY() { return lastTickY; } /************************************************************************************************* * Computes the minimum pixel width required for the Y-Axis. * Includes space, if needed, for: axis title + padding, axis values + tick padding, and tick marks. * **************************************************************************************************/ public void computeMinimumWidthNeeded( String yAxisTitle ) { AxisTypeProperties axisTypeProperties= super.getAxisChart().getAxisProperties().getYAxisProperties(); float widthNeeded = 0; //---if we are displaying axis scale labels, add width of widest label if( axisTypeProperties.showAxisLabels() ) { widthNeeded+= super.getAxisLabelsGroup().getWidestLabel(); } if( axisTypeProperties.getShowTicks() != AxisTypeProperties.TICKS_NONE ) { //---add the padding between scale labels and tick marks widthNeeded += axisTypeProperties.getPaddingBetweenLabelsAndTicks(); //---add width of tick marks widthNeeded += axisTypeProperties.getAxisTickMarkPixelLength(); } else { //---else, if we are not showing any ticks, add padding between labels and axis, if we are displaying labels if( axisTypeProperties.showAxisLabels() ) { widthNeeded += axisTypeProperties.getPaddingBetweenAxisAndLabels(); } } //---include axis title height if needed. Remember it is vertical for y-axis //if( super.getAxisChart().getAxisProperties().getShowAxisTitle( AxisProperties.Y_AXIS ) ) if( yAxisTitle != null ) { super.computeAxisTitleDimensions( yAxisTitle, axisTypeProperties.getTitleChartFont() ); widthNeeded += super.getTitleHeight(); widthNeeded += axisTypeProperties.getPaddingBetweenAxisTitleAndLabels(); } super.setMinimumWidthNeeded( widthNeeded ); } /**************************************************************************************************** * * @param axisTitle * @param graphics2D * @param axisTypeProperties ***************************************************************************************************/ private void renderAxisTitle( String axisTitle, Graphics2D graphics2D, AxisTypeProperties axisTypeProperties ) { if( axisTitle != null ) { float titleY; // = super.getAxisChart().getChartProperties().getEdgePadding(); float titleX = super.getAxisChart().getXAxis().getOrigin() - super.getMinimumWidthNeeded() + super.getTitleHeight(); //---if YAxis title is larger than the YAxis itself, center it on image. if( super.getTitleWidth() > super.getPixelLength() ) { //titleY= super.getTitleWidth(); titleY= super.getAxisChart().getImageHeight() - ( ( super.getAxisChart().getImageHeight() - super.getTitleWidth() ) / 2 ); } //---else, center on YAxis. else { titleY = this.getOrigin() - ( ( super.getPixelLength() - super.getTitleWidth() ) / 2 ); } //TODO this should use a TextTag graphics2D.setFont( axisTypeProperties.getAxisTitleChartFont().getFont().deriveFont( ChartFont.VERTICAL_ROTATION ) ); graphics2D.setPaint( axisTypeProperties.getAxisTitleChartFont().getPaint() ); graphics2D.drawString( axisTitle, titleX, titleY ); } } /********************************************************************************************* * Renders the YAxis on the passes Graphics2D object * * @param graphics2D * @param axisProperties * @param yAxisTitle **********************************************************************************************/ public void render( Graphics2D graphics2D, AxisProperties axisProperties, String yAxisTitle ) { AxisTypeProperties axisTypeProperties = axisProperties.getYAxisProperties(); //---AXIS TITLE this.renderAxisTitle( yAxisTitle, graphics2D, axisProperties.getYAxisProperties() ); Line2D.Float line2D; float stringY= 0; if( axisTypeProperties instanceof DataAxisProperties ) { //---start at the axis line2D = new Line2D.Float( 0.0f, super.getOrigin(), 0.0f, super.getOrigin() ); if( axisTypeProperties.showAxisLabels() ) { stringY = super.getOrigin() + ( super.getAxisLabelsGroup().getTallestLabel() / 4 ); } } else { //--start at half a axis item width float y = super.getOrigin() - ( super.getScalePixelWidth() / 2 ); line2D = new Line2D.Float( 0.0f, y, 0.0f, y ); if( axisTypeProperties.showAxisLabels() ) { stringY = y + ( super.getAxisLabelsGroup().getTallestLabel() / 4 ); //---horizontal plots start at top of axis and go down super.getAxisLabelsGroup().reverse(); } } float tickX1 = super.getAxisChart().getXAxis().getOrigin() - axisTypeProperties.getAxisTickMarkPixelLength(); float tickX2 = super.getAxisChart().getXAxis().getOrigin(); float gridLineX1 = super.getAxisChart().getXAxis().getOrigin() + 1; float gridLineX2 = super.getAxisChart().getXAxis().getOrigin() + super.getAxisChart().getXAxis().getPixelLength(); float stringX = super.getAxisChart().getXAxis().getOrigin() - axisTypeProperties.getAxisTickMarkPixelLength(); if( axisTypeProperties.showAxisLabels() ) { stringX-= axisTypeProperties.getPaddingBetweenLabelsAndTicks(); } for( int i = 0; i < super.getNumberOfScaleItems(); i++ ) { //---GRID LINES if( axisTypeProperties.getShowGridLines() != AxisTypeProperties.GRID_LINES_NONE ) { //---we do not want to draw a grid line over the axis as data axis first value is on the axis if( i > 0 || ( i == 0 && !( axisTypeProperties instanceof DataAxisProperties ) ) ) { line2D.x1 = gridLineX1; line2D.x2 = gridLineX2; //TODO what is this doing???? How could i ever equal the size? if( i < super.getAxisLabelsGroup().size() || ( i == super.getAxisLabelsGroup().size() && !axisTypeProperties.getShowEndBorder() ) ) // if( i == super.getNumberOfScaleItems() - 1 && !axisTypeProperties.getShowEndBorder() ) { axisTypeProperties.getGridLineChartStroke().draw( graphics2D, line2D ); } else { //---draw top border with the same ChartStroke as the X-Axis axisProperties.getXAxisProperties().getAxisStroke().draw( graphics2D, line2D ); } } } //---TICK MARKS if( axisTypeProperties.getShowTicks() != AxisTypeProperties.TICKS_NONE ) { line2D.x1 = tickX1; line2D.x2 = tickX2; axisTypeProperties.getTickChartStroke().draw( graphics2D, line2D ); } //---need this value as horizontal plots start from the top of the axis and go down //---must set this no matter if no ticks are present as horizontal plots start their rendering based on this screen coordinate. this.lastTickY= line2D.y1; line2D.y1 -= super.getScalePixelWidth(); line2D.y2 = line2D.y1; //---AXIS LABEL if( axisTypeProperties.showAxisLabels() ) { super.getAxisLabelsGroup().render( i, graphics2D, stringX - super.getAxisLabelsGroup().getTextTag( i ).getWidth(), stringY ); //graphics2D.setPaint( axisProperties.getScaleFontColor() ); //graphics2D.drawString( this.formattedLabels[ i ], stringX - this.labelWidths[ i ], stringY ); } stringY -= super.getScalePixelWidth(); } //---AXIS---------------------------------------------------------------------- line2D.x1 = super.getAxisChart().getXAxis().getOrigin(); line2D.x2 = line2D.x1; line2D.y1 = super.getOrigin() - super.getPixelLength(); line2D.y2 = super.getOrigin(); axisTypeProperties.getAxisStroke().draw( graphics2D, line2D ); //---TOP BORDER---------------------------------------------------------------- if( axisTypeProperties.getShowEndBorder() ) { line2D.x1 = super.getAxisChart().getXAxis().getOrigin(); line2D.x2 = super.getAxisChart().getXAxis().getOrigin() + super.getAxisChart().getXAxis().getPixelLength(); line2D.y1 = super.getOrigin() - super.getPixelLength(); line2D.y2 = line2D.y1; axisProperties.getXAxisProperties().getAxisStroke().draw( graphics2D, line2D ); } //---ZERO LINE----------------------------------------------------------------- if( axisTypeProperties instanceof DataAxisProperties ) { DataAxisProperties dataAxisProperties = ( DataAxisProperties ) axisTypeProperties; if( dataAxisProperties.showZeroLine() && super.getScaleCalculator().getMinValue() < 0.0d && super.getScaleCalculator().getMaxValue() > 0.0d ) { line2D.y1 = super.getZeroLineCoordinate(); line2D.y2 = line2D.y1; line2D.x1 = super.getAxisChart().getXAxis().getOrigin(); line2D.x2 = super.getAxisChart().getXAxis().getOrigin() + super.getAxisChart().getXAxis().getPixelLength(); dataAxisProperties.getZeroLineChartStroke().draw( graphics2D, line2D ); } } } /************************************************************************************************* * Takes a value and determines the screen coordinate it should be drawn at. THe only difference * between this and the x-axis is we subtract to the origin versus subtract from it. * * @param origin * @param value * @param axisMinValue the minimum value on the axis * @return float the screen pixel coordinate **************************************************************************************************/ public float computeAxisCoordinate( float origin, double value, double axisMinValue ) { double returnValue = origin - ( value - axisMinValue ) * this.getOneUnitPixelSize(); return ( float ) returnValue; } /********************************************************************************************* * Enables the testing routines to display the contents of this Object. * * @param htmlGenerator **********************************************************************************************/ //todo is this method needed? public void toHTML( HTMLGenerator htmlGenerator ) { htmlGenerator.propertiesTableStart( this.getClass().getName() ); super.toHTML( htmlGenerator ); Field[] fields = this.getClass().getDeclaredFields(); for( int i = 0; i < fields.length; i++ ) { try { htmlGenerator.addField( fields[ i ].getName(), fields[ i ].get( this ) ); } catch( IllegalAccessException illegalAccessException ) { illegalAccessException.printStackTrace(); } } htmlGenerator.propertiesTableEnd(); } } jcharts-0.7.5/src/org/jCharts/axisChart/customRenderers/0000755000175000001440000000000007751071402022303 5ustar onkarusersjcharts-0.7.5/src/org/jCharts/axisChart/customRenderers/axisValue/0000755000175000001440000000000007751071402024244 5ustar onkarusersjcharts-0.7.5/src/org/jCharts/axisChart/customRenderers/axisValue/renderers/0000755000175000001440000000000007751071402026235 5ustar onkarusersjcharts-0.7.5/src/org/jCharts/axisChart/customRenderers/axisValue/renderers/BackgroundRenderer.java0000644000175000001440000001001507751071402032643 0ustar onkarusers/*********************************************************************************************** * File Info: $Id: BackgroundRenderer.java,v 1.2 2003/03/06 02:26:25 nathaniel_auvil Exp $ * Copyright (C) 2002 * Author: Nathaniel G. Auvil * Contributor(s): * * Copyright 2002 (C) Nathaniel G. Auvil. All Rights Reserved. * * Redistribution and use of this software and associated documentation ("Software"), with or * without modification, are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain copyright statements and notices. * Redistributions must also contain a copy of this document. * * 2. Redistributions in binary form must reproduce the above copyright notice, this list of * conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. * * 3. The name "jCharts" or "Nathaniel G. Auvil" must not be used to endorse or promote * products derived from this Software without prior written permission of Nathaniel G. * Auvil. For written permission, please contact nathaniel_auvil@users.sourceforge.net * * 4. Products derived from this Software may not be called "jCharts" nor may "jCharts" appear * in their names without prior written permission of Nathaniel G. Auvil. jCharts is a * registered trademark of Nathaniel G. Auvil. * * 5. Due credit should be given to the jCharts Project (http://jcharts.sourceforge.net/). * * THIS SOFTWARE IS PROVIDED BY Nathaniel G. Auvil AND CONTRIBUTORS ``AS IS'' AND ANY * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL * jCharts OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE ************************************************************************************************/ package org.jCharts.axisChart.customRenderers.axisValue.renderers; import org.jCharts.axisChart.customRenderers.axisValue.AxisValueRenderEvent; import org.jCharts.axisChart.customRenderers.axisValue.PreAxisValueRenderListener; import java.awt.*; public class BackgroundRenderer implements PreAxisValueRenderListener { private Paint paint; private boolean draw= false; /******************************************************************************** * * @param paint the paint to do the background in. You might want to use an * alpha less than 255 (as in 'new Color( 20, 20, 20, 50 )' ) as this gets * plotted over top of the axis grid lines. ********************************************************************************/ public BackgroundRenderer( Paint paint ) { this.paint= paint; } /********************************************************************************* * * @param axisValueRenderEvent *********************************************************************************/ public void preRender( AxisValueRenderEvent axisValueRenderEvent ) { if( this.draw ) { //---keep the current paint around Paint currentPaint= axisValueRenderEvent.getGraphics2D().getPaint(); axisValueRenderEvent.getGraphics2D().setPaint( this.paint ); axisValueRenderEvent.getGraphics2D().fill( axisValueRenderEvent.getTotalItemAxisArea() ); //---reset the current Paint axisValueRenderEvent.getGraphics2D().setPaint( currentPaint ); } //todo this is not going to work for clustered bar, stacked bar, etc... as it is called each time //---fill the background of every other item this.draw= ! this.draw; } } jcharts-0.7.5/src/org/jCharts/axisChart/customRenderers/axisValue/renderers/ValueLabelPosition.java0000644000175000001440000001011307751071402032635 0ustar onkarusers/*********************************************************************************************** * File Info: $Id: ValueLabelPosition.java,v 1.2 2003/03/05 23:36:30 nathaniel_auvil Exp $ * Copyright (C) 2002 * Author: Nathaniel G. Auvil * Contributor(s): * * Copyright 2002 (C) Nathaniel G. Auvil. All Rights Reserved. * * Redistribution and use of this software and associated documentation ("Software"), with or * without modification, are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain copyright statements and notices. * Redistributions must also contain a copy of this document. * * 2. Redistributions in binary form must reproduce the above copyright notice, this list of * conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. * * 3. The name "jCharts" or "Nathaniel G. Auvil" must not be used to endorse or promote * products derived from this Software without prior written permission of Nathaniel G. * Auvil. For written permission, please contact nathaniel_auvil@users.sourceforge.net * * 4. Products derived from this Software may not be called "jCharts" nor may "jCharts" appear * in their names without prior written permission of Nathaniel G. Auvil. jCharts is a * registered trademark of Nathaniel G. Auvil. * * 5. Due credit should be given to the jCharts Project (http://jcharts.sourceforge.net/). * * THIS SOFTWARE IS PROVIDED BY Nathaniel G. Auvil AND CONTRIBUTORS ``AS IS'' AND ANY * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL * jCharts OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE ************************************************************************************************/ package org.jCharts.axisChart.customRenderers.axisValue.renderers; public class ValueLabelPosition { //---just above or right of value public static final ValueLabelPosition ON_TOP= new ValueLabelPosition( 0 ); //---just below or left of value public static final ValueLabelPosition AT_TOP= new ValueLabelPosition( 1 ); //---half distance from zero line to the value //public static final ValueLabelPosition MIDDLE= new ValueLabelPosition( 2 ); //---just above or to the right of the zero line public static final ValueLabelPosition ABOVE_ZERO_LINE= new ValueLabelPosition( 3 ); public static final ValueLabelPosition AXIS_TOP= new ValueLabelPosition( 4 ); //public static final ValueLabelPosition AXIS_MIDDLE= new ValueLabelPosition( 5 ); public static final ValueLabelPosition AXIS_BOTTOM= new ValueLabelPosition( 6 ); private int position; /********************************************************************************** * * @param position *********************************************************************************/ protected ValueLabelPosition( int position ) { this.position= position; } /******************************************************************************* * * @return ******************************************************************************/ public int getPosition() { return position; } /****************************************************************************** * * @param valueLabelPosition * @return boolean *****************************************************************************/ public final boolean equals( ValueLabelPosition valueLabelPosition ) { return ( this.position == valueLabelPosition.position ); } } jcharts-0.7.5/src/org/jCharts/axisChart/customRenderers/axisValue/renderers/ValueLabelRenderer.java0000644000175000001440000003715407751071402032615 0ustar onkarusers/*********************************************************************************************** * File Info: $Id: ValueLabelRenderer.java,v 1.12 2003/04/19 13:45:45 nathaniel_auvil Exp $ * Copyright (C) 2002 * Author: Nathaniel G. Auvil, John Thomsen * Contributor(s): * * Copyright 2002 (C) Nathaniel G. Auvil. All Rights Reserved. * * Redistribution and use of this software and associated documentation ("Software"), with or * without modification, are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain copyright statements and notices. * Redistributions must also contain a copy of this document. * * 2. Redistributions in binary form must reproduce the above copyright notice, this list of * conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. * * 3. The name "jCharts" or "Nathaniel G. Auvil" must not be used to endorse or promote * products derived from this Software without prior written permission of Nathaniel G. * Auvil. For written permission, please contact nathaniel_auvil@users.sourceforge.net * * 4. Products derived from this Software may not be called "jCharts" nor may "jCharts" appear * in their names without prior written permission of Nathaniel G. Auvil. jCharts is a * registered trademark of Nathaniel G. Auvil. * * 5. Due credit should be given to the jCharts Project (http://jcharts.sourceforge.net/). * * THIS SOFTWARE IS PROVIDED BY Nathaniel G. Auvil AND CONTRIBUTORS ``AS IS'' AND ANY * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL * jCharts OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE ************************************************************************************************/ package org.jCharts.axisChart.customRenderers.axisValue.renderers; import org.jCharts.axisChart.AxisChart; import org.jCharts.axisChart.customRenderers.axisValue.AxisValueRenderEvent; import org.jCharts.axisChart.customRenderers.axisValue.PostAxisValueRenderListener; import org.jCharts.chartData.interfaces.IAxisChartDataSet; import org.jCharts.chartText.NumericTagGroup; import org.jCharts.chartText.TextTag; import org.jCharts.properties.util.ChartFont; import java.awt.*; import java.text.NumberFormat; public class ValueLabelRenderer implements PostAxisValueRenderListener { private NumberFormat numberFormat; private ChartFont valueChartFont = ChartFont.DEFAULT_AXIS_VALUE; //---holds the derived Font if needed so don't have to recalculate it each time. private Font derivedFont; //---vertical labels are only used when plotting on vertical charts; not used for horizontal bar plots. private boolean isLabelVertical = false; private ValueLabelPosition valueLabelPosition = ValueLabelPosition.ON_TOP; private int pixelValuePadding = 4; /********************************************************************************** * * @param isCurrency * @param showGrouping * @param roundingPowerOfTen * @deprecated **********************************************************************************/ public ValueLabelRenderer( boolean isCurrency, boolean showGrouping, int roundingPowerOfTen ) { this.numberFormat = NumericTagGroup.getNumberFormatInstance( isCurrency, false, showGrouping, roundingPowerOfTen ); } /********************************************************************************** * * @param isCurrency * @param isPercent * @param showGrouping * @param roundingPowerOfTen **********************************************************************************/ public ValueLabelRenderer( boolean isCurrency, boolean isPercent, boolean showGrouping, int roundingPowerOfTen ) { this.numberFormat = NumericTagGroup.getNumberFormatInstance( isCurrency, isPercent, showGrouping, roundingPowerOfTen ); } /************************************************************************************ * Sets where you would like to position the label * * @param valueLabelPosition ***********************************************************************************/ public void setValueLabelPosition( ValueLabelPosition valueLabelPosition ) { this.valueLabelPosition = valueLabelPosition; } /************************************************************************************ * * @param valueChartFont ***********************************************************************************/ public void setValueChartFont( ChartFont valueChartFont ) { this.valueChartFont = valueChartFont; } /*********************************************************************************** * * @param useVerticalLabels **********************************************************************************/ public void useVerticalLabels( boolean useVerticalLabels ) { this.isLabelVertical = useVerticalLabels; //---set this here so can reuse same font if( this.isLabelVertical ) { this.derivedFont = this.valueChartFont.deriveFont(); } } /*********************************************************************************** * The pixel padding between the label and the data point. * * @param pixelValuePadding **********************************************************************************/ public void setPixelValuePadding( int pixelValuePadding ) { this.pixelValuePadding = pixelValuePadding; } /*********************************************************************************** * * @param axisValueRenderEvent ***********************************************************************************/ public void postRender( AxisValueRenderEvent axisValueRenderEvent ) { AxisChart axisChart = (AxisChart) axisValueRenderEvent.getSource(); TextTag valueTag; float x; float y; if( axisValueRenderEvent.getiAxisPlotDataSet() instanceof IAxisChartDataSet ) { IAxisChartDataSet iAxisChartDataSet = (IAxisChartDataSet) axisValueRenderEvent.getiAxisPlotDataSet(); double value = iAxisChartDataSet.getValue( axisValueRenderEvent.getDataSetIndex(), axisValueRenderEvent.getValueIndex() ); valueTag = new TextTag( this.numberFormat.format( value ), this.valueChartFont.getFont(), this.derivedFont, axisValueRenderEvent.getFontRenderContext() ); if( axisChart.getAxisProperties().isPlotHorizontal() ) { x = this.calculateXHorizontalPlot( axisValueRenderEvent, valueTag, (value < 0) ); y = this.calculateYHorizontalPlot( axisValueRenderEvent, valueTag ); } else { x = this.calculateXVerticalPlot( axisValueRenderEvent, valueTag ); y = this.calculateYVerticalPlot( axisValueRenderEvent, valueTag, (value < 0) ); } } else { //todo scatter and hi/low valueTag = null; x = 100; y = 100; throw new RuntimeException( "Axis Values not yet implemented for this type of chart." ); } /* Line2D.Float line= new Line2D.Float( x, y, x, y -20 ); axisValueRenderEvent.getGraphics2D().draw( line ); */ valueTag.setXPosition( x ); valueTag.setYPosition( y ); valueTag.render( axisValueRenderEvent.getGraphics2D(), this.valueChartFont.getPaint() ); } /************************************************************************************************* * Calculates the label x so that the label is centered on the scale item. * * @param axisValueRenderEvent * @param formattedTextTag * @return float ************************************************************************************************/ private float calculateXVerticalPlot( AxisValueRenderEvent axisValueRenderEvent, TextTag formattedTextTag ) { float x = axisValueRenderEvent.getValueX(); if( this.isLabelVertical ) { x += formattedTextTag.getFontDescent(); } else { x -= (formattedTextTag.getWidth() / 2); } return x; } /************************************************************************************************* * * @param axisValueRenderEvent * @param formattedTextTag * @return float ************************************************************************************************/ private float calculateYHorizontalPlot( AxisValueRenderEvent axisValueRenderEvent, TextTag formattedTextTag ) { float y = axisValueRenderEvent.getValueY(); if( this.isLabelVertical ) { y += (formattedTextTag.getWidth() / 2); } else { y += formattedTextTag.getFontDescent(); } return y; } /************************************************************************************************* * * @param axisValueRenderEvent * @param formattedTextTag * @param isNegative * @return ************************************************************************************************/ private float calculateXHorizontalPlot( AxisValueRenderEvent axisValueRenderEvent, TextTag formattedTextTag, boolean isNegative ) { float x = axisValueRenderEvent.getValueX(); if( this.valueLabelPosition.equals( ValueLabelPosition.ON_TOP ) ) { //---if the value is negative, 'top' is to the left if( isNegative ) { x -= (this.isLabelVertical) ? 0 : formattedTextTag.getWidth(); x -= this.pixelValuePadding; } else { x += (this.isLabelVertical) ? formattedTextTag.getFontAscent() : 0; x += this.pixelValuePadding; } } else if( this.valueLabelPosition.equals( ValueLabelPosition.AT_TOP ) ) { if( isNegative ) { x += (this.isLabelVertical) ? formattedTextTag.getFontAscent() : 0; x += this.pixelValuePadding; } else { x -= (this.isLabelVertical) ? formattedTextTag.getFontDescent() : formattedTextTag.getWidth(); x -= this.pixelValuePadding; } } else if( this.valueLabelPosition.equals( ValueLabelPosition.ABOVE_ZERO_LINE ) ) { x = axisValueRenderEvent.getZeroLineCoordinate(); if( isNegative ) { x += (this.isLabelVertical) ? formattedTextTag.getFontAscent() : 0; x += this.pixelValuePadding; } else { x -= (this.isLabelVertical) ? formattedTextTag.getFontDescent() : formattedTextTag.getWidth(); x -= this.pixelValuePadding; } } else if( this.valueLabelPosition.equals( ValueLabelPosition.AXIS_TOP ) ) { x = axisValueRenderEvent.getTotalItemAxisArea().x + axisValueRenderEvent.getTotalItemAxisArea().width; x -= (this.isLabelVertical) ? 0 : formattedTextTag.getWidth(); x -= this.pixelValuePadding; } else if( this.valueLabelPosition.equals( ValueLabelPosition.AXIS_BOTTOM ) ) { x = axisValueRenderEvent.getTotalItemAxisArea().x; x += (this.isLabelVertical) ? formattedTextTag.getFontAscent() : 0; x += this.pixelValuePadding; } //VALIDATION - force labels into plot area, in case there is a user defined scale. //todo could we skip this validation for non-user defined scales? //---if label goes off the right edge, force it to stay in the plot area. if( (x + formattedTextTag.getWidth()) > (axisValueRenderEvent.getTotalItemAxisArea().x + axisValueRenderEvent.getTotalItemAxisArea().width) ) { x = axisValueRenderEvent.getTotalItemAxisArea().x + axisValueRenderEvent.getTotalItemAxisArea().width; x -= formattedTextTag.getWidth(); x -= this.pixelValuePadding; } //---if label goes off left edge, force to the right else if( x < axisValueRenderEvent.getTotalItemAxisArea().x ) { x = axisValueRenderEvent.getTotalItemAxisArea().x; x += this.pixelValuePadding; } return x; } /************************************************************************************************* * * @param axisValueRenderEvent * @param formattedTextTag * @param isNegative * @return ************************************************************************************************/ private float calculateYVerticalPlot( AxisValueRenderEvent axisValueRenderEvent, TextTag formattedTextTag, boolean isNegative ) { float y = axisValueRenderEvent.getValueY(); if( this.valueLabelPosition.equals( ValueLabelPosition.ON_TOP ) ) { //---if the value is negative, 'top' is to the bottom if( isNegative ) { y += (this.isLabelVertical) ? formattedTextTag.getWidth() : formattedTextTag.getHeight(); y += this.pixelValuePadding; } else { y -= this.pixelValuePadding; } } else if( this.valueLabelPosition.equals( ValueLabelPosition.AT_TOP ) ) { //---if the value is negative, 'top' is to the bottom if( isNegative ) { y -= this.pixelValuePadding; } else { y += (this.isLabelVertical) ? formattedTextTag.getWidth() : formattedTextTag.getHeight(); y += this.pixelValuePadding; } } else if( this.valueLabelPosition.equals( ValueLabelPosition.ABOVE_ZERO_LINE ) ) { y = axisValueRenderEvent.getZeroLineCoordinate(); //---if the value is negative, 'top' is to the bottom if( isNegative ) { y -= this.pixelValuePadding; } else { y += (this.isLabelVertical) ? formattedTextTag.getWidth() : formattedTextTag.getHeight(); y += this.pixelValuePadding; } } else if( this.valueLabelPosition.equals( ValueLabelPosition.AXIS_TOP ) ) { y = axisValueRenderEvent.getTotalItemAxisArea().y; y += (this.isLabelVertical) ? formattedTextTag.getWidth() : formattedTextTag.getHeight(); y += this.pixelValuePadding; } else if( this.valueLabelPosition.equals( ValueLabelPosition.AXIS_BOTTOM ) ) { y = axisValueRenderEvent.getTotalItemAxisArea().y + axisValueRenderEvent.getTotalItemAxisArea().height; y -= this.pixelValuePadding; } //VALIDATION - force labels into plot area, in case there is a user defined scale. if( isLabelVertical ) { //---if label goes off the bottom edge, force it to stay in the plot area. if( ( y - formattedTextTag.getWidth() ) < axisValueRenderEvent.getTotalItemAxisArea().y ) { y = axisValueRenderEvent.getTotalItemAxisArea().y; y += formattedTextTag.getWidth(); y += this.pixelValuePadding; } //---if label goes off bottom edge, force to the up else if( y > axisValueRenderEvent.getTotalItemAxisArea().y + axisValueRenderEvent.getTotalItemAxisArea().height ) { y = axisValueRenderEvent.getTotalItemAxisArea().y + axisValueRenderEvent.getTotalItemAxisArea().height; y -= this.pixelValuePadding; } } else { //---if label goes off the top edge, force it to stay in the plot area. if( ( y - formattedTextTag.getHeight() ) < axisValueRenderEvent.getTotalItemAxisArea().y ) { y = axisValueRenderEvent.getTotalItemAxisArea().y; y += formattedTextTag.getHeight(); y += this.pixelValuePadding; } //---if label goes off bottom edge, force to the up else if( y > axisValueRenderEvent.getTotalItemAxisArea().y + axisValueRenderEvent.getTotalItemAxisArea().height ) { y = axisValueRenderEvent.getTotalItemAxisArea().y + axisValueRenderEvent.getTotalItemAxisArea().height; y -= this.pixelValuePadding; } } return y; } } jcharts-0.7.5/src/org/jCharts/axisChart/customRenderers/axisValue/AxisValueRenderEvent.java0000644000175000001440000001325007751071402031153 0ustar onkarusers/*********************************************************************************************** * File Info: $Id: AxisValueRenderEvent.java,v 1.1 2003/03/02 21:46:16 nathaniel_auvil Exp $ * Copyright (C) 2002 * Author: Nathaniel G. Auvil * Contributor(s): John Thomsen * * Copyright 2002 (C) Nathaniel G. Auvil. All Rights Reserved. * * Redistribution and use of this software and associated documentation ("Software"), with or * without modification, are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain copyright statements and notices. * Redistributions must also contain a copy of this document. * * 2. Redistributions in binary form must reproduce the above copyright notice, this list of * conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. * * 3. The name "jCharts" or "Nathaniel G. Auvil" must not be used to endorse or promote * products derived from this Software without prior written permission of Nathaniel G. * Auvil. For written permission, please contact nathaniel_auvil@users.sourceforge.net * * 4. Products derived from this Software may not be called "jCharts" nor may "jCharts" appear * in their names without prior written permission of Nathaniel G. Auvil. jCharts is a * registered trademark of Nathaniel G. Auvil. * * 5. Due credit should be given to the jCharts Project (http://jcharts.sourceforge.net/). * * THIS SOFTWARE IS PROVIDED BY Nathaniel G. Auvil AND CONTRIBUTORS ``AS IS'' AND ANY * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL * jCharts OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE ************************************************************************************************/ package org.jCharts.axisChart.customRenderers.axisValue; import org.jCharts.axisChart.AxisChart; import org.jCharts.chartData.interfaces.IAxisPlotDataSet; import java.util.EventObject; import java.awt.*; import java.awt.geom.Rectangle2D; import java.awt.font.FontRenderContext; public class AxisValueRenderEvent extends EventObject { private Graphics2D graphics2D; private FontRenderContext fontRenderContext; private IAxisPlotDataSet iAxisPlotDataSet; //---the total axis area the scale item occupies private Rectangle2D.Float totalItemAxisArea; private float zeroLineCoordinate; private float valueX; private float valueY; private int dataSetIndex; private int valueIndex; /************************************************************************************ * * @param axisChart * @param graphics2D * @param totalItemAxisArea ***********************************************************************************/ public AxisValueRenderEvent( AxisChart axisChart, IAxisPlotDataSet iAxisPlotDataSet, Graphics2D graphics2D, Rectangle2D.Float totalItemAxisArea, float zeroLineCoordinate ) { super( axisChart ); this.iAxisPlotDataSet= iAxisPlotDataSet; this.graphics2D = graphics2D; this.fontRenderContext = graphics2D.getFontRenderContext(); this.totalItemAxisArea = totalItemAxisArea; this.zeroLineCoordinate= zeroLineCoordinate; } /*********************************************************************************** * * @return Graphics2D **********************************************************************************/ public Graphics2D getGraphics2D() { return graphics2D; } /*********************************************************************************** * * @return FontRenderContext **********************************************************************************/ public FontRenderContext getFontRenderContext() { return fontRenderContext; } /************************************************************************************* * Returns the bounding box of the total axis plot area alotted to the current scale * item. * * @return Rectangle2D.Float *************************************************************************************/ public Rectangle2D.Float getTotalItemAxisArea() { return totalItemAxisArea; } public IAxisPlotDataSet getiAxisPlotDataSet() { return iAxisPlotDataSet; } /************************************************************************************** * * @return *************************************************************************************/ public float getValueX() { return valueX; } public void setValueX( float valueX ) { this.valueX = valueX; } public float getValueY() { return valueY; } public void setValueY( float valueY ) { this.valueY = valueY; } public int getDataSetIndex() { return dataSetIndex; } public void setDataSetIndex( int dataSetIndex ) { this.dataSetIndex = dataSetIndex; } public int getValueIndex() { return valueIndex; } public void setValueIndex( int valueIndex ) { this.valueIndex = valueIndex; } public float getZeroLineCoordinate() { return zeroLineCoordinate; } } jcharts-0.7.5/src/org/jCharts/axisChart/customRenderers/axisValue/PostAxisValueRenderListener.java0000644000175000001440000000571307751071402032532 0ustar onkarusers/*********************************************************************************************** * File Info: $Id: PostAxisValueRenderListener.java,v 1.2 2003/03/08 22:49:43 nathaniel_auvil Exp $ * Copyright (C) 2002 * Author: Nathaniel G. Auvil * Contributor(s): John Thomsen * * Copyright 2002 (C) Nathaniel G. Auvil. All Rights Reserved. * * Redistribution and use of this software and associated documentation ("Software"), with or * without modification, are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain copyright statements and notices. * Redistributions must also contain a copy of this document. * * 2. Redistributions in binary form must reproduce the above copyright notice, this list of * conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. * * 3. The name "jCharts" or "Nathaniel G. Auvil" must not be used to endorse or promote * products derived from this Software without prior written permission of Nathaniel G. * Auvil. For written permission, please contact nathaniel_auvil@users.sourceforge.net * * 4. Products derived from this Software may not be called "jCharts" nor may "jCharts" appear * in their names without prior written permission of Nathaniel G. Auvil. jCharts is a * registered trademark of Nathaniel G. Auvil. * * 5. Due credit should be given to the jCharts Project (http://jcharts.sourceforge.net/). * * THIS SOFTWARE IS PROVIDED BY Nathaniel G. Auvil AND CONTRIBUTORS ``AS IS'' AND ANY * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL * jCharts OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE ************************************************************************************************/ package org.jCharts.axisChart.customRenderers.axisValue; import java.util.EventListener; /******************************************************************************************** * This Class is used to recieve callbacks from the chart renderers after they render * their value to the chart, with value meaning their bar, point, line, etc... * ******************************************************************************************/ public interface PostAxisValueRenderListener extends EventListener { public void postRender( AxisValueRenderEvent axisValueRenderEvent ); } jcharts-0.7.5/src/org/jCharts/axisChart/customRenderers/axisValue/PreAxisValueRenderListener.java0000644000175000001440000000514107751071402032326 0ustar onkarusers/*********************************************************************************************** * File Info: $Id: PreAxisValueRenderListener.java,v 1.1 2003/03/02 21:46:16 nathaniel_auvil Exp $ * Copyright (C) 2002 * Author: Nathaniel G. Auvil * Contributor(s): John Thomsen * * Copyright 2002 (C) Nathaniel G. Auvil. All Rights Reserved. * * Redistribution and use of this software and associated documentation ("Software"), with or * without modification, are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain copyright statements and notices. * Redistributions must also contain a copy of this document. * * 2. Redistributions in binary form must reproduce the above copyright notice, this list of * conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. * * 3. The name "jCharts" or "Nathaniel G. Auvil" must not be used to endorse or promote * products derived from this Software without prior written permission of Nathaniel G. * Auvil. For written permission, please contact nathaniel_auvil@users.sourceforge.net * * 4. Products derived from this Software may not be called "jCharts" nor may "jCharts" appear * in their names without prior written permission of Nathaniel G. Auvil. jCharts is a * registered trademark of Nathaniel G. Auvil. * * 5. Due credit should be given to the jCharts Project (http://jcharts.sourceforge.net/). * * THIS SOFTWARE IS PROVIDED BY Nathaniel G. Auvil AND CONTRIBUTORS ``AS IS'' AND ANY * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL * jCharts OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE ************************************************************************************************/ package org.jCharts.axisChart.customRenderers.axisValue; import java.util.EventListener; public interface PreAxisValueRenderListener extends EventListener { public void preRender( AxisValueRenderEvent axisValueRenderEvent ); } jcharts-0.7.5/src/org/jCharts/axisChart/AreaChart.java0000644000175000001440000001272307751071402021621 0ustar onkarusers/*********************************************************************************************** * File Info: $Id: AreaChart.java,v 1.7 2003/02/11 03:17:23 nathaniel_auvil Exp $ * Copyright (C) 2000 * Author: Nathaniel G. Auvil * Contributor(s): * * Copyright 2002 (C) Nathaniel G. Auvil. All Rights Reserved. * * Redistribution and use of this software and associated documentation ("Software"), with or * without modification, are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain copyright statements and notices. * Redistributions must also contain a copy of this document. * * 2. Redistributions in binary form must reproduce the above copyright notice, this list of * conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. * * 3. The name "jCharts" or "Nathaniel G. Auvil" must not be used to endorse or promote * products derived from this Software without prior written permission of Nathaniel G. * Auvil. For written permission, please contact nathaniel_auvil@users.sourceforge.net * * 4. Products derived from this Software may not be called "jCharts" nor may "jCharts" appear * in their names without prior written permission of Nathaniel G. Auvil. jCharts is a * registered trademark of Nathaniel G. Auvil. * * 5. Due credit should be given to the jCharts Project (http://jcharts.sourceforge.net/). * * THIS SOFTWARE IS PROVIDED BY Nathaniel G. Auvil AND CONTRIBUTORS ``AS IS'' AND ANY * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL * jCharts OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE ************************************************************************************************/ package org.jCharts.axisChart; import org.jCharts.chartData.interfaces.IAxisChartDataSet; import org.jCharts.imageMap.ImageMapNotSupportedException; import org.jCharts.properties.DataAxisProperties; import java.awt.*; import java.awt.geom.Area; import java.awt.geom.GeneralPath; abstract class AreaChart { /******************************************************************************************** * Draws the chart * * @param axisChart * @param iAxisChartDataSet *********************************************************************************************/ static void render( AxisChart axisChart, IAxisChartDataSet iAxisChartDataSet ) { //---hopefully eliminate support requests asking about this... if( axisChart.getImageMap() != null ) { //todo should we do a point image map? throw new ImageMapNotSupportedException( "HTML client-side image maps are not supported on Area Charts." ); } //AreaChartProperties areaChartProperties=(AreaChartProperties) iAxisChartDataSet.getChartTypeProperties(); float xPosition=axisChart.getXAxis().getTickStart(); GeneralPath generalPaths[]=new GeneralPath[ iAxisChartDataSet.getNumberOfDataSets() ]; //---AreaCharts can not be drawn on a horizontal axis so y-axis will always be the data axis DataAxisProperties dataAxisProperties= (DataAxisProperties) axisChart.getAxisProperties().getYAxisProperties(); //LOOP //---initial postion of each line must be set with call to moveTo() //---Do this here so every point does not have to check....if( i == 0 )... in loop for( int i=0; i < generalPaths.length; i++ ) { generalPaths[ i ]=new GeneralPath(); generalPaths[ i ].moveTo( xPosition, axisChart.getYAxis().getZeroLineCoordinate() ); generalPaths[ i ].lineTo( xPosition, axisChart.getYAxis().computeAxisCoordinate( axisChart.getYAxis().getOrigin(), iAxisChartDataSet.getValue( i, 0 ), axisChart.getYAxis().getScaleCalculator().getMinValue() ) ); } //LOOP for( int j=1; j < iAxisChartDataSet.getNumberOfDataItems(); j++ ) { xPosition+=axisChart.getXAxis().getScalePixelWidth(); //LOOP for( int i=0; i < generalPaths.length; i++ ) { generalPaths[ i ].lineTo( xPosition, axisChart.getYAxis().computeAxisCoordinate( axisChart.getYAxis().getOrigin(), iAxisChartDataSet.getValue( i, j ), axisChart.getYAxis().getScaleCalculator().getMinValue() ) ); } } Area[] areas=new Area[ generalPaths.length ]; //LOOP //---close the path. Do this here so do not have to check if last every pass through above loop. for( int i=0; i < generalPaths.length; i++ ) { generalPaths[ i ].lineTo( xPosition, axisChart.getYAxis().getZeroLineCoordinate() ); generalPaths[ i ].closePath(); areas[ i ]=new Area( generalPaths[ i ] ); } Graphics2D g2d=axisChart.getGraphics2D(); //LOOP //---draw each path to the image for( int i=0; i < areas.length; i++ ) { g2d.setPaint( iAxisChartDataSet.getPaint( i ) ); g2d.fill( areas[ i ] ); } } } jcharts-0.7.5/src/org/jCharts/axisChart/AxisChart.java0000644000175000001440000006233407751071402021660 0ustar onkarusers/*********************************************************************************************** * File Info: $Id: AxisChart.java,v 1.38 2003/04/19 01:40:33 nathaniel_auvil Exp $ * Copyright (C) 2002 * Author: Nathaniel G. Auvil * Contributor(s): * * Copyright 2002 (C) Nathaniel G. Auvil. All Rights Reserved. * * Redistribution and use of this software and associated documentation ("Software"), with or * without modification, are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain copyright statements and notices. * Redistributions must also contain a copy of this document. * * 2. Redistributions in binary form must reproduce the above copyright notice, this list of * conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. * * 3. The name "jCharts" or "Nathaniel G. Auvil" must not be used to endorse or promote * products derived from this Software without prior written permission of Nathaniel G. * Auvil. For written permission, please contact nathaniel_auvil@users.sourceforge.net * * 4. Products derived from this Software may not be called "jCharts" nor may "jCharts" appear * in their names without prior written permission of Nathaniel G. Auvil. jCharts is a * registered trademark of Nathaniel G. Auvil. * * 5. Due credit should be given to the jCharts Project (http://jcharts.sourceforge.net/). * * THIS SOFTWARE IS PROVIDED BY Nathaniel G. Auvil AND CONTRIBUTORS ``AS IS'' AND ANY * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL * jCharts OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE ************************************************************************************************/ package org.jCharts.axisChart; import org.jCharts.Chart; import org.jCharts.axisChart.axis.*; import org.jCharts.axisChart.axis.scale.*; import org.jCharts.chartText.NumericTagGroup; import org.jCharts.chartText.TextTagGroup; import org.jCharts.chartData.interfaces.*; import org.jCharts.chartData.processors.AxisChartDataProcessor; import org.jCharts.chartData.ChartDataException; import org.jCharts.imageMap.ImageMap; import org.jCharts.properties.*; import org.jCharts.test.*; import org.jCharts.types.ChartType; import java.awt.*; import java.awt.font.FontRenderContext; import java.awt.geom.Rectangle2D; import java.util.Iterator; /**************************************************************************************************** * This Class is used to create all axis chart types. This class knows how to render charts based on * the ChartType specified in on the iAxisChartDataSet. * *****************************************************************************************************/ public class AxisChart extends Chart implements HTMLChartTestable { protected XAxis xAxis; protected YAxis yAxis; protected AxisProperties axisProperties; private IAxisDataSeries iAxisDataSeries; /************************************************************************************************** * Constructor * * @param iAxisDataSeries * @param chartProperties * @param axisProperties * @param legendProperties if no legend is desired, pass NULL * @param pixelWidth * @param pixelHeight ***************************************************************************************************/ public AxisChart( IAxisDataSeries iAxisDataSeries, ChartProperties chartProperties, AxisProperties axisProperties, LegendProperties legendProperties, int pixelWidth, int pixelHeight ) { super( legendProperties, chartProperties, pixelWidth, pixelHeight ); this.axisProperties = axisProperties; this.iAxisDataSeries = iAxisDataSeries; } /************************************************************************************************* * * @return IAxisDataSeries *************************************************************************************************/ public IAxisDataSeries getIAxisDataSeries() { return this.iAxisDataSeries; } /******************************************************************************************** * ScatterPlots create a subclass of AxisChartDataProcessor so we need this method so we can * overload it. * * @return AxisChartDataProcessor ********************************************************************************************/ public AxisChartDataProcessor createAxisChartDataProcessor() { return new AxisChartDataProcessor(); } /************************************************************************************************ * Once we determine which axis is the data axis, the logic to set it up is the same whether it * is a horizontal or vertical plot. * * @param dataAxisProperties * @param axisChartDataProcessor * @param fontRenderContext * @return NumericTagGroup need to set this on the right axis ************************************************************************************************/ protected NumericTagGroup setupDataAxisProperties( Axis axis, DataAxisProperties dataAxisProperties, AxisChartDataProcessor axisChartDataProcessor, FontRenderContext fontRenderContext ) { if( dataAxisProperties.getScaleCalculator() == null ) { ScaleCalculator s; if( dataAxisProperties.hasUserDefinedScale() ) { s = new UserDefinedScaleCalculator( dataAxisProperties.getUserDefinedMinimumValue(), dataAxisProperties.getUserDefinedIncrement() ); } else { s = new AutomaticScaleCalculator(); s.setMaxValue( axisChartDataProcessor.getMaxValue() ); s.setMinValue( axisChartDataProcessor.getMinValue() ); } axis.setScaleCalculator( s ); } else { axis.setScaleCalculator( dataAxisProperties.getScaleCalculator() ); axis.getScaleCalculator().setMaxValue( axisChartDataProcessor.getMaxValue() ); axis.getScaleCalculator().setMinValue( axisChartDataProcessor.getMinValue() ); } axis.getScaleCalculator().setRoundingPowerOfTen( dataAxisProperties.getRoundToNearest() ); axis.getScaleCalculator().setNumberOfScaleItems( dataAxisProperties.getNumItems() ); axis.getScaleCalculator().computeScaleValues(); // if( dataAxisProperties.showAxisLabels() ) { //TODO what if they do not want to display axis labels? //todo we still need to know how to size the axis NumericTagGroup numericTagGroup = new NumericTagGroup( dataAxisProperties.getScaleChartFont(), fontRenderContext, dataAxisProperties.useDollarSigns(), dataAxisProperties.usePercentSigns(), dataAxisProperties.useCommas(), dataAxisProperties.getRoundToNearest() ); numericTagGroup.createAxisScaleLabels( axis.getScaleCalculator() ); return numericTagGroup; } /* else { return null; } */ } /*************************************************************************************** * * * @param axisChartDataProcessor * @param fontRenderContext **************************************************************************************/ protected void setupAxis( AxisChartDataProcessor axisChartDataProcessor, FontRenderContext fontRenderContext ) throws ChartDataException { IDataSeries iDataSeries= (IDataSeries) this.getIAxisDataSeries(); if( this.axisProperties.isPlotHorizontal() ) { //---X AXIS--------------------------------------------------------------------------- DataAxisProperties dataAxisProperties = (DataAxisProperties) this.getAxisProperties().getXAxisProperties(); this.xAxis = new XAxis( this, dataAxisProperties.getNumItems() ); NumericTagGroup numericTagGroup= setupDataAxisProperties( this.xAxis, dataAxisProperties, axisChartDataProcessor, fontRenderContext ); this.xAxis.setAxisLabelsGroup( numericTagGroup ); //---Y AXIS--------------------------------------------------------------------------- AxisTypeProperties axisTypeProperties = this.getAxisProperties().getYAxisProperties(); this.yAxis = new YAxis( this, axisChartDataProcessor.getNumberOfElementsInADataSet() ); if( axisTypeProperties.showAxisLabels() ) { TextTagGroup textTagGroup = new TextTagGroup( axisTypeProperties.getScaleChartFont(), fontRenderContext ); //LOOP for( int i = 0; i < iDataSeries.getNumberOfAxisLabels(); i++ ) { if( iDataSeries.getAxisLabel( i ) == null ) { throw new ChartDataException( "None of the axis labels can be NULL." ); } textTagGroup.addLabel( iDataSeries.getAxisLabel( i ) ); } this.yAxis.setAxisLabelsGroup( textTagGroup ); } } else { //---X AXIS--------------------------------------------------------------------------- AxisTypeProperties axisTypeProperties = this.getAxisProperties().getXAxisProperties(); this.xAxis = new XAxis( this, axisChartDataProcessor.getNumberOfElementsInADataSet() ); if( axisTypeProperties.showAxisLabels() ) { TextTagGroup textTagGroup = new TextTagGroup( axisTypeProperties.getScaleChartFont(), fontRenderContext ); //LOOP for( int i = 0; i < iDataSeries.getNumberOfAxisLabels(); i++ ) { if( iDataSeries.getAxisLabel( i ) == null ) { throw new ChartDataException( "None of the axis labels can be NULL." ); } textTagGroup.addLabel( iDataSeries.getAxisLabel( i ) ); } this.xAxis.setAxisLabelsGroup( textTagGroup ); } //---Y AXIS--------------------------------------------------------------------------- DataAxisProperties dataAxisProperties = ( DataAxisProperties ) this.getAxisProperties().getYAxisProperties(); this.yAxis = new YAxis( this, dataAxisProperties.getNumItems() ); NumericTagGroup numericTagGroup= setupDataAxisProperties( this.yAxis, dataAxisProperties, axisChartDataProcessor, fontRenderContext ); this.yAxis.setAxisLabelsGroup( numericTagGroup ); } //---if yAxisTitle is null, do not show title this.yAxis.computeMinimumWidthNeeded( iDataSeries.getYAxisTitle() ); this.xAxis.computeMinimumHeightNeeded( iDataSeries.getXAxisTitle() ); } /*********************************************************************************************** * Finalizes the size of both Axis and sets the origin position * * @param xAxisWidth * @param yAxisHeight * @param chartTitleHeight **********************************************************************************************/ private void sizeAndPositionAxis( float xAxisWidth, float yAxisHeight, float chartTitleHeight ) { //---SUBTRACT space for axis titles, labels, ticks... xAxisWidth -= this.yAxis.getMinimumWidthNeeded(); yAxisHeight -= this.xAxis.getMinimumHeightNeeded(); //---SET THE PIXEL LENGTH OF THE AXIS this.xAxis.setPixelLength( xAxisWidth ); if( axisProperties.getYAxisProperties().showAxisLabels() ) { this.yAxis.setPixelLength( yAxisHeight - this.yAxis.getAxisLabelsGroup().getTallestLabel() / 2 ); } else { this.yAxis.setPixelLength( yAxisHeight ); } if( this.getLegend() != null ) { //---SET THE ORIGIN COORDINATES if( ( this.getLegend().getLegendProperties().getPlacement() == LegendAreaProperties.RIGHT ) || ( this.getLegend().getLegendProperties().getPlacement() == LegendAreaProperties.BOTTOM ) ) { this.xAxis.setOrigin( this.yAxis.getMinimumWidthNeeded() + super.getChartProperties().getEdgePadding() ); this.yAxis.setOrigin( yAxisHeight + super.getChartProperties().getEdgePadding() + chartTitleHeight ); } else if( this.getLegend().getLegendProperties().getPlacement() == LegendAreaProperties.LEFT ) //---else, LegendAreaProperties.LEFT, OR LegendAreaProperties.TOP { this.xAxis.setOrigin( super.getImageWidth() - xAxisWidth - super.getChartProperties().getEdgePadding() ); this.yAxis.setOrigin( yAxisHeight + super.getChartProperties().getEdgePadding() + chartTitleHeight ); } else if( this.getLegend().getLegendProperties().getPlacement() == LegendAreaProperties.TOP ) { this.xAxis.setOrigin( this.yAxis.getMinimumWidthNeeded() + super.getChartProperties().getEdgePadding() ); this.yAxis.setOrigin( super.getImageHeight() - super.getChartProperties().getEdgePadding() - this.xAxis.getMinimumHeightNeeded() ); } } else { this.xAxis.setOrigin( this.yAxis.getMinimumWidthNeeded() + super.getChartProperties().getEdgePadding() ); this.yAxis.setOrigin( yAxisHeight + super.getChartProperties().getEdgePadding() + chartTitleHeight ); } } /****************************************************************************************** * *****************************************************************************************/ protected void deriveAxisValues() { this.xAxis.computeLabelFilter(); this.xAxis.computeShouldTickStartAtYAxis( this.iAxisDataSeries, this.axisProperties.getXAxisProperties() ); if( this.axisProperties.isPlotHorizontal() ) { //DataAxisProperties dataAxisProperties = (DataAxisProperties) this.axisProperties.getXAxisProperties(); //LabelAxisProperties labelAxisProperties= (LabelAxisProperties) this.axisProperties.getYAxisProperties(); //---Determine how many labels will fit on the x-axis this.xAxis.computeScalePixelWidthDataAxis(); this.yAxis.computeScalePixelWidth(); this.xAxis.computeOneUnitPixelSize( this.xAxis.getScalePixelWidth(), this.xAxis.getScaleCalculator().getIncrement() ); //---we ADD to the origin position when doing x-axis float zeroLineCoordinate = ( float ) ( this.xAxis.getOrigin() + ( this.xAxis.getScalePixelWidth() * ( -this.xAxis.getScaleCalculator().getMinValue() ) ) / this.xAxis.getScaleCalculator().getIncrement() ); this.xAxis.setZeroLineCoordinate( zeroLineCoordinate ); } else { //DataAxisProperties dataAxisProperties = ( DataAxisProperties ) this.axisProperties.getYAxisProperties(); this.xAxis.computeScalePixelWidth(); this.yAxis.computeScalePixelWidthDataAxis(); this.yAxis.computeOneUnitPixelSize( this.yAxis.getScalePixelWidth(), this.yAxis.getScaleCalculator().getIncrement() ); //---we SUBTRACT to the origin position when doing y-axis float zeroLineCoordinate = ( float ) ( this.yAxis.getOrigin() - ( this.yAxis.getScalePixelWidth() * ( -this.yAxis.getScaleCalculator().getMinValue() ) ) / this.yAxis.getScaleCalculator().getIncrement() ); this.yAxis.setZeroLineCoordinate( zeroLineCoordinate ); } this.xAxis.computeTickStart(); } /******************************************************************************************** * Implement the method to render the Axis based chart * * @throws ChartDataException * @throws PropertyException there are several validations done to aid in development of the * charts. ********************************************************************************************/ protected void renderChart() throws ChartDataException, PropertyException { if( super.getChartProperties().validate() ) { this.iAxisDataSeries.validate(); } //---this is not an optional validation this.validateHorizontalPlot(); Graphics2D g2d = super.getGraphics2D(); g2d.setRenderingHint( RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON ); FontRenderContext fontRenderContext = g2d.getFontRenderContext(); //---cache calcs used more than once float edgePaddingTimesTwo = super.getChartProperties().getEdgePadding() * 2; //---start off with total image width and we will subtract components from that. float xAxisWidth = super.getImageWidth() - edgePaddingTimesTwo; float yAxisHeight = super.getImageHeight() - edgePaddingTimesTwo; //---render the TITLE. If no title, this will return zero. float chartTitleHeight = super.renderChartTitle( this.getIAxisDataSeries().getChartTitle(), fontRenderContext ); yAxisHeight -= chartTitleHeight; //---if there is a legend... if( super.getLegend() != null ) { //---PROCESS the size needed for drawing the legend. super.getLegend().computeLegendXY( this.iAxisDataSeries, chartTitleHeight ); if( ( super.getLegend().getLegendProperties().getPlacement() == LegendAreaProperties.RIGHT ) || ( super.getLegend().getLegendProperties().getPlacement() == LegendAreaProperties.LEFT ) ) { xAxisWidth -= super.getLegend().getLegendProperties().getChartPadding(); xAxisWidth -= super.getLegend().getWidth(); } else //LegendAreaProperties.BOTTOM, OR LegendAreaProperties.TOP { yAxisHeight -= this.getLegend().getLegendProperties().getChartPadding(); yAxisHeight -= this.getLegend().getHeight(); } super.getLegend().render(); } AxisChartDataProcessor axisChartDataProcessor = this.createAxisChartDataProcessor(); axisChartDataProcessor.processData( this, fontRenderContext ); this.setupAxis( axisChartDataProcessor, fontRenderContext ); this.sizeAndPositionAxis( xAxisWidth, yAxisHeight, chartTitleHeight ); this.deriveAxisValues(); //---PAINT THE BACKGROUND OF AXIS if( this.getAxisProperties().getBackgroundPaint() != null ) { Rectangle2D.Float rectangle = new Rectangle2D.Float( this.xAxis.getOrigin() + 1, this.yAxis.getOrigin() - this.yAxis.getPixelLength(), this.xAxis.getPixelLength(), this.yAxis.getPixelLength() ); g2d.setPaint( this.axisProperties.getBackgroundPaint() ); g2d.fill( rectangle ); } this.yAxis.render( g2d, this.getAxisProperties(), iAxisDataSeries.getYAxisTitle() ); this.xAxis.render( g2d, this.getAxisProperties(), iAxisDataSeries.getXAxisTitle() ); //---SCALE CLIPPING REGION //---if the user defined the scale, chart may be off the 'screen' so set a clipping region so only draw in the chart. Rectangle2D.Float rectangle = new Rectangle2D.Float( this.getXAxis().getOrigin(), this.getYAxis().getOrigin() - this.getYAxis().getPixelLength() + 1, this.xAxis.getPixelLength() + 1, this.yAxis.getPixelLength() - 2 ); g2d.setClip( rectangle ); //---IMAGE MAP setup //---if we are saving all the coordinates for an ImageMap, create the ImageMap Object as we //--- know how many area elements there are. if( super.getGenerateImageMapFlag() ) { //---pass the size to try and avoid having the expense of resizing the ArrayList ImageMap imageMap = new ImageMap( iAxisDataSeries.size() * iAxisDataSeries.getTotalNumberOfDataSets() ); super.setImageMap( imageMap ); } //---draw the charts over the axis... overlayCharts(); } /******************************************************************************************** * Draws the charts over the axis. We have to render in a specific order so combo charts * get drawn correctly * * @throws PropertyException ******************************************************************************************/ protected void overlayCharts() throws PropertyException, ChartDataException { IAxisPlotDataSet iAxisPlotDataSet; iAxisPlotDataSet = this.iAxisDataSeries.getIAxisPlotDataSet( ChartType.AREA_STACKED ); if( iAxisPlotDataSet != null ) { StackedAreaChart.render( this, ( IAxisChartDataSet ) iAxisPlotDataSet ); } iAxisPlotDataSet = this.iAxisDataSeries.getIAxisPlotDataSet( ChartType.AREA ); if( iAxisPlotDataSet != null ) { AreaChart.render( this, ( IAxisChartDataSet ) iAxisPlotDataSet ); } iAxisPlotDataSet = this.iAxisDataSeries.getIAxisPlotDataSet( ChartType.BAR ); if( iAxisPlotDataSet != null ) { BarChart.render( this, ( IAxisChartDataSet ) iAxisPlotDataSet ); } iAxisPlotDataSet = this.iAxisDataSeries.getIAxisPlotDataSet( ChartType.BAR_STACKED ); if( iAxisPlotDataSet != null ) { StackedBarChart.render( this, ( IAxisChartDataSet ) iAxisPlotDataSet ); } iAxisPlotDataSet = this.iAxisDataSeries.getIAxisPlotDataSet( ChartType.BAR_CLUSTERED ); if( iAxisPlotDataSet != null ) { ClusteredBarChart.render( this, ( IAxisChartDataSet ) iAxisPlotDataSet ); } iAxisPlotDataSet = this.iAxisDataSeries.getIAxisPlotDataSet( ChartType.STOCK ); if( iAxisPlotDataSet != null ) { StockChart.render( this, ( IStockChartDataSet ) iAxisPlotDataSet ); } iAxisPlotDataSet = this.iAxisDataSeries.getIAxisPlotDataSet( ChartType.LINE ); if( iAxisPlotDataSet != null ) { LineChart.render( this, ( IAxisChartDataSet ) iAxisPlotDataSet ); } iAxisPlotDataSet = this.iAxisDataSeries.getIAxisPlotDataSet( ChartType.POINT ); if( iAxisPlotDataSet != null ) { PointChart.render( this, ( IAxisChartDataSet ) iAxisPlotDataSet ); } } /********************************************************************************************** * Currently, we only support the bar chart types being horizontal, and you can not have a * horizontally plotted bar chart in a combo chart. * * @throws PropertyException **********************************************************************************************/ private void validateHorizontalPlot() throws PropertyException { if( axisProperties.isPlotHorizontal() ) { //---if there is only one data set, there is no need to do any validations. if( this.iAxisDataSeries.size() > 1 ) { throw new PropertyException( "You can not have a combo chart on a horizontal plot." ); } if( !this.allowHorizontalPlot() ) { throw new PropertyException( "Horizontal plots are only supported in the Bar, Stacked Bar, and Clustered Bar Chart Types." ); } } } /****************************************************************************************** * We only allow horizontal plots for the Bar Chart types in this release. * * @return boolean ******************************************************************************************/ private boolean allowHorizontalPlot() { if( this.iAxisDataSeries.getIAxisPlotDataSet( ChartType.BAR ) != null ) { return true; } if( this.iAxisDataSeries.getIAxisPlotDataSet( ChartType.BAR_STACKED ) != null ) { return true; } if( this.iAxisDataSeries.getIAxisPlotDataSet( ChartType.BAR_CLUSTERED ) != null ) { return true; } return false; } /************************************************************************************************** * ***************************************************************************************************/ public AxisProperties getAxisProperties() { return this.axisProperties; } /************************************************************************************************** * ***************************************************************************************************/ public XAxis getXAxis() { return this.xAxis; } /************************************************************************************************** * ***************************************************************************************************/ public YAxis getYAxis() { return this.yAxis; } /********************************************************************************************** * Enables the testing routines to display the contents of this Object. Override Chart * implementation as PieCharts use AreaProperties directly rather than a child. * * @param htmlGenerator * @param imageFileName * @param imageMap if this is NULL we are not creating image map data in html **********************************************************************************************/ public void toHTML( HTMLGenerator htmlGenerator, String imageFileName, ImageMap imageMap ) { htmlGenerator.chartTableStart( this.getClass().getName(), imageFileName, imageMap ); if( this.iAxisDataSeries instanceof HTMLTestable ) { ( ( HTMLTestable ) this.iAxisDataSeries ).toHTML( htmlGenerator ); } //---AxisProperties htmlGenerator.chartTableRowStart(); this.axisProperties.toHTML( htmlGenerator ); htmlGenerator.chartTableRowEnd(); //---XAxis htmlGenerator.chartTableRowStart(); this.xAxis.toHTML( htmlGenerator ); htmlGenerator.chartTableRowEnd(); //---YAxis htmlGenerator.chartTableRowStart(); this.yAxis.toHTML( htmlGenerator ); htmlGenerator.chartTableRowEnd(); //---ChartProperties htmlGenerator.chartTableRowStart(); super.getChartProperties().toHTML( htmlGenerator ); htmlGenerator.chartTableRowEnd(); if( super.getLegend() != null ) { htmlGenerator.chartTableRowStart(); this.getLegend().toHTML( htmlGenerator ); htmlGenerator.chartTableRowEnd(); } htmlGenerator.chartTableEnd(); } } jcharts-0.7.5/src/org/jCharts/axisChart/BarChart.java0000644000175000001440000003405207751071402021454 0ustar onkarusers/*********************************************************************************************** * File Info: $Id: BarChart.java,v 1.22 2003/03/19 01:25:06 nathaniel_auvil Exp $ * Copyright (C) 2002 * Author: Nathaniel G. Auvil * Contributor(s): * * Copyright 2002 (C) Nathaniel G. Auvil. All Rights Reserved. * * Redistribution and use of this software and associated documentation ("Software"), with or * without modification, are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain copyright statements and notices. * Redistributions must also contain a copy of this document. * * 2. Redistributions in binary form must reproduce the above copyright notice, this list of * conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. * * 3. The name "jCharts" or "Nathaniel G. Auvil" must not be used to endorse or promote * products derived from this Software without prior written permission of Nathaniel G. * Auvil. For written permission, please contact nathaniel_auvil@users.sourceforge.net * * 4. Products derived from this Software may not be called "jCharts" nor may "jCharts" appear * in their names without prior written permission of Nathaniel G. Auvil. jCharts is a * registered trademark of Nathaniel G. Auvil. * * 5. Due credit should be given to the jCharts Project (http://jcharts.sourceforge.net/). * * THIS SOFTWARE IS PROVIDED BY Nathaniel G. Auvil AND CONTRIBUTORS ``AS IS'' AND ANY * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL * jCharts OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE ************************************************************************************************/ package org.jCharts.axisChart; import org.jCharts.axisChart.customRenderers.axisValue.AxisValueRenderEvent; import org.jCharts.chartData.interfaces.IAxisChartDataSet; import org.jCharts.imageMap.RectMapArea; import org.jCharts.properties.BarChartProperties; import org.jCharts.properties.DataAxisProperties; import java.awt.*; import java.awt.geom.Rectangle2D; abstract class BarChart { /******************************************************************************************** * Draws the chart * uses Rectangle2D......keep having rounding problems. * * @param axisChart * @param iAxisChartDataSet *********************************************************************************************/ static void render( AxisChart axisChart, IAxisChartDataSet iAxisChartDataSet ) { Graphics2D g2d = axisChart.getGraphics2D(); BarChartProperties barChartProperties = (BarChartProperties) iAxisChartDataSet.getChartTypeProperties(); DataAxisProperties dataAxisProperties; float barWidth; //---y axis position on screen to start drawing. float startingX; float startingY; float width; float height; if( axisChart.getAxisProperties().isPlotHorizontal() ) { dataAxisProperties = (DataAxisProperties) axisChart.getAxisProperties().getXAxisProperties(); barWidth = axisChart.getYAxis().getScalePixelWidth() * barChartProperties.getPercentage(); startingX = axisChart.getXAxis().getZeroLineCoordinate(); startingY = axisChart.getYAxis().getLastTickY() - (barWidth / 2); width = 0; height = barWidth; Rectangle2D.Float rectangle = new Rectangle2D.Float( startingX, startingY, width, height ); BarChart.horizontalPlot( axisChart, iAxisChartDataSet, barChartProperties, dataAxisProperties, g2d, rectangle, startingX ); } else { dataAxisProperties = (DataAxisProperties) axisChart.getAxisProperties().getYAxisProperties(); barWidth = axisChart.getXAxis().getScalePixelWidth() * barChartProperties.getPercentage(); startingX = axisChart.getXAxis().getTickStart() - (barWidth / 2); startingY = axisChart.getYAxis().getZeroLineCoordinate(); width = barWidth; height = 0; Rectangle2D.Float rectangle = new Rectangle2D.Float( startingX, startingY, width, height ); BarChart.verticalPlot( axisChart, iAxisChartDataSet, barChartProperties, dataAxisProperties, g2d, rectangle, startingY ); } } /********************************************************************************************* * * @param axisChart * @param iAxisChartDataSet * @param barChartProperties * @param dataAxisProperties * @param g2d * @param rectangle * @param startingX *********************************************************************************************/ private static void horizontalPlot( AxisChart axisChart, IAxisChartDataSet iAxisChartDataSet, BarChartProperties barChartProperties, DataAxisProperties dataAxisProperties, Graphics2D g2d, Rectangle2D.Float rectangle, float startingX ) { int imageMapLabelIndex = axisChart.getYAxis().getNumberOfScaleItems() - 1; //---setup the total area rectangle Rectangle2D.Float totalItemArea = new Rectangle2D.Float(); totalItemArea.y = axisChart.getYAxis().getOrigin() - axisChart.getYAxis().getPixelLength() + 1; totalItemArea.height = axisChart.getYAxis().getScalePixelWidth() - 1; totalItemArea.x = axisChart.getXAxis().getOrigin() + 1; totalItemArea.width = axisChart.getXAxis().getPixelLength() - 1; //---reuse the same Object for pre and post render events. AxisValueRenderEvent axisValueRenderEvent = new AxisValueRenderEvent( axisChart, iAxisChartDataSet, g2d, totalItemArea, axisChart.getXAxis().getZeroLineCoordinate() ); //---there is only ever one data set for a regular bar chart axisValueRenderEvent.setDataSetIndex( 0 ); //LOOP for( int i = 0; i < iAxisChartDataSet.getNumberOfDataItems(); i++ ) { //---reset the paint as it might have changed for the outline drawing g2d.setPaint( iAxisChartDataSet.getPaint( 0 ) ); //---set values for the preRender event axisValueRenderEvent.setValueX( axisChart.getXAxis().getZeroLineCoordinate() ); axisValueRenderEvent.setValueY( (float) rectangle.getCenterY() ); axisValueRenderEvent.setValueIndex( i ); //---we want to do this regardless if we render an item barChartProperties.firePreRender( axisValueRenderEvent ); //---if value == 0 do not plot anything. if( iAxisChartDataSet.getValue( 0, i ) != 0.0d ) { if( iAxisChartDataSet.getValue( 0, i ) < 0 ) { rectangle.x = axisChart.getXAxis().computeAxisCoordinate( axisChart.getXAxis().getOrigin(), iAxisChartDataSet.getValue( 0, i ), axisChart.getXAxis().getScaleCalculator().getMinValue() ); rectangle.width = startingX - rectangle.x; //---set values for the postRender event axisValueRenderEvent.setValueX( rectangle.x ); } else { rectangle.x = startingX; rectangle.width = BarChart.computeScaleHeightOfValue( iAxisChartDataSet.getValue( 0, i ), axisChart.getXAxis().getOneUnitPixelSize() ); //---set values for the postRender event axisValueRenderEvent.setValueX( rectangle.x + rectangle.width ); } //---with a user defined scale, we could have non-zero data points with a height of zero. if( rectangle.width != 0 ) { /* System.out.println( "rectangle.x= " + rectangle.x ); System.out.println( "rectangle.y= " + rectangle.y ); System.out.println( "rectangle.width= " + rectangle.width ); System.out.println( "rectangle.height= " + rectangle.height ); */ g2d.fill( rectangle ); if( barChartProperties.getShowOutlinesFlag() ) { barChartProperties.getBarOutlineStroke().draw( g2d, rectangle ); } //---if we are generating an ImageMap, store the image coordinates if( axisChart.getGenerateImageMapFlag() ) { String label; if( axisChart.getYAxis().getAxisLabelsGroup() != null ) { label = axisChart.getYAxis().getAxisLabelsGroup().getTextTag( imageMapLabelIndex ).getText(); } else { label = null; } axisChart.getImageMap().addImageMapArea( new RectMapArea( rectangle, iAxisChartDataSet.getValue( 0, i ), label, iAxisChartDataSet.getLegendLabel( 0 ) ) ); imageMapLabelIndex--; } } } //---notify everyone we just rendered barChartProperties.firePostRender( axisValueRenderEvent ); totalItemArea.y += axisChart.getYAxis().getScalePixelWidth(); rectangle.y += axisChart.getYAxis().getScalePixelWidth(); } } /************************************************************************************** * * @param axisChart * @param iAxisChartDataSet * @param barChartProperties * @param dataAxisProperties * @param g2d * @param rectangle * @param startingY **************************************************************************************/ private static void verticalPlot( AxisChart axisChart, IAxisChartDataSet iAxisChartDataSet, BarChartProperties barChartProperties, DataAxisProperties dataAxisProperties, Graphics2D g2d, Rectangle2D.Float rectangle, float startingY ) { //---setup the total area rectangle Rectangle2D.Float totalItemArea = new Rectangle2D.Float(); totalItemArea.x = axisChart.getXAxis().getOrigin() + 1; totalItemArea.y = axisChart.getYAxis().getOrigin() - axisChart.getYAxis().getPixelLength() + 1; totalItemArea.width = axisChart.getXAxis().getScalePixelWidth() - 1; totalItemArea.height = axisChart.getYAxis().getPixelLength() - 1; //---reuse the same Object for pre and post render events. AxisValueRenderEvent axisValueRenderEvent = new AxisValueRenderEvent( axisChart, iAxisChartDataSet, g2d, totalItemArea, axisChart.getYAxis().getZeroLineCoordinate() ); //---there is only ever one data set for a regular bar chart axisValueRenderEvent.setDataSetIndex( 0 ); //LOOP for( int i = 0; i < iAxisChartDataSet.getNumberOfDataItems(); i++ ) { //---reset the paint as it might have changed for the outline drawing g2d.setPaint( iAxisChartDataSet.getPaint( 0 ) ); //---set values for the preRender event axisValueRenderEvent.setValueX( (float) rectangle.getCenterX() ); axisValueRenderEvent.setValueY( axisChart.getYAxis().getZeroLineCoordinate() ); axisValueRenderEvent.setValueIndex( i ); //---we want to do this regardless if we render an item barChartProperties.firePreRender( axisValueRenderEvent ); //---if value == 0 do not plot anything. if( iAxisChartDataSet.getValue( 0, i ) != 0.0d ) { if( iAxisChartDataSet.getValue( 0, i ) < 0 ) { rectangle.y = startingY; rectangle.height = BarChart.computeScaleHeightOfValue( iAxisChartDataSet.getValue( 0, i ), axisChart.getYAxis().getOneUnitPixelSize() ); axisValueRenderEvent.setValueY( rectangle.y + rectangle.height ); } else { rectangle.y = axisChart.getYAxis().computeAxisCoordinate( axisChart.getYAxis().getOrigin(), iAxisChartDataSet.getValue( 0, i ), axisChart.getYAxis().getScaleCalculator().getMinValue() ); rectangle.height = startingY - rectangle.y; axisValueRenderEvent.setValueY( rectangle.y ); } //---with a user defined scale, we could have non-zero data points with a height of zero. if( rectangle.height != 0 ) { g2d.fill( rectangle ); if( barChartProperties.getShowOutlinesFlag() ) { barChartProperties.getBarOutlineStroke().draw( g2d, rectangle ); g2d.setPaint( iAxisChartDataSet.getPaint( 0 ) ); } //---if we are generating an ImageMap, store the image coordinates if( axisChart.getGenerateImageMapFlag() ) { String label; if( axisChart.getXAxis().getAxisLabelsGroup() != null ) { label = axisChart.getXAxis().getAxisLabelsGroup().getTextTag( i ).getText(); } else { label = null; } axisChart.getImageMap().addImageMapArea( new RectMapArea( rectangle, iAxisChartDataSet.getValue( 0, i ), label, iAxisChartDataSet.getLegendLabel( 0 ) ) ); } } } //---notify everyone we just rendered barChartProperties.firePostRender( axisValueRenderEvent ); totalItemArea.x += axisChart.getXAxis().getScalePixelWidth(); rectangle.x += axisChart.getXAxis().getScalePixelWidth(); } } /******************************************************************************************************* * Takes a value and determines the number of pixels it should fill on the screen. * If there is a user defined scale and the passed value is greater than the MAX or less than the MIN, * the height will be forced to the MAX or MIN respectively. * * @param value * @param oneUnitPixelSize * @return float the screen pixel coordinate ********************************************************************************************************/ static float computeScaleHeightOfValue( double value, double oneUnitPixelSize ) { return (float) Math.abs( (value) * oneUnitPixelSize ); } } jcharts-0.7.5/src/org/jCharts/axisChart/ClusteredBarChart.java0000644000175000001440000003411107751071402023323 0ustar onkarusers/*********************************************************************************************** * File Info: $Id: ClusteredBarChart.java,v 1.14 2003/03/19 01:25:06 nathaniel_auvil Exp $ * Copyright (C) 2002 * Author: Nathaniel G. Auvil * Contributor(s): * * Copyright 2002 (C) Nathaniel G. Auvil. All Rights Reserved. * * Redistribution and use of this software and associated documentation ("Software"), with or * without modification, are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain copyright statements and notices. * Redistributions must also contain a copy of this document. * * 2. Redistributions in binary form must reproduce the above copyright notice, this list of * conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. * * 3. The name "jCharts" or "Nathaniel G. Auvil" must not be used to endorse or promote * products derived from this Software without prior written permission of Nathaniel G. * Auvil. For written permission, please contact nathaniel_auvil@users.sourceforge.net * * 4. Products derived from this Software may not be called "jCharts" nor may "jCharts" appear * in their names without prior written permission of Nathaniel G. Auvil. jCharts is a * registered trademark of Nathaniel G. Auvil. * * 5. Due credit should be given to the jCharts Project (http://jcharts.sourceforge.net/). * * THIS SOFTWARE IS PROVIDED BY Nathaniel G. Auvil AND CONTRIBUTORS ``AS IS'' AND ANY * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL * jCharts OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE ************************************************************************************************/ package org.jCharts.axisChart; import org.jCharts.chartData.interfaces.IAxisChartDataSet; import org.jCharts.imageMap.RectMapArea; import org.jCharts.properties.*; import org.jCharts.axisChart.customRenderers.axisValue.AxisValueRenderEvent; import java.awt.*; import java.awt.geom.Rectangle2D; abstract class ClusteredBarChart { /******************************************************************************************** * Draws the chart * uses Rectangle2D......keep having rounding problems. * * @param axisChart * @param iAxisChartDataSet *********************************************************************************************/ static void render( AxisChart axisChart, IAxisChartDataSet iAxisChartDataSet ) { Graphics2D g2d = axisChart.getGraphics2D(); ClusteredBarChartProperties clusteredBarChartProperties = ( ClusteredBarChartProperties ) iAxisChartDataSet.getChartTypeProperties(); float barGroupWidth; float barWidth; //---y axis position on screen to start drawing. float startingY; float startingX; float width; float height; DataAxisProperties dataAxisProperties; if( axisChart.getAxisProperties().isPlotHorizontal() ) { dataAxisProperties = ( DataAxisProperties ) axisChart.getAxisProperties().getXAxisProperties(); barGroupWidth = axisChart.getYAxis().getScalePixelWidth() * clusteredBarChartProperties.getPercentage(); barWidth = barGroupWidth / iAxisChartDataSet.getNumberOfDataSets(); //---where the group of bars starts startingX = axisChart.getXAxis().getZeroLineCoordinate(); startingY = axisChart.getYAxis().getLastTickY() - ( barGroupWidth / 2 ); width = 0; height = barWidth; Rectangle2D.Float rectangle = new Rectangle2D.Float( startingX, startingY, width, height ); horizontalPlot( axisChart, iAxisChartDataSet, clusteredBarChartProperties, dataAxisProperties, g2d, rectangle, startingX, startingY, barWidth ); } else { dataAxisProperties = ( DataAxisProperties ) axisChart.getAxisProperties().getYAxisProperties(); barGroupWidth = axisChart.getXAxis().getScalePixelWidth() * clusteredBarChartProperties.getPercentage(); barWidth = barGroupWidth / iAxisChartDataSet.getNumberOfDataSets(); //---where the group of bars starts startingX = axisChart.getXAxis().getTickStart() - ( barGroupWidth / 2 ); startingY = axisChart.getYAxis().getZeroLineCoordinate(); width = barWidth; height = 0; Rectangle2D.Float rectangle = new Rectangle2D.Float( startingX, startingY, width, height ); verticalPlot( axisChart, iAxisChartDataSet, clusteredBarChartProperties, dataAxisProperties, g2d, rectangle, startingX, startingY, barWidth ); } } /******************************************************************************************* * * * @param axisChart * @param iAxisChartDataSet * @param clusteredBarChartProperties * @param dataAxisProperties * @param g2d * @param rectangle * @param startingX * @param startingY * @param barWidth ********************************************************************************************/ private static void horizontalPlot( AxisChart axisChart, IAxisChartDataSet iAxisChartDataSet, ClusteredBarChartProperties clusteredBarChartProperties, DataAxisProperties dataAxisProperties, Graphics2D g2d, Rectangle2D.Float rectangle, float startingX, float startingY, float barWidth ) { int imageMapLabelIndex = axisChart.getYAxis().getNumberOfScaleItems() - 1; //---setup the total area rectangle Rectangle2D.Float totalItemArea= new Rectangle2D.Float(); totalItemArea.y = axisChart.getYAxis().getOrigin() - axisChart.getYAxis().getPixelLength() + 1; totalItemArea.height= axisChart.getYAxis().getScalePixelWidth() - 1; totalItemArea.x= axisChart.getXAxis().getOrigin() + 1; totalItemArea.width= axisChart.getXAxis().getPixelLength() - 1; //---reuse the same Object for pre and post render events. AxisValueRenderEvent axisValueRenderEvent= new AxisValueRenderEvent( axisChart, iAxisChartDataSet, g2d, totalItemArea, axisChart.getXAxis().getZeroLineCoordinate() ); //LOOP for( int i = 0; i < iAxisChartDataSet.getNumberOfDataItems(); i++ ) { for( int j = 0; j < iAxisChartDataSet.getNumberOfDataSets(); j++ ) { g2d.setPaint( iAxisChartDataSet.getPaint( j ) ); //---there is only ever one data set for a regular bar chart axisValueRenderEvent.setDataSetIndex( j ); //---set values for the preRender event axisValueRenderEvent.setValueX( axisChart.getXAxis().getZeroLineCoordinate() ); axisValueRenderEvent.setValueY( (float) rectangle.getCenterY() ); axisValueRenderEvent.setValueIndex( i ); //---we want to do this regardless if we render an item clusteredBarChartProperties.firePreRender( axisValueRenderEvent ); //---if value == 0 do not plot anything. if( iAxisChartDataSet.getValue( j, i ) != 0.0d ) { if( iAxisChartDataSet.getValue( j, i ) < 0 ) { rectangle.x = axisChart.getXAxis().computeAxisCoordinate( axisChart.getXAxis().getOrigin(), iAxisChartDataSet.getValue( j, i ), axisChart.getXAxis().getScaleCalculator().getMinValue() ); rectangle.width = startingX - rectangle.x; //---set values for the postRender event axisValueRenderEvent.setValueX( rectangle.x ); } else { rectangle.x = startingX; rectangle.width = BarChart.computeScaleHeightOfValue( iAxisChartDataSet.getValue( j, i ), axisChart.getXAxis().getOneUnitPixelSize() ); //---set values for the postRender event axisValueRenderEvent.setValueX( rectangle.x + rectangle.width ); } //---with a user defined scale, we could have non-zero data points with a height of zero. if( rectangle.width != 0 ) { g2d.fill( rectangle ); if( clusteredBarChartProperties.getShowOutlinesFlag() ) { clusteredBarChartProperties.getBarOutlineStroke().draw( g2d, rectangle ); } //---if we are generating an ImageMap, store the image coordinates if( axisChart.getGenerateImageMapFlag() ) { String label; if( axisChart.getYAxis().getAxisLabelsGroup() != null ) { label= axisChart.getYAxis().getAxisLabelsGroup().getTextTag( imageMapLabelIndex ).getText(); } else { label= null; } axisChart.getImageMap().addImageMapArea( new RectMapArea( rectangle, iAxisChartDataSet.getValue( j, i ), label, iAxisChartDataSet.getLegendLabel( j ) ) ); } } } //---notify everyone we just rendered clusteredBarChartProperties.firePostRender( axisValueRenderEvent ); rectangle.y += barWidth; } imageMapLabelIndex--; startingY += axisChart.getYAxis().getScalePixelWidth(); rectangle.y = startingY; totalItemArea.y+= axisChart.getYAxis().getScalePixelWidth(); } } /************************************************************************************** * * @param axisChart * @param iAxisChartDataSet * @param barChartProperties * @param dataAxisProperties * @param g2d * @param rectangle * @param startingY **************************************************************************************/ private static void verticalPlot( AxisChart axisChart, IAxisChartDataSet iAxisChartDataSet, BarChartProperties barChartProperties, DataAxisProperties dataAxisProperties, Graphics2D g2d, Rectangle2D.Float rectangle, float barGroupStartingX, float startingY, float barWidth ) { //---setup the total area rectangle Rectangle2D.Float totalItemArea= new Rectangle2D.Float(); totalItemArea.x= axisChart.getXAxis().getOrigin() + 1; totalItemArea.y = axisChart.getYAxis().getOrigin() - axisChart.getYAxis().getPixelLength() + 1; totalItemArea.width= axisChart.getXAxis().getScalePixelWidth() - 1; totalItemArea.height= axisChart.getYAxis().getPixelLength() - 1; //---reuse the same Object for pre and post render events. AxisValueRenderEvent axisValueRenderEvent= new AxisValueRenderEvent( axisChart, iAxisChartDataSet, g2d, totalItemArea, axisChart.getYAxis().getZeroLineCoordinate() ); //LOOP for( int i = 0; i < iAxisChartDataSet.getNumberOfDataItems(); i++ ) { for( int j = 0; j < iAxisChartDataSet.getNumberOfDataSets(); j++ ) { g2d.setPaint( iAxisChartDataSet.getPaint( j ) ); //---there is only ever one data set for a regular bar chart axisValueRenderEvent.setDataSetIndex( j ); //---if value == 0 do not plot anything. if( iAxisChartDataSet.getValue( j, i ) != 0.0d ) { //---set values for the preRender event axisValueRenderEvent.setValueX( (float) rectangle.getCenterX() ); axisValueRenderEvent.setValueY( axisChart.getYAxis().getZeroLineCoordinate() ); axisValueRenderEvent.setValueIndex( i ); //---we want to do this regardless if we render an item barChartProperties.firePreRender( axisValueRenderEvent ); if( iAxisChartDataSet.getValue( j, i ) < 0 ) { rectangle.y = startingY; rectangle.height = BarChart.computeScaleHeightOfValue( iAxisChartDataSet.getValue( j, i ), axisChart.getYAxis().getOneUnitPixelSize() ); //---set values for the postRender event axisValueRenderEvent.setValueY( rectangle.y + rectangle.height ); } else { rectangle.y = axisChart.getYAxis().computeAxisCoordinate( axisChart.getYAxis().getOrigin(), iAxisChartDataSet.getValue( j, i ), axisChart.getYAxis().getScaleCalculator().getMinValue() ); rectangle.height = startingY - rectangle.y; //---set values for the postRender event axisValueRenderEvent.setValueY( rectangle.y ); } //---with a user defined scale, we could have non-zero data points with a height of zero. if( rectangle.height != 0 ) { g2d.fill( rectangle ); if( barChartProperties.getShowOutlinesFlag() ) { barChartProperties.getBarOutlineStroke().draw( g2d, rectangle ); } //---if we are generating an ImageMap, store the image coordinates if( axisChart.getGenerateImageMapFlag() ) { String label; if( axisChart.getXAxis().getAxisLabelsGroup() != null ) { label= axisChart.getXAxis().getAxisLabelsGroup().getTextTag( i ).getText(); } else { label= null; } axisChart.getImageMap().addImageMapArea( new RectMapArea( rectangle, iAxisChartDataSet.getValue( j, i ), label, iAxisChartDataSet.getLegendLabel( j ) ) ); } } } //---notify everyone we just rendered barChartProperties.firePostRender( axisValueRenderEvent ); rectangle.x += barWidth; } totalItemArea.x+= axisChart.getXAxis().getScalePixelWidth(); barGroupStartingX += axisChart.getXAxis().getScalePixelWidth(); rectangle.x = barGroupStartingX; } } } jcharts-0.7.5/src/org/jCharts/axisChart/LineChart.java0000644000175000001440000002163607751071402021643 0ustar onkarusers/*********************************************************************************************** * File Info: $Id: LineChart.java,v 1.15 2003/09/26 01:01:01 nathaniel_auvil Exp $ * Copyright (C) 2002 * Author: Nathaniel G. Auvil * Contributor(s): * * Copyright 2002 (C) Nathaniel G. Auvil. All Rights Reserved. * * Redistribution and use of this software and associated documentation ("Software"), with or * without modification, are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain copyright statements and notices. * Redistributions must also contain a copy of this document. * * 2. Redistributions in binary form must reproduce the above copyright notice, this list of * conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. * * 3. The name "jCharts" or "Nathaniel G. Auvil" must not be used to endorse or promote * products derived from this Software without prior written permission of Nathaniel G. * Auvil. For written permission, please contact nathaniel_auvil@users.sourceforge.net * * 4. Products derived from this Software may not be called "jCharts" nor may "jCharts" appear * in their names without prior written permission of Nathaniel G. Auvil. jCharts is a * registered trademark of Nathaniel G. Auvil. * * 5. Due credit should be given to the jCharts Project (http://jcharts.sourceforge.net/). * * THIS SOFTWARE IS PROVIDED BY Nathaniel G. Auvil AND CONTRIBUTORS ``AS IS'' AND ANY * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL * jCharts OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE ************************************************************************************************/ package org.jCharts.axisChart; import org.jCharts.chartData.interfaces.IAxisChartDataSet; import org.jCharts.chartData.interfaces.IDataSeries; import org.jCharts.imageMap.CircleMapArea; import org.jCharts.properties.*; import java.awt.*; import java.awt.geom.*; abstract class LineChart { /******************************************************************************************** * Draws the chart * * @param axisChart * @param iAxisChartDataSet * @throws PropertyException *********************************************************************************************/ static void render( AxisChart axisChart, IAxisChartDataSet iAxisChartDataSet ) throws PropertyException { Graphics2D g2d=axisChart.getGraphics2D(); LineChartProperties lineChartProperties=(LineChartProperties) iAxisChartDataSet.getChartTypeProperties(); lineChartProperties.validate( iAxisChartDataSet ); //DataAxisProperties dataAxisProperties= (DataAxisProperties) axisChart.getAxisProperties().getYAxisProperties(); IDataSeries iDataSeries= (IDataSeries) axisChart.getIAxisDataSeries(); //---cache the computed values float[][] yAxisCoordinates=new float[ iAxisChartDataSet.getNumberOfDataSets() ][ iAxisChartDataSet.getNumberOfDataItems() ]; //---need this for image map calculation float xMapCoordinate=axisChart.getXAxis().getTickStart(); //LOOP for( int j=0; j < iAxisChartDataSet.getNumberOfDataItems(); j++ ) { //LOOP for( int i=0; i < yAxisCoordinates.length; i++ ) { if( iAxisChartDataSet.getValue( i, j ) != Double.NaN ) { yAxisCoordinates[ i ][ j ]= axisChart.getYAxis().computeAxisCoordinate( axisChart.getYAxis().getOrigin(), iAxisChartDataSet.getValue( i, j ), axisChart.getYAxis().getScaleCalculator().getMinValue() ); //---if we are generating an ImageMap, store the image coordinates if( axisChart.getGenerateImageMapFlag() ) { String label; if( axisChart.getXAxis().getAxisLabelsGroup() != null ) { label = axisChart.getXAxis().getAxisLabelsGroup().getTextTag( j ).getText(); } else { label = null; } axisChart.getImageMap().addImageMapArea( new CircleMapArea( xMapCoordinate, yAxisCoordinates[ i ][ j ], iAxisChartDataSet.getValue( i, j ), label, iAxisChartDataSet.getLegendLabel( i ) ) ); } } else { yAxisCoordinates[ i ][ j ]=Float.NaN; } } xMapCoordinate+=axisChart.getXAxis().getScalePixelWidth(); } AffineTransform originalTransform=null; double[] cornerXOffset=null; double[] cornerYOffset=null; //---check if there are any points to display if( lineChartProperties.getShapes() != null ) { //---when centering the shapes on the points, need x and y offset to do this cornerXOffset=new double[ iAxisChartDataSet.getNumberOfDataSets() ]; cornerYOffset=new double[ iAxisChartDataSet.getNumberOfDataSets() ]; //---get the original transform so can reset it. originalTransform=g2d.getTransform(); Rectangle2D rectangle; //LOOP //---pre-compute the dimensions of each Shape so do not do it in loop. for( int i=0; i < iAxisChartDataSet.getNumberOfDataSets(); i++ ) { if( lineChartProperties.getShapes()[ i ] != null ) { rectangle=lineChartProperties.getShapes()[ i ].getBounds2D(); cornerXOffset[ i ]=rectangle.getWidth() / 2; cornerYOffset[ i ]=rectangle.getHeight() / 2; } } } //---init for first segment Line2D.Float line=new Line2D.Float( axisChart.getXAxis().getTickStart(), yAxisCoordinates[ 0 ][ 0 ], axisChart.getXAxis().getTickStart(), yAxisCoordinates[ 0 ][ 0 ] ); //---make sure not plotting a chart with only one data point. if( yAxisCoordinates[ 0 ].length > 1 ) { line.y2= yAxisCoordinates[ 0 ][ 1 ]; } //LOOP //---draw each line to the image for( int i=0; i < yAxisCoordinates.length; i++ ) { line.x1=axisChart.getXAxis().getTickStart(); line.y1=yAxisCoordinates[ i ][ 0 ]; line.x2=line.x1; //LOOP for( int j=1; j < yAxisCoordinates[ 0 ].length; j++ ) { //---if current point on line should be drawn if( !Float.isNaN( yAxisCoordinates[ i ][ j ] ) ) { //---if the previous point was not drawn, no line if( Float.isNaN( yAxisCoordinates[ i ][ j - 1 ] ) ) { line.x2+=axisChart.getXAxis().getScalePixelWidth(); line.x1=line.x2; line.y1=yAxisCoordinates[ i ][ j ]; line.y2=yAxisCoordinates[ i ][ j ]; continue; } line.x2+=axisChart.getXAxis().getScalePixelWidth(); line.y2=yAxisCoordinates[ i ][ j ]; g2d.setPaint( iAxisChartDataSet.getPaint( i ) ); g2d.setStroke( lineChartProperties.getLineStrokes()[ i ] ); g2d.draw( line ); //---plot the Point if( lineChartProperties.getShapes()[ i ] != null ) { //---translate the Shape into position. g2d.translate( line.x1 - cornerXOffset[ i ], line.y1 - cornerYOffset[ i ] ); g2d.setPaint( iAxisChartDataSet.getPaint( i ) ); g2d.fill( lineChartProperties.getShapes()[ i ] ); //---translate back to the original position g2d.setTransform( originalTransform ); } line.x1=line.x2; line.y1=line.y2; } else { if( ( !Float.isNaN( yAxisCoordinates[ i ][ j - 1 ] ) ) && ( lineChartProperties.getShapes()[ i ] != null ) ) { //---translate the Shape into position. g2d.translate( line.x1 - cornerXOffset[ i ], line.y1 - cornerYOffset[ i ] ); g2d.setPaint( iAxisChartDataSet.getPaint( i ) ); g2d.fill( lineChartProperties.getShapes()[ i ] ); //---translate back to the original position g2d.setTransform( originalTransform ); } line.x2+=axisChart.getXAxis().getScalePixelWidth(); line.x1=line.x2; } } //---put the last shape on the line if( ( !Float.isNaN( yAxisCoordinates[ i ][ yAxisCoordinates[ i ].length - 1 ] ) ) && ( lineChartProperties.getShapes()[ i ] != null ) ) { //---translate the Shape into position. g2d.translate( line.x2 - cornerXOffset[ i ], line.y2 - cornerYOffset[ i ] ); g2d.setPaint( iAxisChartDataSet.getPaint( i ) ); g2d.fill( lineChartProperties.getShapes()[ i ] ); //---translate back to the original position g2d.setTransform( originalTransform ); } } } } jcharts-0.7.5/src/org/jCharts/axisChart/PointChart.java0000644000175000001440000001550507751071402022043 0ustar onkarusers/*********************************************************************************************** * File Info: $Id: PointChart.java,v 1.9 2003/03/19 01:38:36 nathaniel_auvil Exp $ * Copyright (C) 2000 * Author: Nathaniel G. Auvil * Contributor(s): * * Copyright 2002 (C) Nathaniel G. Auvil. All Rights Reserved. * * Redistribution and use of this software and associated documentation * ("Software"), with or without modification, are permitted provided * that the following conditions are met: * * 1. Redistributions of source code must retain copyright * statements and notices. Redistributions must also contain a * copy of this document. * * 2. Redistributions in binary form must reproduce the * above copyright notice, this list of conditions and the * following disclaimer in the documentation and/or other * materials provided with the distribution. * * 3. The name "jCharts" or "Nathaniel G. Auvil" must not be used to * endorse or promote products derived from this Software without * prior written permission of Nathaniel G. Auvil. For written * permission, please contact nathaniel_auvil@users.sourceforge.net * * 4. Products derived from this Software may not be called "jCharts" * nor may "jCharts" appear in their names without prior written * permission of Nathaniel G. Auvil. jCharts is a registered * trademark of Nathaniel G. Auvil. * * 5. Due credit should be given to the jCharts Project * (http://jcharts.sourceforge.net/). * * THIS SOFTWARE IS PROVIDED BY Nathaniel G. Auvil AND CONTRIBUTORS * ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT * NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL * jCharts OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED * OF THE POSSIBILITY OF SUCH DAMAGE. ************************************************************************************************/ package org.jCharts.axisChart; import org.jCharts.chartData.interfaces.IAxisChartDataSet; import org.jCharts.chartData.interfaces.IDataSeries; import org.jCharts.imageMap.CircleMapArea; import org.jCharts.properties.PointChartProperties; import org.jCharts.properties.DataAxisProperties; import java.awt.*; import java.awt.geom.AffineTransform; import java.awt.geom.Rectangle2D; abstract class PointChart { /******************************************************************************************** * Draws the chart * * @param axisChart * @param iAxisChartDataSet *********************************************************************************************/ static void render( AxisChart axisChart, IAxisChartDataSet iAxisChartDataSet ) { Graphics2D g2d=axisChart.getGraphics2D(); PointChartProperties pointChartProperties=(PointChartProperties) iAxisChartDataSet.getChartTypeProperties(); //---Point Charts can not be horizontal so we know the y-axis is DataAxisProperties DataAxisProperties dataAxisProperties= (DataAxisProperties) axisChart.getAxisProperties().getYAxisProperties(); IDataSeries iDataSeries= (IDataSeries) axisChart.getIAxisDataSeries(); float xPosition=axisChart.getXAxis().getTickStart(); float yPosition; //---when centering the shapes on the points, need x and y offset to do this double[] cornerXOffset=new double[ iAxisChartDataSet.getNumberOfDataSets() ]; double[] cornerYOffset=new double[ iAxisChartDataSet.getNumberOfDataSets() ]; //---get the original transform so can reset it. AffineTransform affineTransform=g2d.getTransform(); Rectangle2D rectangle; //LOOP //---pre-compute the dimensions of each Shape so do not do it in loop. for( int i=0; i < iAxisChartDataSet.getNumberOfDataSets(); i++ ) { rectangle=pointChartProperties.getShape( i ).getBounds2D(); cornerXOffset[ i ]=rectangle.getWidth() / 2; cornerYOffset[ i ]=rectangle.getHeight() / 2; } g2d.setStroke( PointChartProperties.DEFAULT_POINT_BORDER_STROKE ); //LOOP //---for each item in data set... for( int i=0; i < iAxisChartDataSet.getNumberOfDataItems(); i++ ) { //LOOP //---for each data set for( int dataSetIndex=0; dataSetIndex < iAxisChartDataSet.getNumberOfDataSets(); dataSetIndex++ ) { //---if the value is NaN, do not display a value if( Double.isNaN( iAxisChartDataSet.getValue( dataSetIndex, i ) ) ) { continue; } yPosition= axisChart.getYAxis().computeAxisCoordinate( axisChart.getYAxis().getOrigin(), iAxisChartDataSet.getValue( dataSetIndex, i ), axisChart.getYAxis().getScaleCalculator().getMinValue() ); //---if we are generating an ImageMap, store the image coordinates if( axisChart.getGenerateImageMapFlag() ) { String label; if( axisChart.getXAxis().getAxisLabelsGroup() != null ) { label = axisChart.getXAxis().getAxisLabelsGroup().getTextTag( i ).getText(); } else { label = null; } axisChart.getImageMap().addImageMapArea( new CircleMapArea( xPosition, yPosition, iAxisChartDataSet.getValue( dataSetIndex, i ), label, iAxisChartDataSet.getLegendLabel( dataSetIndex ) ) ); } //---translate the Shape into position. g2d.translate( xPosition - cornerXOffset[ dataSetIndex ], yPosition - cornerYOffset[ dataSetIndex ] ); g2d.setPaint( iAxisChartDataSet.getPaint( dataSetIndex ) ); //---render the point if( pointChartProperties.getFillPointsFlag( dataSetIndex ) ) { //---fill the point g2d.fill( pointChartProperties.getShape( dataSetIndex ) ); //---if we are filling the points, see if we should outline the Shape if( pointChartProperties.getPointOutlinePaints( dataSetIndex ) != null ) { g2d.setPaint( pointChartProperties.getPointOutlinePaints( dataSetIndex ) ); g2d.draw( pointChartProperties.getShape( dataSetIndex ) ); } } else { //---if we are NOT filling the points, use the Paint specified with the DataSet to outline. g2d.draw( pointChartProperties.getShape( dataSetIndex ) ); } g2d.setTransform( affineTransform ); } //---move right to the next x-axis scale item xPosition+=axisChart.getXAxis().getScalePixelWidth(); } } } jcharts-0.7.5/src/org/jCharts/axisChart/ScatterPlotAxisChart.java0000644000175000001440000003157107751071402024044 0ustar onkarusers/*********************************************************************************************** * File Info: $Id: ScatterPlotAxisChart.java,v 1.6 2003/06/20 01:55:19 nathaniel_auvil Exp $ * Copyright (C) 2002 * Author: Nathaniel G. Auvil * Contributor(s): * * Copyright 2002 (C) Nathaniel G. Auvil. All Rights Reserved. * * Redistribution and use of this software and associated documentation ("Software"), with or * without modification, are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain copyright statements and notices. * Redistributions must also contain a copy of this document. * * 2. Redistributions in binary form must reproduce the above copyright notice, this list of * conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. * * 3. The name "jCharts" or "Nathaniel G. Auvil" must not be used to endorse or promote * products derived from this Software without prior written permission of Nathaniel G. * Auvil. For written permission, please contact nathaniel_auvil@users.sourceforge.net * * 4. Products derived from this Software may not be called "jCharts" nor may "jCharts" appear * in their names without prior written permission of Nathaniel G. Auvil. jCharts is a * registered trademark of Nathaniel G. Auvil. * * 5. Due credit should be given to the jCharts Project (http://jcharts.sourceforge.net/). * * THIS SOFTWARE IS PROVIDED BY Nathaniel G. Auvil AND CONTRIBUTORS ``AS IS'' AND ANY * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL * jCharts OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE ************************************************************************************************/ package org.jCharts.axisChart; import org.jCharts.axisChart.axis.*; import org.jCharts.axisChart.axis.scale.*; import org.jCharts.chartData.interfaces.*; import org.jCharts.chartData.processors.AxisChartDataProcessor; import org.jCharts.chartData.processors.ScatterPlotDataProcessor; import org.jCharts.chartText.NumericTagGroup; import org.jCharts.imageMap.ImageMap; import org.jCharts.properties.*; import org.jCharts.test.HTMLChartTestable; import org.jCharts.test.HTMLGenerator; import org.jCharts.types.ChartType; import java.awt.font.FontRenderContext; /**************************************************************************************************** * This Class is used to create all axis chart types. This class knows how to render charts based on * the ChartType specified in on the iAxisChartDataSet. * *****************************************************************************************************/ public class ScatterPlotAxisChart extends AxisChart implements HTMLChartTestable { /************************************************************************************************** * Constructor * * @param iScatterPlotDataSeries * @param chartProperties * @param axisProperties * @param legendProperties if no legend is desired, pass NULL * @param pixelWidth * @param pixelHeight ***************************************************************************************************/ public ScatterPlotAxisChart( IScatterPlotDataSeries iScatterPlotDataSeries, ChartProperties chartProperties, AxisProperties axisProperties, LegendProperties legendProperties, int pixelWidth, int pixelHeight ) { super( iScatterPlotDataSeries, chartProperties, axisProperties, legendProperties, pixelWidth, pixelHeight ); } /******************************************************************************************** * ScatterPlots create a subclass of AxisChartDataProcessor so we need this method so we can * overload it. * * @return AxisChartDataProcessor ********************************************************************************************/ public AxisChartDataProcessor createAxisChartDataProcessor() { return new ScatterPlotDataProcessor(); } /************************************************************************************************ * Once we determine which axis is the data axis, the logic to set it up is the same whether it * is a horizontal or vertical plot. * * @param dataAxisProperties * @param axisChartDataProcessor * @param fontRenderContext * @return NumericTagGroup need to set this on the right axis ************************************************************************************************/ protected NumericTagGroup setupDataAxisProperties( Axis axis, DataAxisProperties dataAxisProperties, AxisChartDataProcessor axisChartDataProcessor, FontRenderContext fontRenderContext ) { //---we know this is of this type ScatterPlotDataProcessor scatterPlotDataProcessor= (ScatterPlotDataProcessor) axisChartDataProcessor; if( dataAxisProperties.getScaleCalculator() == null ) { ScaleCalculator s; if( dataAxisProperties.hasUserDefinedScale() ) { s = new UserDefinedScaleCalculator( dataAxisProperties.getUserDefinedMinimumValue(), dataAxisProperties.getUserDefinedIncrement() ); } else { s = new AutomaticScaleCalculator(); if( axis instanceof XAxis ) { s.setMaxValue( scatterPlotDataProcessor.getMaxValue() ); s.setMinValue( scatterPlotDataProcessor.getMinValue() ); } else { s.setMaxValue( scatterPlotDataProcessor.getyMax() ); s.setMinValue( scatterPlotDataProcessor.getyMin() ); } } axis.setScaleCalculator( s ); } else { axis.setScaleCalculator( dataAxisProperties.getScaleCalculator() ); if( axis instanceof XAxis ) { axis.getScaleCalculator().setMaxValue( scatterPlotDataProcessor.getMaxValue() ); axis.getScaleCalculator().setMinValue( scatterPlotDataProcessor.getMinValue() ); } else { axis.getScaleCalculator().setMaxValue( scatterPlotDataProcessor.getyMax() ); axis.getScaleCalculator().setMinValue( scatterPlotDataProcessor.getyMin() ); } } axis.getScaleCalculator().setRoundingPowerOfTen( dataAxisProperties.getRoundToNearest() ); axis.getScaleCalculator().setNumberOfScaleItems( dataAxisProperties.getNumItems() ); axis.getScaleCalculator().computeScaleValues(); //TODO what if they do not want to display axis labels? NumericTagGroup numericTagGroup = new NumericTagGroup( dataAxisProperties.getScaleChartFont(), fontRenderContext, dataAxisProperties.useDollarSigns(), dataAxisProperties.usePercentSigns(), dataAxisProperties.useCommas(), dataAxisProperties.getRoundToNearest() ); numericTagGroup.createAxisScaleLabels( axis.getScaleCalculator() ); return numericTagGroup; } /*************************************************************************************** * * * @param axisChartDataProcessor * @param fontRenderContext **************************************************************************************/ protected void setupAxis( AxisChartDataProcessor axisChartDataProcessor, FontRenderContext fontRenderContext ) { //---X AXIS--------------------------------------------------------------------------- DataAxisProperties dataAxisProperties = (DataAxisProperties) this.getAxisProperties().getXAxisProperties(); this.xAxis = new XAxis( this, dataAxisProperties.getNumItems() ); NumericTagGroup numericTagGroup = this.setupDataAxisProperties( this.xAxis, dataAxisProperties, axisChartDataProcessor, fontRenderContext ); this.xAxis.setAxisLabelsGroup( numericTagGroup ); //---Y AXIS--------------------------------------------------------------------------- dataAxisProperties = (DataAxisProperties) this.getAxisProperties().getYAxisProperties(); this.yAxis = new YAxis( this, dataAxisProperties.getNumItems() ); numericTagGroup = this.setupDataAxisProperties( this.yAxis, dataAxisProperties, axisChartDataProcessor, fontRenderContext ); this.yAxis.setAxisLabelsGroup( numericTagGroup ); //---if yAxisTitle is null, do not show title this.yAxis.computeMinimumWidthNeeded( super.getIAxisDataSeries().getYAxisTitle() ); this.xAxis.computeMinimumHeightNeeded( super.getIAxisDataSeries().getXAxisTitle() ); } /****************************************************************************************** * *****************************************************************************************/ protected void deriveAxisValues() { //---Determine how many labels will fit on the x-axis //TODO should we do this also for the YAxis? //todo what if they do not want labels on the x-axis? this.xAxis.computeLabelFilter(); this.xAxis.computeShouldTickStartAtYAxis( super.getIAxisDataSeries(), this.axisProperties.getXAxisProperties() ); //---X Axis-------------------- DataAxisProperties dataAxisProperties = (DataAxisProperties) this.axisProperties.getXAxisProperties(); this.xAxis.computeScalePixelWidthDataAxis(); this.xAxis.computeOneUnitPixelSize( this.xAxis.getScalePixelWidth(), this.xAxis.getScaleCalculator().getIncrement() ); //---we ADD to the origin position when doing x-axis float zeroLineCoordinate = (float) (this.xAxis.getOrigin() + (this.xAxis.getScalePixelWidth() * (-this.xAxis.getScaleCalculator().getMinValue())) / this.xAxis.getScaleCalculator().getIncrement()); this.xAxis.setZeroLineCoordinate( zeroLineCoordinate ); //---Y Axis-------------------- dataAxisProperties = (DataAxisProperties) this.axisProperties.getYAxisProperties(); this.yAxis.computeScalePixelWidthDataAxis(); this.yAxis.computeOneUnitPixelSize( this.yAxis.getScalePixelWidth(), this.yAxis.getScaleCalculator().getIncrement() ); //---we SUBTRACT to the origin position when doing y-axis zeroLineCoordinate = (float) (this.yAxis.getOrigin() - (this.yAxis.getScalePixelWidth() * (-this.yAxis.getScaleCalculator().getMinValue())) / this.yAxis.getScaleCalculator().getIncrement()); this.yAxis.setZeroLineCoordinate( zeroLineCoordinate ); this.xAxis.computeTickStart(); } /******************************************************************************************** * Draws the charts over the axis. We have to render in a specific order so combo charts * get drawn correctly * * @throws PropertyException ******************************************************************************************/ protected void overlayCharts() throws PropertyException { IAxisPlotDataSet iAxisPlotDataSet = super.getIAxisDataSeries().getIAxisPlotDataSet( ChartType.SCATTER_PLOT ); ScatterPlotChart.render( this, (IScatterPlotDataSet) iAxisPlotDataSet ); } /********************************************************************************************** * Enables the testing routines to display the contents of this Object. Override Chart * implementation as PieCharts use AreaProperties directly rather than a child. * * @param htmlGenerator * @param imageFileName * @param imageMap if this is NULL we are not creating image map data in html **********************************************************************************************/ public void toHTML( HTMLGenerator htmlGenerator, String imageFileName, ImageMap imageMap ) { htmlGenerator.chartTableStart( this.getClass().getName(), imageFileName, imageMap ); /* if( iDataSeries instanceof HTMLTestable ) { ( ( HTMLTestable ) this.iDataSeries ).toHTML( htmlGenerator ); } */ //---AxisProperties htmlGenerator.chartTableRowStart(); this.axisProperties.toHTML( htmlGenerator ); htmlGenerator.chartTableRowEnd(); //---XAxis htmlGenerator.chartTableRowStart(); this.xAxis.toHTML( htmlGenerator ); htmlGenerator.chartTableRowEnd(); //---YAxis htmlGenerator.chartTableRowStart(); this.yAxis.toHTML( htmlGenerator ); htmlGenerator.chartTableRowEnd(); //---ChartProperties htmlGenerator.chartTableRowStart(); super.getChartProperties().toHTML( htmlGenerator ); htmlGenerator.chartTableRowEnd(); if( super.getLegend() != null ) { htmlGenerator.chartTableRowStart(); this.getLegend().toHTML( htmlGenerator ); htmlGenerator.chartTableRowEnd(); } htmlGenerator.chartTableEnd(); } } jcharts-0.7.5/src/org/jCharts/axisChart/ScatterPlotChart.java0000644000175000001440000002301407751071402023210 0ustar onkarusers/*********************************************************************************************** * File Info: $Id: ScatterPlotChart.java,v 1.3 2003/11/02 13:23:11 nathaniel_auvil Exp $ * Copyright (C) 2002 * Author: Nathaniel G. Auvil * Contributor(s): * * Copyright 2002 (C) Nathaniel G. Auvil. All Rights Reserved. * * Redistribution and use of this software and associated documentation ("Software"), with or * without modification, are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain copyright statements and notices. * Redistributions must also contain a copy of this document. * * 2. Redistributions in binary form must reproduce the above copyright notice, this list of * conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. * * 3. The name "jCharts" or "Nathaniel G. Auvil" must not be used to endorse or promote * products derived from this Software without prior written permission of Nathaniel G. * Auvil. For written permission, please contact nathaniel_auvil@users.sourceforge.net * * 4. Products derived from this Software may not be called "jCharts" nor may "jCharts" appear * in their names without prior written permission of Nathaniel G. Auvil. jCharts is a * registered trademark of Nathaniel G. Auvil. * * 5. Due credit should be given to the jCharts Project (http://jcharts.sourceforge.net/). * * THIS SOFTWARE IS PROVIDED BY Nathaniel G. Auvil AND CONTRIBUTORS ``AS IS'' AND ANY * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL * jCharts OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE ************************************************************************************************/ package org.jCharts.axisChart; import org.jCharts.chartData.interfaces.*; import org.jCharts.imageMap.CircleMapArea; import org.jCharts.properties.*; import java.awt.*; import java.awt.geom.*; abstract class ScatterPlotChart { /******************************************************************************************** * Draws the chart * * @param scatterPlotAxisChart * @param iScatterPlotDataSet *********************************************************************************************/ static void render( ScatterPlotAxisChart scatterPlotAxisChart, IScatterPlotDataSet iScatterPlotDataSet ) { //---cache the computed values float[][] xAxisCoordinates = new float[ iScatterPlotDataSet.getNumberOfDataSets() ][ iScatterPlotDataSet.getNumberOfDataItems() ]; float[][] yAxisCoordinates = new float[ iScatterPlotDataSet.getNumberOfDataSets() ][ iScatterPlotDataSet.getNumberOfDataItems() ]; //System.out.println( "x origin= " + scatterPlotAxisChart.getXAxis().getOrigin() + " y origin= " + scatterPlotAxisChart.getYAxis().getOrigin() ); //LOOP for( int index = 0; index < iScatterPlotDataSet.getNumberOfDataItems(); index++ ) { //LOOP for( int dataSet = 0; dataSet < yAxisCoordinates.length; dataSet++ ) { if( iScatterPlotDataSet.getValue( dataSet, index ) != null ) { xAxisCoordinates[ dataSet ][ index ] = scatterPlotAxisChart.getXAxis().computeAxisCoordinate( scatterPlotAxisChart.getXAxis().getOrigin(), iScatterPlotDataSet.getValue( dataSet, index ).getX(), scatterPlotAxisChart.getXAxis().getScaleCalculator().getMinValue() ); yAxisCoordinates[ dataSet ][ index ] = scatterPlotAxisChart.getYAxis().computeAxisCoordinate( scatterPlotAxisChart.getYAxis().getOrigin(), iScatterPlotDataSet.getValue( dataSet, index ).getY(), scatterPlotAxisChart.getYAxis().getScaleCalculator().getMinValue() ); //System.out.println( "x= " + xAxisCoordinates[ dataSet ][ index ] + " y= " + yAxisCoordinates[ dataSet ][ index ] ); //---if we are generating an ImageMap, store the image coordinates if( scatterPlotAxisChart.getGenerateImageMapFlag() ) { scatterPlotAxisChart.getImageMap().addImageMapArea( new CircleMapArea( xAxisCoordinates[ dataSet ][ index ], yAxisCoordinates[ dataSet ][ index ], iScatterPlotDataSet.getValue( dataSet, index ), iScatterPlotDataSet.getLegendLabel( dataSet ) ) ); } } else { xAxisCoordinates[ dataSet ][ index ] = Float.NaN; yAxisCoordinates[ dataSet ][ index ] = Float.NaN; } } } ScatterPlotProperties scatterPlotProperties = (ScatterPlotProperties) iScatterPlotDataSet.getChartTypeProperties(); //DataAxisProperties xAxisProperties = (DataAxisProperties) scatterPlotAxisChart.getAxisProperties().getXAxisProperties(); //DataAxisProperties yAxisProperties = (DataAxisProperties) scatterPlotAxisChart.getAxisProperties().getYAxisProperties(); Graphics2D g2d = scatterPlotAxisChart.getGraphics2D(); AffineTransform originalTransform = null; double[] cornerXOffset = null; double[] cornerYOffset = null; //---check if there are any points to display if( scatterPlotProperties.getShapes() != null ) { //---when centering the shapes on the points, need x and y offset to do this cornerXOffset = new double[ iScatterPlotDataSet.getNumberOfDataSets() ]; cornerYOffset = new double[ iScatterPlotDataSet.getNumberOfDataSets() ]; //---get the original transform so can reset it. originalTransform = g2d.getTransform(); Rectangle2D rectangle; //LOOP //---pre-compute the dimensions of each Shape so do not do it in loop. for( int i = 0; i < iScatterPlotDataSet.getNumberOfDataSets(); i++ ) { if( scatterPlotProperties.getShapes()[ i ] != null ) { rectangle = scatterPlotProperties.getShapes()[ i ].getBounds2D(); cornerXOffset[ i ] = rectangle.getWidth() / 2; cornerYOffset[ i ] = rectangle.getHeight() / 2; } } } //---init for first segment Line2D.Float line = new Line2D.Float( xAxisCoordinates[ 0 ][ 0 ], yAxisCoordinates[ 0 ][ 0 ], xAxisCoordinates[ 0 ][ 1 ], yAxisCoordinates[ 0 ][ 1 ] ); //---make sure not plotting a chart with only one data point. if( yAxisCoordinates[ 0 ].length > 1 ) { //todo what is this for? line.y2 = yAxisCoordinates[ 0 ][ 1 ]; } //LOOP //---draw each line to the image for( int i = 0; i < yAxisCoordinates.length; i++ ) { line.x1 = xAxisCoordinates[ i ][ 0 ]; line.y1 = yAxisCoordinates[ i ][ 0 ]; line.x2 = line.x1; //LOOP for( int j = 1; j < yAxisCoordinates[ 0 ].length; j++ ) { //---if current point on line should be drawn if( !Float.isNaN( yAxisCoordinates[ i ][ j ] ) ) { //---if the previous point was not drawn, no line if( Float.isNaN( yAxisCoordinates[ i ][ j - 1 ] ) ) { line.x1 = xAxisCoordinates[ i ][ j ]; line.y1 = yAxisCoordinates[ i ][ j ]; line.x2 = xAxisCoordinates[ i ][ j ]; line.y2 = yAxisCoordinates[ i ][ j ]; continue; } line.x2 = xAxisCoordinates[ i ][ j ]; line.y2 = yAxisCoordinates[ i ][ j ]; g2d.setPaint( iScatterPlotDataSet.getPaint( i ) ); g2d.setStroke( scatterPlotProperties.getLineStrokes()[ i ] ); g2d.draw( line ); //---plot the Point if( scatterPlotProperties.getShapes()[ i ] != null ) { //---translate the Shape into position. g2d.translate( line.x1 - cornerXOffset[ i ], line.y1 - cornerYOffset[ i ] ); g2d.setPaint( iScatterPlotDataSet.getPaint( i ) ); g2d.fill( scatterPlotProperties.getShapes()[ i ] ); //---translate back to the original position g2d.setTransform( originalTransform ); } line.x1 = line.x2; line.y1 = line.y2; } else { if( (!Float.isNaN( yAxisCoordinates[ i ][ j - 1 ] )) && ( scatterPlotProperties.getShapes()[ i ] != null ) ) { //---translate the Shape into position. g2d.translate( line.x1 - cornerXOffset[ i ], line.y1 - cornerYOffset[ i ] ); g2d.setPaint( iScatterPlotDataSet.getPaint( i ) ); g2d.fill( scatterPlotProperties.getShapes()[ i ] ); //---translate back to the original position g2d.setTransform( originalTransform ); } line.x2 = scatterPlotAxisChart.getXAxis().getScalePixelWidth(); line.x1 = line.x2; } } //---put the last shape on the line if( (!Float.isNaN( yAxisCoordinates[ i ][ yAxisCoordinates[ i ].length - 1 ] )) && ( scatterPlotProperties.getShapes()[ i ] != null ) ) { //---translate the Shape into position. g2d.translate( line.x2 - cornerXOffset[ i ], line.y2 - cornerYOffset[ i ] ); g2d.setPaint( iScatterPlotDataSet.getPaint( i ) ); g2d.fill( scatterPlotProperties.getShapes()[ i ] ); //---translate back to the original position g2d.setTransform( originalTransform ); } } } } jcharts-0.7.5/src/org/jCharts/axisChart/StackedAreaChart.java0000644000175000001440000001440607751071402023120 0ustar onkarusers/*********************************************************************************************** * File Info: $Id: StackedAreaChart.java,v 1.7 2003/02/12 03:20:22 nathaniel_auvil Exp $ * Copyright (C) 2000 * Author: Nathaniel G. Auvil * Contributor(s): * * Copyright 2002 (C) Nathaniel G. Auvil. All Rights Reserved. * * Redistribution and use of this software and associated documentation * ("Software"), with or without modification, are permitted provided * that the following conditions are met: * * 1. Redistributions of source code must retain copyright * statements and notices. Redistributions must also contain a * copy of this document. * * 2. Redistributions in binary form must reproduce the * above copyright notice, this list of conditions and the * following disclaimer in the documentation and/or other * materials provided with the distribution. * * 3. The name "jCharts" or "Nathaniel G. Auvil" must not be used to * endorse or promote products derived from this Software without * prior written permission of Nathaniel G. Auvil. For written * permission, please contact nathaniel_auvil@users.sourceforge.net * * 4. Products derived from this Software may not be called "jCharts" * nor may "jCharts" appear in their names without prior written * permission of Nathaniel G. Auvil. jCharts is a registered * trademark of Nathaniel G. Auvil. * * 5. Due credit should be given to the jCharts Project * (http://jcharts.sourceforge.net/). * * THIS SOFTWARE IS PROVIDED BY Nathaniel G. Auvil AND CONTRIBUTORS * ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT * NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL * jCharts OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED * OF THE POSSIBILITY OF SUCH DAMAGE. ************************************************************************************************/ package org.jCharts.axisChart; import org.jCharts.chartData.interfaces.IAxisChartDataSet; import org.jCharts.imageMap.ImageMapNotSupportedException; import org.jCharts.properties.DataAxisProperties; import java.awt.*; import java.awt.geom.Area; import java.awt.geom.GeneralPath; abstract class StackedAreaChart { /******************************************************************************************** * Draws the chart * * @param axisChart * @param iAxisChartDataSet *********************************************************************************************/ static void render( AxisChart axisChart, IAxisChartDataSet iAxisChartDataSet ) { //---hopefully eliminate support requests asking about this... if( axisChart.getImageMap() != null ) { throw new ImageMapNotSupportedException( "HTML client-side image maps are not supported on Area Charts." ); } //AreaChartProperties areaChartProperties=(AreaChartProperties) iAxisChartDataSet.getChartTypeProperties(); float xPosition=axisChart.getXAxis().getTickStart(); GeneralPath generalPaths[]=new GeneralPath[ iAxisChartDataSet.getNumberOfDataSets() ]; //---cache the computed values //float[][] yAxisCoordinates= new float[ iAxisChartDataSet.getNumberOfDataSets() ][ iAxisChartDataSet.getNumberOfDataItems() ]; //---StackedAreaCharts can not be drawn on a horizontal axis so y-axis will always be the data axis DataAxisProperties dataAxisProperties= (DataAxisProperties) axisChart.getAxisProperties().getYAxisProperties(); float stackedValue=0f; //LOOP //---initial postion of each line must be set with call to moveTo() //---Do this here so every point does not have to check....if( i == 0 )... in loop for( int i=0; i < generalPaths.length; i++ ) { generalPaths[ i ]=new GeneralPath(); generalPaths[ i ].moveTo( xPosition, axisChart.getYAxis().getZeroLineCoordinate() ); stackedValue+=iAxisChartDataSet.getValue( i, 0 ); generalPaths[ i ].lineTo( xPosition, axisChart.getYAxis().computeAxisCoordinate( axisChart.getYAxis().getOrigin(), stackedValue, axisChart.getYAxis().getScaleCalculator().getMinValue() ) ); } //LOOP for( int j=1; j < iAxisChartDataSet.getNumberOfDataItems(); j++ ) { xPosition+=axisChart.getXAxis().getScalePixelWidth(); stackedValue=0f; //LOOP for( int i=0; i < generalPaths.length; i++ ) { stackedValue+=iAxisChartDataSet.getValue( i, j ); generalPaths[ i ].lineTo( xPosition, axisChart.getYAxis().computeAxisCoordinate( axisChart.getYAxis().getOrigin(), stackedValue, axisChart.getYAxis().getScaleCalculator().getMinValue() ) ); } } Area[] areas=new Area[ generalPaths.length ]; Area totalArea=null; Area newArea; //LOOP //---close the path and create an Area so can stack them for( int i=0; i < generalPaths.length; i++ ) { generalPaths[ i ].lineTo( xPosition, axisChart.getYAxis().getZeroLineCoordinate() ); generalPaths[ i ].closePath(); //generalPaths[ i ].lineTo( axisChart.getXAxisProperties().getTickStartX(), axisChart.getYAxisProperties().getZeroLineCoordinate() ); newArea=new Area( generalPaths[ i ] ); //---if this is not the first area, subtract cumulative area if( i > 0 ) { areas[ i ]=(Area) newArea.clone(); areas[ i ].subtract( totalArea ); totalArea=newArea; } else { areas[ 0 ]=newArea; totalArea=areas[ 0 ]; } } Graphics2D g2d=axisChart.getGraphics2D(); //LOOP //---draw each path to the image for( int i=0; i < areas.length; i++ ) { g2d.setPaint( iAxisChartDataSet.getPaint( i ) ); //g2d.setStroke( lineChartProperties.getLineStrokes()[ i ] ); g2d.fill( areas[ i ] ); } } } jcharts-0.7.5/src/org/jCharts/axisChart/StackedBarChart.java0000644000175000001440000002365007751071402022755 0ustar onkarusers/*********************************************************************************************** * File Info: $Id: StackedBarChart.java,v 1.12 2003/03/19 01:25:06 nathaniel_auvil Exp $ * Copyright (C) 2000 * Author: Nathaniel G. Auvil * Contributor(s): * * Copyright 2002 (C) Nathaniel G. Auvil. All Rights Reserved. * * Redistribution and use of this software and associated documentation ("Software"), with or * without modification, are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain copyright statements and notices. * Redistributions must also contain a copy of this document. * * 2. Redistributions in binary form must reproduce the above copyright notice, this list of * conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. * * 3. The name "jCharts" or "Nathaniel G. Auvil" must not be used to endorse or promote * products derived from this Software without prior written permission of Nathaniel G. * Auvil. For written permission, please contact nathaniel_auvil@users.sourceforge.net * * 4. Products derived from this Software may not be called "jCharts" nor may "jCharts" appear * in their names without prior written permission of Nathaniel G. Auvil. jCharts is a * registered trademark of Nathaniel G. Auvil. * * 5. Due credit should be given to the jCharts Project (http://jcharts.sourceforge.net/). * * THIS SOFTWARE IS PROVIDED BY Nathaniel G. Auvil AND CONTRIBUTORS ``AS IS'' AND ANY * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL * jCharts OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE ************************************************************************************************/ package org.jCharts.axisChart; import org.jCharts.chartData.ChartDataException; import org.jCharts.chartData.interfaces.IAxisChartDataSet; import org.jCharts.imageMap.RectMapArea; import org.jCharts.properties.DataAxisProperties; import org.jCharts.properties.StackedBarChartProperties; import java.awt.*; import java.awt.geom.Rectangle2D; abstract class StackedBarChart { /******************************************************************************************** * Draws the chart * * @param axisChart *********************************************************************************************/ static void render( AxisChart axisChart, IAxisChartDataSet iAxisChartDataSet ) throws ChartDataException { Graphics2D g2d = axisChart.getGraphics2D(); StackedBarChartProperties stackedBarChartProperties = (StackedBarChartProperties) iAxisChartDataSet.getChartTypeProperties(); float barWidth; //---y axis position on screen to start drawing. float startingX; float startingY; float width; float height; DataAxisProperties dataAxisProperties; if( axisChart.getAxisProperties().isPlotHorizontal() ) { dataAxisProperties = (DataAxisProperties) axisChart.getAxisProperties().getXAxisProperties(); barWidth = axisChart.getYAxis().getScalePixelWidth() * stackedBarChartProperties.getPercentage(); startingX = axisChart.getXAxis().getZeroLineCoordinate(); startingY = axisChart.getYAxis().getLastTickY() - (barWidth / 2); width = 0; height = barWidth; Rectangle2D.Float rectangle = new Rectangle2D.Float( startingX, startingY, width, height ); StackedBarChart.horizontalPlot( axisChart, iAxisChartDataSet, stackedBarChartProperties, dataAxisProperties, g2d, rectangle, startingX ); } else { dataAxisProperties = (DataAxisProperties) axisChart.getAxisProperties().getYAxisProperties(); barWidth = axisChart.getXAxis().getScalePixelWidth() * stackedBarChartProperties.getPercentage(); startingX = axisChart.getXAxis().getTickStart() - (barWidth / 2); startingY = axisChart.getYAxis().getZeroLineCoordinate(); width = barWidth; height = 0; Rectangle2D.Float rectangle = new Rectangle2D.Float( startingX, startingY, width, height ); StackedBarChart.verticalPlot( axisChart, iAxisChartDataSet, stackedBarChartProperties, dataAxisProperties, g2d, rectangle, startingY ); } } /************************************************************************************** * * @param axisChart * @param iAxisChartDataSet * @param stackedBarChartProperties * @param dataAxisProperties * @param g2d * @param rectangle * @param startingX **************************************************************************************/ private static void horizontalPlot( AxisChart axisChart, IAxisChartDataSet iAxisChartDataSet, StackedBarChartProperties stackedBarChartProperties, DataAxisProperties dataAxisProperties, Graphics2D g2d, Rectangle2D.Float rectangle, float startingX ) throws ChartDataException { int imageMapLabelIndex = axisChart.getYAxis().getNumberOfScaleItems() - 1; //LOOP //---initial postion of each line. for( int i = 0; i < iAxisChartDataSet.getNumberOfDataItems(); i++ ) { //---draw each bar in stack for( int j = 0; j < iAxisChartDataSet.getNumberOfDataSets(); j++ ) { //---if segment has a zero value, draw nothing. if( iAxisChartDataSet.getValue( j, i ) == 0 ) { continue; } else if( iAxisChartDataSet.getValue( j, i ) < 0 ) { //todo i think we could support this, but it can wait throw new ChartDataException( "Negative values in Stacked Bar charts are not supported yet... Coming soon..." ); /* rectangle.x = axisChart.getXAxis().computeAxisCoordinate( axisChart.getXAxis().getOrigin(), iAxisChartDataSet.getValue( 0, i ), dataAxisProperties.getScaleCalculator().getMinValue() ); rectangle.width = startingX - rectangle.x; */ } else { rectangle.width = BarChart.computeScaleHeightOfValue( iAxisChartDataSet.getValue( j, i ), axisChart.getXAxis().getOneUnitPixelSize() ); //rectangle.x = startingX; //rectangle.width = BarChart.computeScaleHeightOfValue( iAxisChartDataSet.getValue( j, i ), axisChart.getXAxis().getOneUnitPixelSize() ); } g2d.setPaint( iAxisChartDataSet.getPaint( j ) ); g2d.fill( rectangle ); if( stackedBarChartProperties.getShowOutlinesFlag() ) { stackedBarChartProperties.getBarOutlineStroke().draw( g2d, rectangle ); } //---if we are generating an ImageMap, store the image coordinates if( axisChart.getGenerateImageMapFlag() ) { String label = null; if( axisChart.getYAxis().getAxisLabelsGroup() != null ) { label = axisChart.getYAxis().getAxisLabelsGroup().getTextTag( imageMapLabelIndex ).getText(); } axisChart.getImageMap().addImageMapArea( new RectMapArea( rectangle, iAxisChartDataSet.getValue( j, i ), label, iAxisChartDataSet.getLegendLabel( j ) ) ); } rectangle.x += rectangle.width; } imageMapLabelIndex--; rectangle.y += axisChart.getYAxis().getScalePixelWidth(); rectangle.x = startingX; } } /************************************************************************************** * * @param axisChart * @param iAxisChartDataSet * @param stackedBarChartProperties * @param dataAxisProperties * @param g2d * @param rectangle * @param startingY **************************************************************************************/ private static void verticalPlot( AxisChart axisChart, IAxisChartDataSet iAxisChartDataSet, StackedBarChartProperties stackedBarChartProperties, DataAxisProperties dataAxisProperties, Graphics2D g2d, Rectangle2D.Float rectangle, float startingY ) { //IDataSeries iDataSeries= (IDataSeries) axisChart.getIAxisDataSeries(); //LOOP //---initial postion of each line. for( int i = 0; i < iAxisChartDataSet.getNumberOfDataItems(); i++ ) { //---draw each bar in stack for( int j = 0; j < iAxisChartDataSet.getNumberOfDataSets(); j++ ) { //---if segment has a zero value, draw nothing. if( iAxisChartDataSet.getValue( j, i ) == 0 ) { continue; } rectangle.height = BarChart.computeScaleHeightOfValue( iAxisChartDataSet.getValue( j, i ), axisChart.getYAxis().getOneUnitPixelSize() ); rectangle.y -= rectangle.height; g2d.setPaint( iAxisChartDataSet.getPaint( j ) ); g2d.fill( rectangle ); if( stackedBarChartProperties.getShowOutlinesFlag() ) { stackedBarChartProperties.getBarOutlineStroke().draw( g2d, rectangle ); } //---if we are generating an ImageMap, store the image coordinates if( axisChart.getGenerateImageMapFlag() ) { String label = null; if( axisChart.getXAxis().getAxisLabelsGroup() != null ) { label = axisChart.getXAxis().getAxisLabelsGroup().getTextTag( i ).getText(); } axisChart.getImageMap().addImageMapArea( new RectMapArea( rectangle, iAxisChartDataSet.getValue( j, i ), label, iAxisChartDataSet.getLegendLabel( j ) ) ); } } rectangle.x += axisChart.getXAxis().getScalePixelWidth(); rectangle.y = startingY; } } } jcharts-0.7.5/src/org/jCharts/axisChart/StockChart.java0000644000175000001440000002077407751071402022041 0ustar onkarusers/*********************************************************************************************** * File Info: $Id: StockChart.java,v 1.9 2003/03/31 00:26:14 nathaniel_auvil Exp $ * Copyright (C) 2000 * Author: Nathaniel G. Auvil * Contributor(s): * * Copyright 2002 (C) Nathaniel G. Auvil. All Rights Reserved. * * Redistribution and use of this software and associated documentation * ("Software"), with or without modification, are permitted provided * that the following conditions are met: * * 1. Redistributions of source code must retain copyright * statements and notices. Redistributions must also contain a * copy of this document. * * 2. Redistributions in binary form must reproduce the * above copyright notice, this list of conditions and the * following disclaimer in the documentation and/or other * materials provided with the distribution. * * 3. The name "jCharts" or "Nathaniel G. Auvil" must not be used to * endorse or promote products derived from this Software without * prior written permission of Nathaniel G. Auvil. For written * permission, please contact nathaniel_auvil@users.sourceforge.net * * 4. Products derived from this Software may not be called "jCharts" * nor may "jCharts" appear in their names without prior written * permission of Nathaniel G. Auvil. jCharts is a registered * trademark of Nathaniel G. Auvil. * * 5. Due credit should be given to the jCharts Project * (http://jcharts.sourceforge.net/). * * THIS SOFTWARE IS PROVIDED BY Nathaniel G. Auvil AND CONTRIBUTORS * ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT * NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL * jCharts OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED * OF THE POSSIBILITY OF SUCH DAMAGE. ************************************************************************************************/ package org.jCharts.axisChart; import org.jCharts.chartData.interfaces.IStockChartDataSet; import org.jCharts.chartData.interfaces.IDataSeries; import org.jCharts.imageMap.CircleMapArea; import org.jCharts.properties.StockChartProperties; import org.jCharts.properties.DataAxisProperties; import org.jCharts.types.StockChartDataType; import java.awt.*; import java.awt.geom.Line2D; abstract class StockChart { /******************************************************************************************** * Draws the chart * * @param axisChart * @param iStockChartDataSet *********************************************************************************************/ static final void render( AxisChart axisChart, IStockChartDataSet iStockChartDataSet ) { StockChartProperties stockChartProperties=(StockChartProperties) iStockChartDataSet.getChartTypeProperties(); Graphics2D g2d=axisChart.getGraphics2D(); DataAxisProperties dataAxisProperties= (DataAxisProperties) axisChart.getAxisProperties().getYAxisProperties(); IDataSeries iDataSeries= (IDataSeries) axisChart.getIAxisDataSeries(); //---cache the computed values //float[][] yAxisCoordinates=new float[ iStockChartDataSet.getNumberOfDataSets() ][ iStockChartDataSet.getNumberOfDataItems() ]; //---init for first segment Line2D.Float line=new Line2D.Float( axisChart.getXAxis().getTickStart(), 0, axisChart.getXAxis().getTickStart(), 0 ); Line2D.Float openLine=null; if( iStockChartDataSet.hasOpenValues() ) { openLine=new Line2D.Float( axisChart.getXAxis().getTickStart() - stockChartProperties.getOpenPixelLength() - 1, 0, axisChart.getXAxis().getTickStart() - 1, 0 ); } Line2D.Float closeLine=null; if( iStockChartDataSet.hasCloseValues() ) { closeLine=new Line2D.Float( axisChart.getXAxis().getTickStart() + 1, 0, axisChart.getXAxis().getTickStart() + stockChartProperties.getClosePixelLength() + 1, 0 ); } //LOOP //---draw each line to the image for( int i=0; i < iStockChartDataSet.getNumberOfDataItems(); i++ ) { line.y1= axisChart.getYAxis().computeAxisCoordinate( axisChart.getYAxis().getOrigin(), iStockChartDataSet.getLowValue( i ), axisChart.getYAxis().getScaleCalculator().getMinValue() ); line.y2= axisChart.getYAxis().computeAxisCoordinate( axisChart.getYAxis().getOrigin(), iStockChartDataSet.getHighValue( i ), axisChart.getYAxis().getScaleCalculator().getMinValue() ); String label; if( axisChart.getXAxis().getAxisLabelsGroup() != null ) { label = axisChart.getXAxis().getAxisLabelsGroup().getTextTag( i ).getText(); } else { label = null; } //---if we are generating an ImageMap, store the image coordinates if( axisChart.getGenerateImageMapFlag() ) { axisChart.getImageMap().addImageMapArea( new CircleMapArea( line.x1, line.y1, iStockChartDataSet.getLowValue( i ), label, iStockChartDataSet.getLegendLabel( StockChartDataType.LOW.getInt() ) ) ); axisChart.getImageMap().addImageMapArea( new CircleMapArea( line.x2, line.y2, iStockChartDataSet.getHighValue( i ), label, iStockChartDataSet.getLegendLabel( StockChartDataType.HIGH.getInt() ) ) ); } g2d.setPaint( iStockChartDataSet.getPaint( StockChartDataType.HIGH.getInt() ) ); g2d.setStroke( stockChartProperties.getHiLowStroke() ); g2d.draw( line ); line.x1+=axisChart.getXAxis().getScalePixelWidth(); line.x2=line.x1; if( openLine != null ) { if( iStockChartDataSet.getOpenValue( i ) != Double.NaN ) { openLine.y1= axisChart.getYAxis().computeAxisCoordinate( axisChart.getYAxis().getOrigin(), iStockChartDataSet.getOpenValue( i ), axisChart.getYAxis().getScaleCalculator().getMinValue() ); openLine.y2=openLine.y1; g2d.setPaint( iStockChartDataSet.getPaint( StockChartDataType.OPEN.getInt() ) ); g2d.setStroke( stockChartProperties.getOpenStroke() ); g2d.draw( openLine ); //---if we are generating an ImageMap, store the image coordinates if( axisChart.getGenerateImageMapFlag() ) { axisChart.getImageMap().addImageMapArea( new CircleMapArea( openLine.x1, openLine.y1, iStockChartDataSet.getOpenValue( i ), label, iStockChartDataSet.getLegendLabel( StockChartDataType.OPEN.getInt() ) ) ); } openLine.x1+=axisChart.getXAxis().getScalePixelWidth(); openLine.x2+=axisChart.getXAxis().getScalePixelWidth(); } } if( closeLine != null ) { if( iStockChartDataSet.getOpenValue( i ) != Double.NaN ) { closeLine.y1= axisChart.getYAxis().computeAxisCoordinate( axisChart.getYAxis().getOrigin(), iStockChartDataSet.getCloseValue( i ), axisChart.getYAxis().getScaleCalculator().getMinValue() ); closeLine.y2=closeLine.y1; g2d.setPaint( iStockChartDataSet.getPaint( StockChartDataType.CLOSE.getInt() ) ); g2d.setStroke( stockChartProperties.getCloseStroke() ); g2d.draw( closeLine ); //---if we are generating an ImageMap, store the image coordinates if( axisChart.getGenerateImageMapFlag() ) { axisChart.getImageMap().addImageMapArea( new CircleMapArea( closeLine.x2, closeLine.y2, iStockChartDataSet.getCloseValue( i ), label, iStockChartDataSet.getLegendLabel( StockChartDataType.CLOSE.getInt() ) ) ); } closeLine.x1+=axisChart.getXAxis().getScalePixelWidth(); closeLine.x2+=axisChart.getXAxis().getScalePixelWidth(); } } } } } jcharts-0.7.5/src/org/jCharts/chartData/0000755000175000001440000000000007751071402017064 5ustar onkarusersjcharts-0.7.5/src/org/jCharts/chartData/interfaces/0000755000175000001440000000000007751071402021207 5ustar onkarusersjcharts-0.7.5/src/org/jCharts/chartData/interfaces/IAxisChartDataSet.java0000644000175000001440000000560507751071402025325 0ustar onkarusers/*********************************************************************************************** * File Info: $Id: IAxisChartDataSet.java,v 1.2 2002/10/14 20:52:04 nathaniel_auvil Exp $ * Copyright (C) 2001 * Author: Nathaniel G. Auvil * Contributor(s): * * Copyright 2002 (C) Nathaniel G. Auvil. All Rights Reserved. * * Redistribution and use of this software and associated documentation * ("Software"), with or without modification, are permitted provided * that the following conditions are met: * * 1. Redistributions of source code must retain copyright * statements and notices. Redistributions must also contain a * copy of this document. * * 2. Redistributions in binary form must reproduce the * above copyright notice, this list of conditions and the * following disclaimer in the documentation and/or other * materials provided with the distribution. * * 3. The name "jCharts" or "Nathaniel G. Auvil" must not be used to * endorse or promote products derived from this Software without * prior written permission of Nathaniel G. Auvil. For written * permission, please contact nathaniel_auvil@users.sourceforge.net * * 4. Products derived from this Software may not be called "jCharts" * nor may "jCharts" appear in their names without prior written * permission of Nathaniel G. Auvil. jCharts is a registered * trademark of Nathaniel G. Auvil. * * 5. Due credit should be given to the jCharts Project * (http://jcharts.sourceforge.net/). * * THIS SOFTWARE IS PROVIDED BY Nathaniel G. Auvil AND CONTRIBUTORS * ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT * NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL * jCharts OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED * OF THE POSSIBILITY OF SUCH DAMAGE. ************************************************************************************************/ package org.jCharts.chartData.interfaces; public interface IAxisChartDataSet extends IAxisPlotDataSet { /****************************************************************************************** * Returns the value in the data set at the specified position. * * @param dataset * @param index * @return double *******************************************************************************************/ public double getValue( int dataset, int index ); } jcharts-0.7.5/src/org/jCharts/chartData/interfaces/IAxisDataSeries.java0000644000175000001440000001241207751071402025034 0ustar onkarusers/*********************************************************************************************** * File Info: $Id: IAxisDataSeries.java,v 1.2 2003/02/17 18:21:11 nathaniel_auvil Exp $ * Copyright (C) 2002 * Author: Nathaniel G. Auvil * Contributor(s): * * Copyright 2002 (C) Nathaniel G. Auvil. All Rights Reserved. * * Redistribution and use of this software and associated documentation ("Software"), with or * without modification, are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain copyright statements and notices. * Redistributions must also contain a copy of this document. * * 2. Redistributions in binary form must reproduce the above copyright notice, this list of * conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. * * 3. The name "jCharts" or "Nathaniel G. Auvil" must not be used to endorse or promote * products derived from this Software without prior written permission of Nathaniel G. * Auvil. For written permission, please contact nathaniel_auvil@users.sourceforge.net * * 4. Products derived from this Software may not be called "jCharts" nor may "jCharts" appear * in their names without prior written permission of Nathaniel G. Auvil. jCharts is a * registered trademark of Nathaniel G. Auvil. * * 5. Due credit should be given to the jCharts Project (http://jcharts.sourceforge.net/). * * THIS SOFTWARE IS PROVIDED BY Nathaniel G. Auvil AND CONTRIBUTORS ``AS IS'' AND ANY * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL * jCharts OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE ************************************************************************************************/ package org.jCharts.chartData.interfaces; import org.jCharts.chartData.ChartDataException; import org.jCharts.properties.PropertyException; import org.jCharts.types.ChartType; import java.util.Iterator; public interface IAxisDataSeries extends IData { /****************************************************************************************** * Returns the x-axis title. * * @return String the x-axis title. If this returns NULL, no title will be displayed. ******************************************************************************************/ public String getXAxisTitle(); /****************************************************************************************** * Returns the y-axis title. * * @return String the y-axis title. If this returns NULL, no title will be displayed. ******************************************************************************************/ public String getYAxisTitle(); /****************************************************************************************** * Returns the chart title. * * @return String the chart title. If this returns NULL, no title will be displayed. ******************************************************************************************/ public String getChartTitle(); /********************************************************************************************* * Validates the DataSeries implementation. This will only get called if the ChartProperties * flag to validate is true. * * @throws ChartDataException * @throws PropertyException * @since 0.7.0 * @see org.jCharts.properties.ChartProperties#setValidate( boolean ) *********************************************************************************************/ public void validate() throws ChartDataException, PropertyException; public Iterator getIAxisPlotDataSetIterator(); public void addIAxisPlotDataSet( IAxisPlotDataSet iAxisPlotDataSet ); public IAxisPlotDataSet getIAxisPlotDataSet( ChartType chartType ); /****************************************************************************************** * Returns the total number data dimensions in all of the IAxisChartDataSets contained in * this collection. For example, if this contains two IAxisChartDataSets and each one * contains 3 dimensions ( 3 lines and 3 sets of points ), this should return six. This * provides a means to avoid looping the contents of the series each time i need the value. * * @return int ******************************************************************************************/ public int getTotalNumberOfDataSets(); /****************************************************************************************** * Returns the number of IAxisPlotDataSet Objects in this series * * @return int ******************************************************************************************/ int size(); } jcharts-0.7.5/src/org/jCharts/chartData/interfaces/IAxisPlotDataSet.java0000644000175000001440000000722207751071402025177 0ustar onkarusers/*********************************************************************************************** * File Info: $Id: IAxisPlotDataSet.java,v 1.3 2003/02/17 02:53:21 nathaniel_auvil Exp $ * Copyright (C) 2001 * Author: Nathaniel G. Auvil * Contributor(s): * * Copyright 2002 (C) Nathaniel G. Auvil. All Rights Reserved. * * Redistribution and use of this software and associated documentation * ("Software"), with or without modification, are permitted provided * that the following conditions are met: * * 1. Redistributions of source code must retain copyright * statements and notices. Redistributions must also contain a * copy of this document. * * 2. Redistributions in binary form must reproduce the * above copyright notice, this list of conditions and the * following disclaimer in the documentation and/or other * materials provided with the distribution. * * 3. The name "jCharts" or "Nathaniel G. Auvil" must not be used to * endorse or promote products derived from this Software without * prior written permission of Nathaniel G. Auvil. For written * permission, please contact nathaniel_auvil@users.sourceforge.net * * 4. Products derived from this Software may not be called "jCharts" * nor may "jCharts" appear in their names without prior written * permission of Nathaniel G. Auvil. jCharts is a registered * trademark of Nathaniel G. Auvil. * * 5. Due credit should be given to the jCharts Project * (http://jcharts.sourceforge.net/). * * THIS SOFTWARE IS PROVIDED BY Nathaniel G. Auvil AND CONTRIBUTORS * ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT * NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL * jCharts OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED * OF THE POSSIBILITY OF SUCH DAMAGE. ************************************************************************************************/ package org.jCharts.chartData.interfaces; import org.jCharts.types.ChartType; import org.jCharts.chartData.ChartDataException; import org.jCharts.properties.PropertyException; public interface IAxisPlotDataSet extends IDataSet { /****************************************************************************************** * Returns the type of chart this data is to be plotted on * * @return ChartType *******************************************************************************************/ public ChartType getChartType(); /****************************************************************************************** * Returns the number of data sets contained in this Object. * * @return int ******************************************************************************************/ public int getNumberOfDataSets(); /****************************************************************************************** * Allows validations to be performed on the data structures * * @throws ChartDataException * @throws PropertyException ******************************************************************************************/ public void validate() throws ChartDataException, PropertyException; } jcharts-0.7.5/src/org/jCharts/chartData/interfaces/IData.java0000644000175000001440000000541607751071402023042 0ustar onkarusers/*********************************************************************************************** * File Info: $Id: IData.java,v 1.2 2002/10/14 20:52:04 nathaniel_auvil Exp $ * Copyright (C) 2001 * Author: Nathaniel G. Auvil * Contributor(s): * * Copyright 2002 (C) Nathaniel G. Auvil. All Rights Reserved. * * Redistribution and use of this software and associated documentation * ("Software"), with or without modification, are permitted provided * that the following conditions are met: * * 1. Redistributions of source code must retain copyright * statements and notices. Redistributions must also contain a * copy of this document. * * 2. Redistributions in binary form must reproduce the * above copyright notice, this list of conditions and the * following disclaimer in the documentation and/or other * materials provided with the distribution. * * 3. The name "jCharts" or "Nathaniel G. Auvil" must not be used to * endorse or promote products derived from this Software without * prior written permission of Nathaniel G. Auvil. For written * permission, please contact nathaniel_auvil@users.sourceforge.net * * 4. Products derived from this Software may not be called "jCharts" * nor may "jCharts" appear in their names without prior written * permission of Nathaniel G. Auvil. jCharts is a registered * trademark of Nathaniel G. Auvil. * * 5. Due credit should be given to the jCharts Project * (http://jcharts.sourceforge.net/). * * THIS SOFTWARE IS PROVIDED BY Nathaniel G. Auvil AND CONTRIBUTORS * ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT * NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL * jCharts OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED * OF THE POSSIBILITY OF SUCH DAMAGE. ************************************************************************************************/ package org.jCharts.chartData.interfaces; import java.io.Serializable; /***************************************************************************************** * Provides a common base class for all data structures. * ******************************************************************************************/ public interface IData extends Serializable { } jcharts-0.7.5/src/org/jCharts/chartData/interfaces/IDataSeries.java0000644000175000001440000000610407751071402024210 0ustar onkarusers/*********************************************************************************************** * File Info: $Id: IDataSeries.java,v 1.7 2003/02/17 18:21:11 nathaniel_auvil Exp $ * Copyright (C) 2002 * Author: Nathaniel G. Auvil * Contributor(s): * * Copyright 2002 (C) Nathaniel G. Auvil. All Rights Reserved. * * Redistribution and use of this software and associated documentation ("Software"), with or * without modification, are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain copyright statements and notices. * Redistributions must also contain a copy of this document. * * 2. Redistributions in binary form must reproduce the above copyright notice, this list of * conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. * * 3. The name "jCharts" or "Nathaniel G. Auvil" must not be used to endorse or promote * products derived from this Software without prior written permission of Nathaniel G. * Auvil. For written permission, please contact nathaniel_auvil@users.sourceforge.net * * 4. Products derived from this Software may not be called "jCharts" nor may "jCharts" appear * in their names without prior written permission of Nathaniel G. Auvil. jCharts is a * registered trademark of Nathaniel G. Auvil. * * 5. Due credit should be given to the jCharts Project (http://jcharts.sourceforge.net/). * * THIS SOFTWARE IS PROVIDED BY Nathaniel G. Auvil AND CONTRIBUTORS ``AS IS'' AND ANY * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL * jCharts OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE ************************************************************************************************/ package org.jCharts.chartData.interfaces; public interface IDataSeries extends IAxisDataSeries { /****************************************************************************************** * Returns the number of labels on the x-axis * * @return int ******************************************************************************************/ public int getNumberOfAxisLabels(); /****************************************************************************************** * Returns the axis label at the specified index. * * @param index * @return String the x-axis label ******************************************************************************************/ public String getAxisLabel( int index ); } jcharts-0.7.5/src/org/jCharts/chartData/interfaces/IDataSet.java0000644000175000001440000001056407751071402023516 0ustar onkarusers/*********************************************************************************************** * File Info: $Id: IDataSet.java,v 1.3 2003/02/17 02:53:21 nathaniel_auvil Exp $ * Copyright (C) 2002 * Author: Nathaniel G. Auvil * Contributor(s): * * Copyright 2002 (C) Nathaniel G. Auvil. All Rights Reserved. * * Redistribution and use of this software and associated documentation ("Software"), with or * without modification, are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain copyright statements and notices. * Redistributions must also contain a copy of this document. * * 2. Redistributions in binary form must reproduce the above copyright notice, this list of * conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. * * 3. The name "jCharts" or "Nathaniel G. Auvil" must not be used to endorse or promote * products derived from this Software without prior written permission of Nathaniel G. * Auvil. For written permission, please contact nathaniel_auvil@users.sourceforge.net * * 4. Products derived from this Software may not be called "jCharts" nor may "jCharts" appear * in their names without prior written permission of Nathaniel G. Auvil. jCharts is a * registered trademark of Nathaniel G. Auvil. * * 5. Due credit should be given to the jCharts Project (http://jcharts.sourceforge.net/). * * THIS SOFTWARE IS PROVIDED BY Nathaniel G. Auvil AND CONTRIBUTORS ``AS IS'' AND ANY * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL * jCharts OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE ************************************************************************************************/ package org.jCharts.chartData.interfaces; import org.jCharts.properties.ChartTypeProperties; import java.awt.*; public interface IDataSet extends IData { /****************************************************************************************** * Returns the Paint Object for the passed index. This index corresponds to the DataSet * for which Paint you want. * * @param index * @return Paint *******************************************************************************************/ public Paint getPaint( int index ); /****************************************************************************************** * Returns ChartTypeProperties Object for the data set which will be typed into the specific * chart type class. * * @return ChartTypeProperties *******************************************************************************************/ public ChartTypeProperties getChartTypeProperties(); /****************************************************************************************** * Returns the Legend Label for the passed index. This index corresponds to the DataSet * for which Label you want. * * @param index * @return String should return NULL of no labels specified *******************************************************************************************/ public String getLegendLabel( int index ); /****************************************************************************************** * Returns the number of elements in the data set. * * @return int *******************************************************************************************/ public int getNumberOfDataItems(); /****************************************************************************************** * Returns the number of legend labels in the data set. * * @return int should return 0 if no labels specified *******************************************************************************************/ public int getNumberOfLegendLabels(); } jcharts-0.7.5/src/org/jCharts/chartData/interfaces/IPieChartDataSet.java0000644000175000001440000000626207751071402025136 0ustar onkarusers/*********************************************************************************************** * File Info: $Id: IPieChartDataSet.java,v 1.2 2002/10/14 20:52:04 nathaniel_auvil Exp $ * Copyright (C) 2001 * Author: Nathaniel G. Auvil * Contributor(s): * * Copyright 2002 (C) Nathaniel G. Auvil. All Rights Reserved. * * Redistribution and use of this software and associated documentation * ("Software"), with or without modification, are permitted provided * that the following conditions are met: * * 1. Redistributions of source code must retain copyright * statements and notices. Redistributions must also contain a * copy of this document. * * 2. Redistributions in binary form must reproduce the * above copyright notice, this list of conditions and the * following disclaimer in the documentation and/or other * materials provided with the distribution. * * 3. The name "jCharts" or "Nathaniel G. Auvil" must not be used to * endorse or promote products derived from this Software without * prior written permission of Nathaniel G. Auvil. For written * permission, please contact nathaniel_auvil@users.sourceforge.net * * 4. Products derived from this Software may not be called "jCharts" * nor may "jCharts" appear in their names without prior written * permission of Nathaniel G. Auvil. jCharts is a registered * trademark of Nathaniel G. Auvil. * * 5. Due credit should be given to the jCharts Project * (http://jcharts.sourceforge.net/). * * THIS SOFTWARE IS PROVIDED BY Nathaniel G. Auvil AND CONTRIBUTORS * ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT * NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL * jCharts OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED * OF THE POSSIBILITY OF SUCH DAMAGE. ************************************************************************************************/ package org.jCharts.chartData.interfaces; public interface IPieChartDataSet extends IDataSet { /****************************************************************************************** * Returns the value in the data set at the specified position. * * @param index * @return double *******************************************************************************************/ public double getValue( int index ); /****************************************************************************************** * Returns the chart title. * * @return String the chart title. If this returns NULL, no title will be displayed. ******************************************************************************************/ public String getChartTitle(); } jcharts-0.7.5/src/org/jCharts/chartData/interfaces/IScatterPlotDataSeries.java0000644000175000001440000000634507751071402026404 0ustar onkarusers/*********************************************************************************************** * File Info: $Id: IScatterPlotDataSeries.java,v 1.2 2003/02/17 18:21:10 nathaniel_auvil Exp $ * Copyright (C) 2002 * Author: Nathaniel G. Auvil * Contributor(s): * * Copyright 2002 (C) Nathaniel G. Auvil. All Rights Reserved. * * Redistribution and use of this software and associated documentation ("Software"), with or * without modification, are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain copyright statements and notices. * Redistributions must also contain a copy of this document. * * 2. Redistributions in binary form must reproduce the above copyright notice, this list of * conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. * * 3. The name "jCharts" or "Nathaniel G. Auvil" must not be used to endorse or promote * products derived from this Software without prior written permission of Nathaniel G. * Auvil. For written permission, please contact nathaniel_auvil@users.sourceforge.net * * 4. Products derived from this Software may not be called "jCharts" nor may "jCharts" appear * in their names without prior written permission of Nathaniel G. Auvil. jCharts is a * registered trademark of Nathaniel G. Auvil. * * 5. Due credit should be given to the jCharts Project (http://jcharts.sourceforge.net/). * * THIS SOFTWARE IS PROVIDED BY Nathaniel G. Auvil AND CONTRIBUTORS ``AS IS'' AND ANY * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL * jCharts OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE ************************************************************************************************/ package org.jCharts.chartData.interfaces; public interface IScatterPlotDataSeries extends IAxisDataSeries { /****************************************************************************************** * Adds the passed data set to the series * * @param iScatterPlotDataSet ******************************************************************************************/ //public void addIScatterPlotDataSet( IScatterPlotDataSet iScatterPlotDataSet ); /****************************************************************************************** * Returns the IAxisPlotDataSet for the passed chart type constant. Will return NULL if * if no data set exists for the passed type. * * @return iScatterPlotDataSet ****************************************************************************************** public IScatterPlotDataSet getIScatterPlotDataSet(); */ } jcharts-0.7.5/src/org/jCharts/chartData/interfaces/IScatterPlotDataSet.java0000644000175000001440000000560407751071402025702 0ustar onkarusers/*********************************************************************************************** * File Info: $Id: IScatterPlotDataSet.java,v 1.1 2003/02/17 02:53:10 nathaniel_auvil Exp $ * Copyright (C) 2002 * Author: Nathaniel G. Auvil * Contributor(s): Sandor Dornbush * * Copyright 2002 (C) Nathaniel G. Auvil. All Rights Reserved. * * Redistribution and use of this software and associated documentation ("Software"), with or * without modification, are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain copyright statements and notices. * Redistributions must also contain a copy of this document. * * 2. Redistributions in binary form must reproduce the above copyright notice, this list of * conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. * * 3. The name "jCharts" or "Nathaniel G. Auvil" must not be used to endorse or promote * products derived from this Software without prior written permission of Nathaniel G. * Auvil. For written permission, please contact nathaniel_auvil@users.sourceforge.net * * 4. Products derived from this Software may not be called "jCharts" nor may "jCharts" appear * in their names without prior written permission of Nathaniel G. Auvil. jCharts is a * registered trademark of Nathaniel G. Auvil. * * 5. Due credit should be given to the jCharts Project (http://jcharts.sourceforge.net/). * * THIS SOFTWARE IS PROVIDED BY Nathaniel G. Auvil AND CONTRIBUTORS ``AS IS'' AND ANY * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL * jCharts OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE ************************************************************************************************/ package org.jCharts.chartData.interfaces; import java.awt.geom.Point2D; public interface IScatterPlotDataSet extends IAxisPlotDataSet { /****************************************************************************************** * Returns the value in the data set at the specified position. * * @param dataset * @param index * @return Point.Double *******************************************************************************************/ public Point2D.Double getValue( int dataset, int index ); } jcharts-0.7.5/src/org/jCharts/chartData/interfaces/IStockChartDataSet.java0000644000175000001440000001175307751071402025505 0ustar onkarusers/*********************************************************************************************** * File Info: $Id: IStockChartDataSet.java,v 1.2 2002/10/14 20:52:04 nathaniel_auvil Exp $ * Copyright (C) 2001 * Author: Nathaniel G. Auvil * Contributor(s): * * Copyright 2002 (C) Nathaniel G. Auvil. All Rights Reserved. * * Redistribution and use of this software and associated documentation * ("Software"), with or without modification, are permitted provided * that the following conditions are met: * * 1. Redistributions of source code must retain copyright * statements and notices. Redistributions must also contain a * copy of this document. * * 2. Redistributions in binary form must reproduce the * above copyright notice, this list of conditions and the * following disclaimer in the documentation and/or other * materials provided with the distribution. * * 3. The name "jCharts" or "Nathaniel G. Auvil" must not be used to * endorse or promote products derived from this Software without * prior written permission of Nathaniel G. Auvil. For written * permission, please contact nathaniel_auvil@users.sourceforge.net * * 4. Products derived from this Software may not be called "jCharts" * nor may "jCharts" appear in their names without prior written * permission of Nathaniel G. Auvil. jCharts is a registered * trademark of Nathaniel G. Auvil. * * 5. Due credit should be given to the jCharts Project * (http://jcharts.sourceforge.net/). * * THIS SOFTWARE IS PROVIDED BY Nathaniel G. Auvil AND CONTRIBUTORS * ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT * NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL * jCharts OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED * OF THE POSSIBILITY OF SUCH DAMAGE. ************************************************************************************************/ package org.jCharts.chartData.interfaces; import org.jCharts.types.ChartType; public interface IStockChartDataSet extends IAxisPlotDataSet { /****************************************************************************************** * Returns the type of chart this data is to be plotted on * * @return ChartType *******************************************************************************************/ public ChartType getChartType(); /****************************************************************************************** * * @param index * @return double *******************************************************************************************/ public double getHighValue( int index ); /****************************************************************************************** * * @param index * @return double *******************************************************************************************/ public double getLowValue( int index ); /****************************************************************************************** * * @param index * @return double *******************************************************************************************/ public double getCloseValue( int index ); /****************************************************************************************** * * @param boolean *******************************************************************************************/ public boolean hasCloseValues(); /****************************************************************************************** * * @param index * @return double *******************************************************************************************/ public double getOpenValue( int index ); /****************************************************************************************** * * @param boolean *******************************************************************************************/ public boolean hasOpenValues(); /****************************************************************************************** * * @param index * @return double *******************************************************************************************/ //public double getVolumeValue( int index ); /****************************************************************************************** * * @param boolean *******************************************************************************************/ //public boolean hasVolumeValues(); } jcharts-0.7.5/src/org/jCharts/chartData/processors/0000755000175000001440000000000007751071402021266 5ustar onkarusersjcharts-0.7.5/src/org/jCharts/chartData/processors/AxisChartDataProcessor.java0000644000175000001440000002054607751071402026520 0ustar onkarusers/*********************************************************************************************** * File Info: $Id: AxisChartDataProcessor.java,v 1.12 2003/03/09 22:42:11 nathaniel_auvil Exp $ * Copyright (C) 2000 * Author: Nathaniel G. Auvil * Contributor(s): * * Copyright 2002 (C) Nathaniel G. Auvil. All Rights Reserved. * * Redistribution and use of this software and associated documentation * ("Software"), with or without modification, are permitted provided * that the following conditions are met: * * 1. Redistributions of source code must retain copyright * statements and notices. Redistributions must also contain a * copy of this document. * * 2. Redistributions in binary form must reproduce the * above copyright notice, this list of conditions and the * following disclaimer in the documentation and/or other * materials provided with the distribution. * * 3. The name "jCharts" or "Nathaniel G. Auvil" must not be used to * endorse or promote products derived from this Software without * prior written permission of Nathaniel G. Auvil. For written * permission, please contact nathaniel_auvil@users.sourceforge.net * * 4. Products derived from this Software may not be called "jCharts" * nor may "jCharts" appear in their names without prior written * permission of Nathaniel G. Auvil. jCharts is a registered * trademark of Nathaniel G. Auvil. * * 5. Due credit should be given to the jCharts Project (http://jcharts.sourceforge.net/). * * THIS SOFTWARE IS PROVIDED BY Nathaniel G. Auvil AND CONTRIBUTORS * ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT * NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL * jCharts OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED * OF THE POSSIBILITY OF SUCH DAMAGE. ************************************************************************************************/ package org.jCharts.chartData.processors; import org.jCharts.axisChart.AxisChart; import org.jCharts.axisChart.ScatterPlotAxisChart; import org.jCharts.chartData.interfaces.*; import org.jCharts.types.ChartType; import org.jCharts.chartText.TextTagGroup; import org.jCharts.properties.DataAxisProperties; import java.awt.*; import java.awt.font.FontRenderContext; import java.util.Iterator; /******************************************************************************************* * ********************************************************************************************/ public class AxisChartDataProcessor { private double max; private double min; //private TextLayout titleTextLayout; //---need this so know how many items are on the 'label' axis. private int numberOfElementsInADataSet; /****************************************************************************************** * Constructor * *******************************************************************************************/ public AxisChartDataProcessor() { } /****************************************************************************************** * Method to perform all chart data processing. * * @param axisChart ******************************************************************************************/ public void processData( AxisChart axisChart, FontRenderContext fontRenderContext ) { //todo would it make sense to do this and do the axis titles? /* if( axisChart.getIDataSeries().getChartTitle() != null ) { this.titleTextLayout= new TextLayout( axisChart.getIDataSeries().getChartTitle(), axisChart.getChartProperties().getTitleFont(), fontRenderContext ); } */ DataAxisProperties dataAxisProperties; if( axisChart.getAxisProperties().isPlotHorizontal() ) { dataAxisProperties= (DataAxisProperties) axisChart.getAxisProperties().getXAxisProperties(); } else { dataAxisProperties= (DataAxisProperties) axisChart.getAxisProperties().getYAxisProperties(); } //---if there is a user defined scale, there is no reason to process the data. if( ! dataAxisProperties.hasUserDefinedScale() ) { this.processDataSet( (IDataSeries) axisChart.getIAxisDataSeries() ); } //---need to set the number of items on the scale in case there are no labels displayed Iterator iterator = axisChart.getIAxisDataSeries().getIAxisPlotDataSetIterator(); IAxisPlotDataSet iAxisPlotDataSet = ( IAxisPlotDataSet ) iterator.next(); this.numberOfElementsInADataSet= iAxisPlotDataSet.getNumberOfDataItems(); //todo does it make sense to do the legend label processing here? /* if( axisChart.hasLegend() ) { //this.lengendLabelProcessor= new TextProcessor(); // this.lengendLabelProcessor } */ } /****************************************************************************************** * Processes the numeric values in the chart data. If there is a user defined scale * there is no need to call this. * * @param iDataSeries ******************************************************************************************/ private void processDataSet( IDataSeries iDataSeries ) { IAxisPlotDataSet iAxisPlotDataSet; Iterator iterator = iDataSeries.getIAxisPlotDataSetIterator(); //LOOP while( iterator.hasNext() ) { iAxisPlotDataSet = ( IAxisPlotDataSet ) iterator.next(); if( iAxisPlotDataSet.getChartType().isStacked() ) { //---StockChartDataSet is NEVER stacked!!!! StackedDataProcessor.processData( ( IAxisChartDataSet ) iAxisPlotDataSet, this ); } else { //---stock charts dont fit well here as the data comes in structured. //---in this case only care about the high and low; no need to search close, open, volume if( iAxisPlotDataSet.getChartType().equals( ChartType.STOCK ) ) { StockDataProcessor.processData( ( IStockChartDataSet ) iAxisPlotDataSet, this ); } else { NonStackedDataProcessor.processData( ( IAxisChartDataSet ) iAxisPlotDataSet, this ); } } } } /****************************************************************************************** * * ******************************************************************************************/ void setMaxValue( double max ) { this.max = max; } /****************************************************************************************** * * * ******************************************************************************************/ public double getMaxValue() { return this.max; } /****************************************************************************************** * * ******************************************************************************************/ void setMinValue( double min ) { this.min = min; } /****************************************************************************************** * * * ******************************************************************************************/ public double getMinValue() { return this.min; } public int getNumberOfElementsInADataSet() { return numberOfElementsInADataSet; } /********************************************************************************************* * Enables the testing routines to display the contents of this Object. * * @param htmlGenerator ********************************************************************************************** public void toHTML( HTMLGenerator htmlGenerator ) { super.toHTML( htmlGenerator ); String name= this.getClass().getSuperclass().getName() + "->"; //---calling on instance of YAxis or XAxis Field[] fields= this.getClass().getSuperclass().getDeclaredFields(); for( int i=0; i< fields.length; i++ ) { htmlGenerator.addField( name + fields[ i ].getName(), fields[ i ].get( this ) ); } } */ } jcharts-0.7.5/src/org/jCharts/chartData/processors/NonStackedDataProcessor.java0000644000175000001440000000774207751071402026666 0ustar onkarusers/*********************************************************************************************** * File Info: $Id: NonStackedDataProcessor.java,v 1.3 2003/02/17 20:02:56 nathaniel_auvil Exp $ * Copyright (C) 2000 * Author: Nathaniel G. Auvil * Contributor(s): * * Copyright 2002 (C) Nathaniel G. Auvil. All Rights Reserved. * * Redistribution and use of this software and associated documentation * ("Software"), with or without modification, are permitted provided * that the following conditions are met: * * 1. Redistributions of source code must retain copyright * statements and notices. Redistributions must also contain a * copy of this document. * * 2. Redistributions in binary form must reproduce the * above copyright notice, this list of conditions and the * following disclaimer in the documentation and/or other * materials provided with the distribution. * * 3. The name "jCharts" or "Nathaniel G. Auvil" must not be used to * endorse or promote products derived from this Software without * prior written permission of Nathaniel G. Auvil. For written * permission, please contact nathaniel_auvil@users.sourceforge.net * * 4. Products derived from this Software may not be called "jCharts" * nor may "jCharts" appear in their names without prior written * permission of Nathaniel G. Auvil. jCharts is a registered * trademark of Nathaniel G. Auvil. * * 5. Due credit should be given to the jCharts Project * (http://jcharts.sourceforge.net/). * * THIS SOFTWARE IS PROVIDED BY Nathaniel G. Auvil AND CONTRIBUTORS * ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT * NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL * jCharts OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED * OF THE POSSIBILITY OF SUCH DAMAGE. ************************************************************************************************/ package org.jCharts.chartData.processors; import org.jCharts.chartData.interfaces.IAxisChartDataSet; /******************************************************************************************* * * *******************************************************************************************/ abstract class NonStackedDataProcessor { /******************************************************************************************* * Does a single pass through the data set and calculates the min, max, and label dimensions. * This stuff is grouped together so we can try to limit the number of passes through the data. * * @param iAxisChartDataSet * @param axisChartDataProcessor ********************************************************************************************/ public static final void processData( IAxisChartDataSet iAxisChartDataSet, AxisChartDataProcessor axisChartDataProcessor ) { //LOOP for( int i = 0; i < iAxisChartDataSet.getNumberOfDataItems(); i++ ) { //LOOP for( int j = 0; j < iAxisChartDataSet.getNumberOfDataSets(); j++ ) { if( Double.isNaN( iAxisChartDataSet.getValue( j, i ) ) ) { continue; } if( iAxisChartDataSet.getValue( j, i ) > axisChartDataProcessor.getMaxValue() ) { axisChartDataProcessor.setMaxValue( iAxisChartDataSet.getValue( j, i ) ); } if( iAxisChartDataSet.getValue( j, i ) < axisChartDataProcessor.getMinValue() ) { axisChartDataProcessor.setMinValue( iAxisChartDataSet.getValue( j, i ) ); } } } } } jcharts-0.7.5/src/org/jCharts/chartData/processors/PieChartDataProcessor.java0000644000175000001440000001032207751071402026320 0ustar onkarusers/*********************************************************************************************** * File Info: $Id: PieChartDataProcessor.java,v 1.3 2002/11/08 02:07:16 nathaniel_auvil Exp $ * Copyright (C) 2002 * Author: Nathaniel G. Auvil * Contributor(s): * * Copyright 2002 (C) Nathaniel G. Auvil. All Rights Reserved. * * Redistribution and use of this software and associated documentation ("Software"), with or * without modification, are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain copyright statements and notices. * Redistributions must also contain a copy of this document. * * 2. Redistributions in binary form must reproduce the above copyright notice, this list of * conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. * * 3. The name "jCharts" or "Nathaniel G. Auvil" must not be used to endorse or promote * products derived from this Software without prior written permission of Nathaniel G. * Auvil. For written permission, please contact nathaniel_auvil@users.sourceforge.net * * 4. Products derived from this Software may not be called "jCharts" nor may "jCharts" appear * in their names without prior written permission of Nathaniel G. Auvil. jCharts is a * registered trademark of Nathaniel G. Auvil. * * 5. Due credit should be given to the jCharts Project (http://jcharts.sourceforge.net/). * * THIS SOFTWARE IS PROVIDED BY Nathaniel G. Auvil AND CONTRIBUTORS ``AS IS'' AND ANY * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL * jCharts OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE ************************************************************************************************/ package org.jCharts.chartData.processors; import org.jCharts.chartData.interfaces.IPieChartDataSet; /******************************************************************************************* * Utility class to process the PieChartDataSet * *******************************************************************************************/ final public class PieChartDataProcessor { private IPieChartDataSet iPieChartDataSet; private double sumOfData = 0; /****************************************************************************************** * Constructor * * @param iPieChartDataSet *******************************************************************************************/ public PieChartDataProcessor( IPieChartDataSet iPieChartDataSet ) { this.iPieChartDataSet = iPieChartDataSet; } /******************************************************************************************* * This method should do a single pass through the data set and calculate all needed values, * such as: min, max, sum, etc... so that we can do this in one pass through the data. * Rather than once for each. * ********************************************************************************************/ public void processData() { int size = this.iPieChartDataSet.getNumberOfDataItems(); for( int i = 0; i < size; i++ ) { this.sumOfData += this.iPieChartDataSet.getValue( i ); } } /****************************************************************************************** * Returns percentage of pie(360 degrees) data point at specified index. * * @param index * @return double *******************************************************************************************/ public double getPercentageOfPie( int index ) { return (this.iPieChartDataSet.getValue( index ) / this.sumOfData) * 360; } } jcharts-0.7.5/src/org/jCharts/chartData/processors/ScatterPlotDataProcessor.java0000644000175000001440000001752107751071402027075 0ustar onkarusers/*********************************************************************************************** * File Info: $Id: ScatterPlotDataProcessor.java,v 1.3 2003/04/19 16:42:35 nathaniel_auvil Exp $ * Copyright (C) 2002 * Author: Nathaniel G. Auvil * Contributor(s): * * Copyright 2002 (C) Nathaniel G. Auvil. All Rights Reserved. * * Redistribution and use of this software and associated documentation ("Software"), with or * without modification, are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain copyright statements and notices. * Redistributions must also contain a copy of this document. * * 2. Redistributions in binary form must reproduce the above copyright notice, this list of * conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. * * 3. The name "jCharts" or "Nathaniel G. Auvil" must not be used to endorse or promote * products derived from this Software without prior written permission of Nathaniel G. * Auvil. For written permission, please contact nathaniel_auvil@users.sourceforge.net * * 4. Products derived from this Software may not be called "jCharts" nor may "jCharts" appear * in their names without prior written permission of Nathaniel G. Auvil. jCharts is a * registered trademark of Nathaniel G. Auvil. * * 5. Due credit should be given to the jCharts Project (http://jcharts.sourceforge.net/). * * THIS SOFTWARE IS PROVIDED BY Nathaniel G. Auvil AND CONTRIBUTORS ``AS IS'' AND ANY * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL * jCharts OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE ************************************************************************************************/ package org.jCharts.chartData.processors; import org.jCharts.axisChart.AxisChart; import org.jCharts.chartData.interfaces.IScatterPlotDataSeries; import org.jCharts.chartData.interfaces.IScatterPlotDataSet; import org.jCharts.types.ChartType; import java.awt.font.FontRenderContext; import java.awt.geom.Point2D; /******************************************************************************************* * ********************************************************************************************/ public final class ScatterPlotDataProcessor extends AxisChartDataProcessor { private double yMax; private double yMin; /****************************************************************************************** * Constructor * *******************************************************************************************/ public ScatterPlotDataProcessor() { } /****************************************************************************************** * Method to perform all chart data processing. * * @param axisChart ******************************************************************************************/ public void processData( AxisChart axisChart, FontRenderContext fontRenderContext ) { //todo would it make sense to do this and do the axis titles? /* if( axisChart.getIDataSeries().getChartTitle() != null ) { this.titleTextLayout= new TextLayout( axisChart.getIDataSeries().getChartTitle(), axisChart.getChartProperties().getTitleFont(), fontRenderContext ); } */ IScatterPlotDataSeries iScatterPlotDataSeries = (IScatterPlotDataSeries) axisChart.getIAxisDataSeries(); this.processDataSet( iScatterPlotDataSeries ); //todo does it make sense to do the legend label processing here? /* if( axisChart.hasLegend() ) { //this.lengendLabelProcessor= new TextProcessor(); // this.lengendLabelProcessor } */ } /****************************************************************************************** * Processes the numeric values in the chart data. If there is a user defined scale * there is no need to call this. * * @param iScatterPlotDataSeries ******************************************************************************************/ private void processDataSet( IScatterPlotDataSeries iScatterPlotDataSeries ) { IScatterPlotDataSet iScatterPlotDataSet = (IScatterPlotDataSet) iScatterPlotDataSeries.getIAxisPlotDataSet( ChartType.SCATTER_PLOT ); Point2D.Double point; for( int dataSet = 0; dataSet < iScatterPlotDataSet.getNumberOfDataSets(); dataSet++ ) { for( int index = 0; index < iScatterPlotDataSet.getNumberOfDataItems(); index++ ) { point = iScatterPlotDataSet.getValue( dataSet, index ); if( point == null ) { continue; } if( point.getX() > super.getMaxValue() ) { super.setMaxValue( point.getX() ); } if( point.getX() < super.getMinValue() ) { super.setMinValue( point.getX() ); } if( point.getY() > this.getyMax() ) { this.setyMax( point.getY() ); } if( point.getY() < this.getyMin() ) { this.setyMin( point.getY() ); } } } //System.out.println( this.toString() ); } /****************************************************************************************** * ******************************************************************************************/ public double getyMax() { return yMax; } /****************************************************************************************** * ******************************************************************************************/ public void setyMax( double yMax ) { this.yMax = yMax; } /****************************************************************************************** * ******************************************************************************************/ public double getyMin() { return yMin; } /****************************************************************************************** * ******************************************************************************************/ public void setyMin( double yMin ) { this.yMin = yMin; } /****************************************************************************************** * ******************************************************************************************/ public String toString() { StringBuffer s= new StringBuffer( 60 ); s.append( this.getClass().getName() ); s.append( ": xMin= " + super.getMinValue() ); s.append( " xMax= " + super.getMaxValue() ); s.append( " yMin= " + this.yMin ); s.append( " yMax= " + this.yMax ); return s.toString(); } /********************************************************************************************* * Enables the testing routines to display the contents of this Object. * * @param htmlGenerator ********************************************************************************************** public void toHTML( HTMLGenerator htmlGenerator ) { super.toHTML( htmlGenerator ); String name= this.getClass().getSuperclass().getName() + "->"; //---calling on instance of YAxis or XAxis Field[] fields= this.getClass().getSuperclass().getDeclaredFields(); for( int i=0; i< fields.length; i++ ) { htmlGenerator.addField( name + fields[ i ].getName(), fields[ i ].get( this ) ); } } */ } jcharts-0.7.5/src/org/jCharts/chartData/processors/StackedDataProcessor.java0000644000175000001440000001006007751071402026176 0ustar onkarusers/*********************************************************************************************** * File Info: $Id: StackedDataProcessor.java,v 1.3 2002/12/04 02:38:13 nathaniel_auvil Exp $ * Copyright (C) 2002 * Author: Nathaniel G. Auvil * Contributor(s): * * Copyright 2002 (C) Nathaniel G. Auvil. All Rights Reserved. * * Redistribution and use of this software and associated documentation ("Software"), with or * without modification, are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain copyright statements and notices. * Redistributions must also contain a copy of this document. * * 2. Redistributions in binary form must reproduce the above copyright notice, this list of * conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. * * 3. The name "jCharts" or "Nathaniel G. Auvil" must not be used to endorse or promote * products derived from this Software without prior written permission of Nathaniel G. * Auvil. For written permission, please contact nathaniel_auvil@users.sourceforge.net * * 4. Products derived from this Software may not be called "jCharts" nor may "jCharts" appear * in their names without prior written permission of Nathaniel G. Auvil. jCharts is a * registered trademark of Nathaniel G. Auvil. * * 5. Due credit should be given to the jCharts Project (http://jcharts.sourceforge.net/). * * THIS SOFTWARE IS PROVIDED BY Nathaniel G. Auvil AND CONTRIBUTORS ``AS IS'' AND ANY * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL * jCharts OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE ************************************************************************************************/ package org.jCharts.chartData.processors; import org.jCharts.chartData.interfaces.IAxisChartDataSet; /********************************************************************************************* * Notes: * 1) Stacked data cannot have any negative values. I don't think i have ever seen a * stacked bar chart with negative values just as a side observation. * * ---->There has been one request for this though... * * * **********************************************************************************************/ abstract class StackedDataProcessor { /******************************************************************************************* *
    This method should do a single pass through the data set and calculate all needed values,
    	 *  such as: min, max, sum, etc... so that we can do this in one pass through the data.
    	 *  Rather than once for each.
    * * @param iAxisChartDataSet * @param axisChartDataProcessor ********************************************************************************************/ public static final void processData( IAxisChartDataSet iAxisChartDataSet, AxisChartDataProcessor axisChartDataProcessor ) { double value; //LOOP for( int i=0; i < iAxisChartDataSet.getNumberOfDataItems(); i++ ) { value=0.0d; //LOOP for( int j=0; j < iAxisChartDataSet.getNumberOfDataSets(); j++ ) { value+=iAxisChartDataSet.getValue( j, i ); } if( value > axisChartDataProcessor.getMaxValue() ) { axisChartDataProcessor.setMaxValue( value ); } if( value < axisChartDataProcessor.getMinValue() ) { axisChartDataProcessor.setMinValue( value ); } } } } jcharts-0.7.5/src/org/jCharts/chartData/processors/StockDataProcessor.java0000644000175000001440000000746107751071402025716 0ustar onkarusers/*********************************************************************************************** * File Info: $Id: StockDataProcessor.java,v 1.2 2002/10/14 20:52:04 nathaniel_auvil Exp $ * Copyright (C) 2000 * Author: Nathaniel G. Auvil * Contributor(s): * * Copyright 2002 (C) Nathaniel G. Auvil. All Rights Reserved. * * Redistribution and use of this software and associated documentation * ("Software"), with or without modification, are permitted provided * that the following conditions are met: * * 1. Redistributions of source code must retain copyright * statements and notices. Redistributions must also contain a * copy of this document. * * 2. Redistributions in binary form must reproduce the * above copyright notice, this list of conditions and the * following disclaimer in the documentation and/or other * materials provided with the distribution. * * 3. The name "jCharts" or "Nathaniel G. Auvil" must not be used to * endorse or promote products derived from this Software without * prior written permission of Nathaniel G. Auvil. For written * permission, please contact nathaniel_auvil@users.sourceforge.net * * 4. Products derived from this Software may not be called "jCharts" * nor may "jCharts" appear in their names without prior written * permission of Nathaniel G. Auvil. jCharts is a registered * trademark of Nathaniel G. Auvil. * * 5. Due credit should be given to the jCharts Project * (http://jcharts.sourceforge.net/). * * THIS SOFTWARE IS PROVIDED BY Nathaniel G. Auvil AND CONTRIBUTORS * ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT * NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL * jCharts OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED * OF THE POSSIBILITY OF SUCH DAMAGE. ************************************************************************************************/ package org.jCharts.chartData.processors; import org.jCharts.chartData.interfaces.IStockChartDataSet; /******************************************************************************************* * Custom processor for the Stock Chart as data is semi-processed by default. * *******************************************************************************************/ abstract class StockDataProcessor { /******************************************************************************************* * Only need to loop through the 'high' to find MAX and 'low' to find MIN. * * @param iStockChartDataSet * @param axisChartDataProcessor ********************************************************************************************/ public static final void processData( IStockChartDataSet iStockChartDataSet, AxisChartDataProcessor axisChartDataProcessor ) { //LOOP for( int i=0; i < iStockChartDataSet.getNumberOfDataItems(); i++ ) { //---look for MAX in 'high'. if( iStockChartDataSet.getHighValue( i ) > axisChartDataProcessor.getMaxValue() ) { axisChartDataProcessor.setMaxValue( iStockChartDataSet.getHighValue( i ) ); } //---look for MIN in 'Low' if( iStockChartDataSet.getLowValue( i ) < axisChartDataProcessor.getMinValue() ) { axisChartDataProcessor.setMinValue( iStockChartDataSet.getLowValue( i ) ); } } } } jcharts-0.7.5/src/org/jCharts/chartData/processors/TextProcessor.java0000644000175000001440000001476307751071402024770 0ustar onkarusers/*********************************************************************************************** * File Info: $Id: TextProcessor.java,v 1.4 2002/12/05 22:08:39 nathaniel_auvil Exp $ * Copyright (C) 2002 * Author: Nathaniel G. Auvil * Contributor(s): * * Copyright 2002 (C) Nathaniel G. Auvil. All Rights Reserved. * * Redistribution and use of this software and associated documentation ("Software"), with or * without modification, are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain copyright statements and notices. * Redistributions must also contain a copy of this document. * * 2. Redistributions in binary form must reproduce the above copyright notice, this list of * conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. * * 3. The name "jCharts" or "Nathaniel G. Auvil" must not be used to endorse or promote * products derived from this Software without prior written permission of Nathaniel G. * Auvil. For written permission, please contact nathaniel_auvil@users.sourceforge.net * * 4. Products derived from this Software may not be called "jCharts" nor may "jCharts" appear * in their names without prior written permission of Nathaniel G. Auvil. jCharts is a * registered trademark of Nathaniel G. Auvil. * * 5. Due credit should be given to the jCharts Project (http://jcharts.sourceforge.net/). * * THIS SOFTWARE IS PROVIDED BY Nathaniel G. Auvil AND CONTRIBUTORS ``AS IS'' AND ANY * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL * jCharts OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE ************************************************************************************************/ package org.jCharts.chartData.processors; import org.jCharts.chartText.TextTag; import java.awt.*; import java.awt.font.FontRenderContext; import java.util.ArrayList; /******************************************************************************************* * * *******************************************************************************************/ public class TextProcessor { private float widestLabel = Float.MIN_VALUE; private float tallestLabel = Float.MIN_VALUE; private float totalLabelWidths = 0.0f; private ArrayList textTags; /****************************************************************************************** * Constructor * *******************************************************************************************/ public TextProcessor() { this.textTags = new ArrayList( 30 ); } /****************************************************************************************** * * @param label * @param font * @param fontRenderContext *******************************************************************************************/ public void addLabel( String label, Font font, FontRenderContext fontRenderContext ) { TextTag textTag= new TextTag( label, font, fontRenderContext ); this.textTags.add( textTag ); this.widestLabel = Math.max( textTag.getWidth(), this.widestLabel ); this.totalLabelWidths += textTag.getWidth(); this.tallestLabel = Math.max( textTag.getHeight(), this.tallestLabel ); } /****************************************************************************************** * Returns the number of labels * * @return int ******************************************************************************************/ public int size() { return this.textTags.size(); } /****************************************************************************************** * Calculates the width and height needed by the passed String when rendered * // * @param iDataSeries / * @param font // * @param fontRenderContext ******************************************************************************************* public void processLabels( IDataSeries iDataSeries) { //LOOP for( int i = 0; i < iDataSeries.getNumberOfXAxisLabels(); i++ ) { this.axisLabelProcessor.processLabel( iDataSeries.getXAxisLabel( i ), axisLabelFont, fontRenderContext ); } TextLayout textLayout = new TextLayout( label, font, fontRenderContext ); //---WIDTH this.labelWidths[ counter ] = textLayout.getAdvance(); this.widestLabel = Math.max( this.labelWidths[ counter ], this.widestLabel ); this.totalLabelWidths += this.labelWidths[ counter ]; //---HEIGHT this.labelHeights[ counter ] = textLayout.getAscent() + textLayout.getDescent(); this.tallestLabel = Math.max( this.labelHeights[ counter ], this.tallestLabel ); //---need this to offset font rendering, as rendering is at the baseline not bottom or top, this.fontDescent = textLayout.getDescent(); this.counter++; } /****************************************************************************************** * * ******************************************************************************************/ public float getWidestLabel() { return this.widestLabel; } /****************************************************************************************** * * ******************************************************************************************/ public float getTallestLabel() { return this.tallestLabel; } /****************************************************************************************** * * ******************************************************************************************/ public float getTotalLabelWidths() { return this.totalLabelWidths; } /****************************************************************************************** * * @param index * @return TextTag ******************************************************************************************/ public TextTag getTextTag( int index ) { return (TextTag) this.textTags.get( index ); } } jcharts-0.7.5/src/org/jCharts/chartData/AxisChartDataSet.java0000644000175000001440000001532607751071402023072 0ustar onkarusers/*********************************************************************************************** * File Info: $Id: AxisChartDataSet.java,v 1.4 2003/02/17 02:52:45 nathaniel_auvil Exp $ * Copyright (C) 2002 * Author: Nathaniel G. Auvil * Contributor(s): * * Copyright 2002 (C) Nathaniel G. Auvil. All Rights Reserved. * * Redistribution and use of this software and associated documentation ("Software"), with or * without modification, are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain copyright statements and notices. * Redistributions must also contain a copy of this document. * * 2. Redistributions in binary form must reproduce the above copyright notice, this list of * conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. * * 3. The name "jCharts" or "Nathaniel G. Auvil" must not be used to endorse or promote * products derived from this Software without prior written permission of Nathaniel G. * Auvil. For written permission, please contact nathaniel_auvil@users.sourceforge.net * * 4. Products derived from this Software may not be called "jCharts" nor may "jCharts" appear * in their names without prior written permission of Nathaniel G. Auvil. jCharts is a * registered trademark of Nathaniel G. Auvil. * * 5. Due credit should be given to the jCharts Project (http://jcharts.sourceforge.net/). * * THIS SOFTWARE IS PROVIDED BY Nathaniel G. Auvil AND CONTRIBUTORS ``AS IS'' AND ANY * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL * jCharts OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE ************************************************************************************************/ package org.jCharts.chartData; import org.jCharts.chartData.interfaces.IAxisChartDataSet; import org.jCharts.properties.*; import org.jCharts.test.HTMLGenerator; import org.jCharts.test.HTMLTestable; import org.jCharts.types.ChartType; import java.awt.*; public final class AxisChartDataSet extends DataSet implements IAxisChartDataSet, HTMLTestable { private ChartType chartType; /****************************************************************************************** * Constructor * * @param data the data sets to be displayed in the chart. * @param legendLabels if this is: NULL there will be no Legend. Otherwise, there must be an * one to one mapping of labels to data sets. * @param paints paints to use for the data sets. There must be an one to one mapping of * labels to data sets. * @param chartType constant defining how this data should be rendered * @param chartTypeProperties properties Object specific to the type of chart you are rendering. * @throws ChartDataException if data is not in correct form. *******************************************************************************************/ public AxisChartDataSet( double[][] data, String[] legendLabels, Paint[] paints, ChartType chartType, ChartTypeProperties chartTypeProperties ) throws ChartDataException { super( data, legendLabels, paints, chartTypeProperties ); this.chartType=chartType; } /************************************************************************************************ * Performs a limited validation of data. This is static and not called by the rendering engine * so as to avoid the, albeit small, cost of validation checking during deployment; this is viewed * more so as a development time test. * * @throws ChartDataException *************************************************************************************************/ public void validate() throws ChartDataException, PropertyException { if( ( super.legendLabels != null ) && ( super.data.length != super.legendLabels.length ) ) { throw new ChartDataException( "There is not an one to one mapping of 'legend labels' to 'data sets'." ); } if( super.data.length != super.paints.length ) { throw new ChartDataException( "There is not an one to one mapping of 'Paint' implementations to 'data sets'." ); } ( (AxisChartTypeProperties) super.getChartTypeProperties() ).validate( this ); } /****************************************************************************************** * Returns the value in the data set at the specified position. * * @param dataset * @param index * @return double * @throws ArrayIndexOutOfBoundsException *******************************************************************************************/ public final double getValue( int dataset, int index ) throws ArrayIndexOutOfBoundsException { return super.data[ dataset ][ index ]; } /****************************************************************************************** * Returns the type constant that this data set should be plotted as. * * @return ChartType * @see ChartType *******************************************************************************************/ public final ChartType getChartType() { return this.chartType; } /****************************************************************************************** * Returns the number of IAxisChartDataSet Objects in this series * * @return int ******************************************************************************************/ public final int getNumberOfDataSets() { return this.data.length; } /********************************************************************************************* * Enables the testing routines to display the contents of this Object. * * @param htmlGenerator **********************************************************************************************/ public void toHTML( HTMLGenerator htmlGenerator ) { super.toHTML( htmlGenerator ); /* //String name= this.getClass().getSuperclass().getName() + "->"; Field[] fields= this.getClass().getDeclaredFields(); for( int i=0; i< fields.length; i++ ) { htmlGenerator.addTableRow( fields[ i ].getName(), fields[ i ].get( this ) ); } */ } } jcharts-0.7.5/src/org/jCharts/chartData/AxisDataSeries.java0000644000175000001440000002265407751071402022611 0ustar onkarusers/*********************************************************************************************** * File Info: $Id: AxisDataSeries.java,v 1.2 2003/02/17 18:20:59 nathaniel_auvil Exp $ * Copyright (C) 2002 * Author: Nathaniel G. Auvil * Contributor(s): * * Copyright 2002 (C) Nathaniel G. Auvil. All Rights Reserved. * * Redistribution and use of this software and associated documentation ("Software"), with or * without modification, are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain copyright statements and notices. * Redistributions must also contain a copy of this document. * * 2. Redistributions in binary form must reproduce the above copyright notice, this list of * conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. * * 3. The name "jCharts" or "Nathaniel G. Auvil" must not be used to endorse or promote * products derived from this Software without prior written permission of Nathaniel G. * Auvil. For written permission, please contact nathaniel_auvil@users.sourceforge.net * * 4. Products derived from this Software may not be called "jCharts" nor may "jCharts" appear * in their names without prior written permission of Nathaniel G. Auvil. jCharts is a * registered trademark of Nathaniel G. Auvil. * * 5. Due credit should be given to the jCharts Project (http://jcharts.sourceforge.net/). * * THIS SOFTWARE IS PROVIDED BY Nathaniel G. Auvil AND CONTRIBUTORS ``AS IS'' AND ANY * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL * jCharts OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE ************************************************************************************************/ package org.jCharts.chartData; import org.jCharts.chartData.interfaces.IAxisDataSeries; import org.jCharts.chartData.interfaces.IAxisPlotDataSet; import org.jCharts.test.HTMLGenerator; import org.jCharts.test.HTMLTestable; import org.jCharts.types.ChartType; import org.jCharts.properties.PropertyException; import java.util.Iterator; import java.util.HashMap; /********************************************************************************************* * Collection of all IAxisChartDataSets to display in an AxisChart * **********************************************************************************************/ public abstract class AxisDataSeries implements IAxisDataSeries, HTMLTestable { private String chartTitle; private String xAxisTitle; private String yAxisTitle; protected HashMap dataSets; protected int totalNumberOfDataSets; private int sizeOfEachDataSet; /****************************************************************************************** * Constructor * * @param xAxisTitle if this is NULL, no title will be displayed * @param yAxisTitle if this is NULL, no title will be displayed * @param chartTitle if this is NULL, no title will be displayed *******************************************************************************************/ public AxisDataSeries( String xAxisTitle, String yAxisTitle, String chartTitle ) { this.xAxisTitle=xAxisTitle; this.yAxisTitle=yAxisTitle; this.chartTitle=chartTitle; dataSets = new HashMap(); } /****************************************************************************************** * Returns the x-axis title * * @return String *******************************************************************************************/ public String getXAxisTitle() { return this.xAxisTitle; } /****************************************************************************************** * Returns the y-axis title * * @return String *******************************************************************************************/ public String getYAxisTitle() { return this.yAxisTitle; } /****************************************************************************************** * Returns the chart title. * * @return String the chart title. If this returns NULL, no title will be displayed. ******************************************************************************************/ public String getChartTitle() { return this.chartTitle; } /****************************************************************************************** * Returns the IAxisPlotDataSet for the passed chart type constant. Will return NULL if * if no data set exists for the passed type. * * @param chartType * @return IAxisPlotDataSet ******************************************************************************************/ public IAxisPlotDataSet getIAxisPlotDataSet( ChartType chartType ) { return (IAxisPlotDataSet) this.dataSets.get( chartType ); } /****************************************************************************************** * Returns an Iterator over a List of IAxisPlotDataSet Objects * * @return Iterator over a List of IAxisPlotDataSet Objects *******************************************************************************************/ public Iterator getIAxisPlotDataSetIterator() { return this.dataSets.values().iterator(); } /****************************************************************************************** * Returns the total number data dimensions in all of the IAxisChartDataSets contained in * this collection. For example, if this contains two IAxisChartDataSets and each one * contains 3 dimensions ( 3 lines and 3 sets of points ), this should return six. This * provides a means to avoid looping the contents of the series each time i need the value. * * @return int ******************************************************************************************/ public int getTotalNumberOfDataSets() { return this.totalNumberOfDataSets; } /****************************************************************************************** * Adds the passed IAxisPlotDataSet to the series * * @param iAxisPlotDataSet ******************************************************************************************/ public void addIAxisPlotDataSet( IAxisPlotDataSet iAxisPlotDataSet ) { this.dataSets.put( iAxisPlotDataSet.getChartType(), iAxisPlotDataSet ); //---set the number of dimensions totalNumberOfDataSets+=iAxisPlotDataSet.getNumberOfDataSets(); this.sizeOfEachDataSet= iAxisPlotDataSet.getNumberOfDataItems(); } /**************************************************************************************** * * @throws ChartDataException * @throws org.jCharts.properties.PropertyException ***************************************************************************************/ public void validate() throws ChartDataException, PropertyException { IAxisPlotDataSet iAxisPlotDataSet; Iterator iterator= this.getIAxisPlotDataSetIterator(); while( iterator.hasNext() ) { iAxisPlotDataSet= (IAxisPlotDataSet) iterator.next(); iAxisPlotDataSet.validate(); if( iAxisPlotDataSet.getNumberOfDataItems() != this.sizeOfEachDataSet ) { throw new ChartDataException( "All IAxisPlotDataSet implementations must contain an equal number of elements in a Combo Chart" ); } } } /****************************************************************************************** * Returns number of elements in each data set dimension, so i can validate a that all * IAxisPlotDataSets on a ComboChart have the same number of elements, as well as the * number of Axis Labels equal the number of data elements other charts. * * @return int *****************************************************************************************/ public int getSizeOfEachDataSet() { return sizeOfEachDataSet; } /********************************************************************************************* * Enables the testing routines to display the contents of this Object. * * @param htmlGenerator **********************************************************************************************/ public void toHTML( HTMLGenerator htmlGenerator ) { htmlGenerator.propertiesTableRowStart(); { htmlGenerator.propertiesTableStart( this.getClass().getName() ); htmlGenerator.addTableRow( "chart title", this.chartTitle ); htmlGenerator.addTableRow( "xAxisTitle", this.xAxisTitle ); htmlGenerator.addTableRow( "yAxisTitle", this.yAxisTitle ); htmlGenerator.propertiesTableEnd(); } htmlGenerator.propertiesTableRowEnd(); } /****************************************************************************************** * Returns the number of IAxisPlotDataSet Objects in this series * * @return int ******************************************************************************************/ public int size() { return this.dataSets.size(); } } jcharts-0.7.5/src/org/jCharts/chartData/ChartDataException.java0000644000175000001440000000531207751071402023442 0ustar onkarusers /*********************************************************************************************** * File Info: $Id: ChartDataException.java,v 1.4 2003/04/19 00:31:25 nathaniel_auvil Exp $ * Copyright (C) 2002 * Author: Nathaniel G. Auvil * Contributor(s): * * Copyright 2002 (C) Nathaniel G. Auvil. All Rights Reserved. * * Redistribution and use of this software and associated documentation ("Software"), with or * without modification, are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain copyright statements and notices. * Redistributions must also contain a copy of this document. * * 2. Redistributions in binary form must reproduce the above copyright notice, this list of * conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. * * 3. The name "jCharts" or "Nathaniel G. Auvil" must not be used to endorse or promote * products derived from this Software without prior written permission of Nathaniel G. * Auvil. For written permission, please contact nathaniel_auvil@users.sourceforge.net * * 4. Products derived from this Software may not be called "jCharts" nor may "jCharts" appear * in their names without prior written permission of Nathaniel G. Auvil. jCharts is a * registered trademark of Nathaniel G. Auvil. * * 5. Due credit should be given to the jCharts Project (http://jcharts.sourceforge.net/). * * THIS SOFTWARE IS PROVIDED BY Nathaniel G. Auvil AND CONTRIBUTORS ``AS IS'' AND ANY * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL * jCharts OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE ************************************************************************************************/ package org.jCharts.chartData; public class ChartDataException extends Exception { private Throwable throwable; public ChartDataException( String message ) { super( message ); } public ChartDataException( String message, Throwable throwable ) { super( message ); this.throwable= throwable; } } jcharts-0.7.5/src/org/jCharts/chartData/DataSeries.java0000644000175000001440000001410007751071402021747 0ustar onkarusers/*********************************************************************************************** * File Info: $Id: DataSeries.java,v 1.7 2003/03/09 22:42:10 nathaniel_auvil Exp $ * Copyright (C) 2002 * Author: Nathaniel G. Auvil * Contributor(s): * * Copyright 2002 (C) Nathaniel G. Auvil. All Rights Reserved. * * Redistribution and use of this software and associated documentation ("Software"), with or * without modification, are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain copyright statements and notices. * Redistributions must also contain a copy of this document. * * 2. Redistributions in binary form must reproduce the above copyright notice, this list of * conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. * * 3. The name "jCharts" or "Nathaniel G. Auvil" must not be used to endorse or promote * products derived from this Software without prior written permission of Nathaniel G. * Auvil. For written permission, please contact nathaniel_auvil@users.sourceforge.net * * 4. Products derived from this Software may not be called "jCharts" nor may "jCharts" appear * in their names without prior written permission of Nathaniel G. Auvil. jCharts is a * registered trademark of Nathaniel G. Auvil. * * 5. Due credit should be given to the jCharts Project (http://jcharts.sourceforge.net/). * * THIS SOFTWARE IS PROVIDED BY Nathaniel G. Auvil AND CONTRIBUTORS ``AS IS'' AND ANY * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL * jCharts OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE ************************************************************************************************/ package org.jCharts.chartData; import org.jCharts.chartData.interfaces.IDataSeries; import org.jCharts.properties.PropertyException; import org.jCharts.test.HTMLGenerator; import org.jCharts.test.HTMLTestable; import java.util.Iterator; /********************************************************************************************* * Collection of all IAxisPlotDataSets to display in an AxisChart * **********************************************************************************************/ public class DataSeries extends AxisDataSeries implements IDataSeries, HTMLTestable { private String[] axisLabels; /****************************************************************************************** * Constructor * * @param axisLabels * @param xAxisTitle if this is NULL, no title will be displayed * @param yAxisTitle if this is NULL, no title will be displayed * @param chartTitle if this is NULL, no title will be displayed *******************************************************************************************/ public DataSeries( String[] axisLabels, String xAxisTitle, String yAxisTitle, String chartTitle ) { super( xAxisTitle, yAxisTitle, chartTitle ); this.axisLabels = axisLabels; } /****************************************************************************************** * Returns the x-axis label corresponding to the passed index * * @param index * @return String *******************************************************************************************/ public String getAxisLabel( int index ) { return this.axisLabels[ index ]; } /****************************************************************************************** * Returns the number of labels on the x-axis * * @return int ******************************************************************************************/ public int getNumberOfAxisLabels() { if( this.axisLabels != null ) { return this.axisLabels.length; } else { return 0; } } /**************************************************************************************** * * @throws ChartDataException * @throws PropertyException ***************************************************************************************/ public void validate() throws ChartDataException, PropertyException { super.validate(); if( this.axisLabels != null && this.axisLabels.length != super.getSizeOfEachDataSet() ) { throw new ChartDataException( "The size of the Axis Labels Array does not match the number of data elements to be plotted." ); } } /********************************************************************************************* * Enables the testing routines to display the contents of this Object. * * @param htmlGenerator **********************************************************************************************/ public void toHTML( HTMLGenerator htmlGenerator ) { htmlGenerator.propertiesTableRowStart(); { htmlGenerator.propertiesTableStart( this.getClass().getName() ); htmlGenerator.addTableRow( "xAxisLabels", HTMLGenerator.arrayToString( this.axisLabels ) ); htmlGenerator.addTableRow( "totalNumberOfDataSets", Integer.toString( totalNumberOfDataSets ) ); htmlGenerator.propertiesTableEnd(); } htmlGenerator.propertiesTableRowEnd(); htmlGenerator.propertiesTableRowStart(); { //---loop the data sets Iterator iterator = this.getIAxisPlotDataSetIterator(); Object object; while( iterator.hasNext() ) { object = iterator.next(); if( object instanceof HTMLTestable ) { ((HTMLTestable) object).toHTML( htmlGenerator ); } } } htmlGenerator.propertiesTableRowEnd(); } } jcharts-0.7.5/src/org/jCharts/chartData/DataSet.java0000644000175000001440000001474307751071402021265 0ustar onkarusers/*********************************************************************************************** * File Info: $Id: DataSet.java,v 1.4 2003/02/17 02:52:45 nathaniel_auvil Exp $ * Copyright (C) 2002 * Author: Nathaniel G. Auvil * Contributor(s): * * Copyright 2002 (C) Nathaniel G. Auvil. All Rights Reserved. * * Redistribution and use of this software and associated documentation ("Software"), with or * without modification, are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain copyright statements and notices. * Redistributions must also contain a copy of this document. * * 2. Redistributions in binary form must reproduce the above copyright notice, this list of * conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. * * 3. The name "jCharts" or "Nathaniel G. Auvil" must not be used to endorse or promote * products derived from this Software without prior written permission of Nathaniel G. * Auvil. For written permission, please contact nathaniel_auvil@users.sourceforge.net * * 4. Products derived from this Software may not be called "jCharts" nor may "jCharts" appear * in their names without prior written permission of Nathaniel G. Auvil. jCharts is a * registered trademark of Nathaniel G. Auvil. * * 5. Due credit should be given to the jCharts Project (http://jcharts.sourceforge.net/). * * THIS SOFTWARE IS PROVIDED BY Nathaniel G. Auvil AND CONTRIBUTORS ``AS IS'' AND ANY * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL * jCharts OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE ************************************************************************************************/ package org.jCharts.chartData; import org.jCharts.chartData.interfaces.IDataSet; import org.jCharts.properties.ChartTypeProperties; import org.jCharts.test.HTMLGenerator; import org.jCharts.test.HTMLTestable; import java.awt.*; public class DataSet implements IDataSet, HTMLTestable { private ChartTypeProperties chartTypeProperties; protected double[][] data; protected String[] legendLabels; protected Paint[] paints; /****************************************************************************************** * Constructor * * @param data * @param legendLabels will be NULL if no Legend. * @param paints * @param chartTypeProperties *******************************************************************************************/ public DataSet( double[][] data, String[] legendLabels, Paint[] paints, ChartTypeProperties chartTypeProperties ) { this.data = data; this.legendLabels = legendLabels; this.paints = paints; this.chartTypeProperties = chartTypeProperties; } /****************************************************************************************** * Returns the legend label for the passed index. This index corresponds to the DataSet * for which label you want. * * @param index * @return String *******************************************************************************************/ public final String getLegendLabel( int index ) { if( this.legendLabels == null ) { return null; } else { return this.legendLabels[ index ]; } } /********************************************************************************************* * Returns the number of Legend Labels to display. This may not be the same as the number of * Data Items, as in AxisCharts, or Data Sets, as in Pie Charts. * * @return int **********************************************************************************************/ public int getNumberOfLegendLabels() { if( this.legendLabels == null ) { return 0; } else { return this.legendLabels.length; } } /****************************************************************************************** * Returns the legend label for the passed index. This index corresponds to the DataSet * for which label you want. * * @param index * @return Paint *******************************************************************************************/ public Paint getPaint( int index ) { return this.paints[ index ]; } /****************************************************************************************** * * * @return ChartTypeProperties *******************************************************************************************/ public ChartTypeProperties getChartTypeProperties() { return this.chartTypeProperties; } /****************************************************************************************** * Returns the number of elements in the data set. All data sets must be of the same length * so just look at the first one. * * @return int *******************************************************************************************/ public int getNumberOfDataItems() { return this.data[ 0 ].length; } /********************************************************************************************* * Enables the testing routines to display the contents of this Object. * * @param htmlGenerator **********************************************************************************************/ public void toHTML( HTMLGenerator htmlGenerator ) { htmlGenerator.propertiesTableStart( this.getClass().getName() ); htmlGenerator.addTableRow( "data", HTMLGenerator.arrayToString( this.data ) ); if( this.legendLabels != null ) { htmlGenerator.addTableRow( "legendLabels", HTMLGenerator.arrayToString( this.legendLabels ) ); } htmlGenerator.addTableRow( "paints", HTMLGenerator.arrayToString( this.paints ) ); htmlGenerator.propertiesTableEnd(); htmlGenerator.chartTableRowStart(); this.chartTypeProperties.toHTML( htmlGenerator ); htmlGenerator.chartTableRowEnd(); } } jcharts-0.7.5/src/org/jCharts/chartData/PieChartDataSet.java0000644000175000001440000001262007751071402022675 0ustar onkarusers/*********************************************************************************************** * File Info: $Id: PieChartDataSet.java,v 1.3 2003/02/17 02:52:45 nathaniel_auvil Exp $ * Copyright (C) 2002 * Author: Nathaniel G. Auvil * Contributor(s): * * Copyright 2002 (C) Nathaniel G. Auvil. All Rights Reserved. * * Redistribution and use of this software and associated documentation ("Software"), with or * without modification, are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain copyright statements and notices. * Redistributions must also contain a copy of this document. * * 2. Redistributions in binary form must reproduce the above copyright notice, this list of * conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. * * 3. The name "jCharts" or "Nathaniel G. Auvil" must not be used to endorse or promote * products derived from this Software without prior written permission of Nathaniel G. * Auvil. For written permission, please contact nathaniel_auvil@users.sourceforge.net * * 4. Products derived from this Software may not be called "jCharts" nor may "jCharts" appear * in their names without prior written permission of Nathaniel G. Auvil. jCharts is a * registered trademark of Nathaniel G. Auvil. * * 5. Due credit should be given to the jCharts Project (http://jcharts.sourceforge.net/). * * THIS SOFTWARE IS PROVIDED BY Nathaniel G. Auvil AND CONTRIBUTORS ``AS IS'' AND ANY * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL * jCharts OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE ************************************************************************************************/ package org.jCharts.chartData; import org.jCharts.chartData.interfaces.IPieChartDataSet; import org.jCharts.properties.PieChart2DProperties; import java.awt.*; /******************************************************************************************* * Implementation of the IPieChartDataSet Interface for use with the PieChart2D Object. * *******************************************************************************************/ final public class PieChartDataSet extends DataSet implements IPieChartDataSet { private String chartTitle; /****************************************************************************************** * Constructor * * @param chartTitle if the title is NULL, no title will be drawn * @param data * @param legendLabels * @param paints * @param pieChart2DProperties * @throws ChartDataException if fails a limited validation check *******************************************************************************************/ public PieChartDataSet( String chartTitle, double[] data, String[] legendLabels, Paint[] paints, PieChart2DProperties pieChart2DProperties ) throws ChartDataException { super( new double[][]{data}, legendLabels, paints, pieChart2DProperties ); this.chartTitle=chartTitle; this.validateData( data, legendLabels, paints ); } /******************************************************************************************* * Perform some limited validation of the structure of the passed data. This is useful for * development. * * @param data * @param legendLabels * @param paints * @throws ChartDataException *******************************************************************************************/ private void validateData( double[] data, String[] legendLabels, Paint[] paints ) throws ChartDataException { if( legendLabels != null && ( data.length != legendLabels.length ) ) { throw new ChartDataException( "There is not an one to one mapping of 'legend labels' to 'data items'." ); } if( data.length != paints.length ) { throw new ChartDataException( "There is not an one to one mapping of 'Paint' Implementations to 'data items'." ); } } /****************************************************************************************** * Returns the chart title. * * @return String the chart title. If this returns NULL, no title will be displayed. ******************************************************************************************/ public String getChartTitle() { return this.chartTitle; } /****************************************************************************************** * Returns the value in the data set at the specified position. * * @param index * @return double * @throws ArrayIndexOutOfBoundsException *******************************************************************************************/ public double getValue( int index ) throws ArrayIndexOutOfBoundsException { return super.data[ 0 ][ index ]; } } jcharts-0.7.5/src/org/jCharts/chartData/ScatterPlotDataSeries.java0000644000175000001440000001606307751071402024146 0ustar onkarusers/*********************************************************************************************** * File Info: $Id: ScatterPlotDataSeries.java,v 1.3 2003/02/21 15:48:55 nathaniel_auvil Exp $ * Copyright (C) 2002 * Author: Nathaniel G. Auvil * Contributor(s): * * Copyright 2002 (C) Nathaniel G. Auvil. All Rights Reserved. * * Redistribution and use of this software and associated documentation ("Software"), with or * without modification, are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain copyright statements and notices. * Redistributions must also contain a copy of this document. * * 2. Redistributions in binary form must reproduce the above copyright notice, this list of * conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. * * 3. The name "jCharts" or "Nathaniel G. Auvil" must not be used to endorse or promote * products derived from this Software without prior written permission of Nathaniel G. * Auvil. For written permission, please contact nathaniel_auvil@users.sourceforge.net * * 4. Products derived from this Software may not be called "jCharts" nor may "jCharts" appear * in their names without prior written permission of Nathaniel G. Auvil. jCharts is a * registered trademark of Nathaniel G. Auvil. * * 5. Due credit should be given to the jCharts Project (http://jcharts.sourceforge.net/). * * THIS SOFTWARE IS PROVIDED BY Nathaniel G. Auvil AND CONTRIBUTORS ``AS IS'' AND ANY * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL * jCharts OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE ************************************************************************************************/ package org.jCharts.chartData; import org.jCharts.chartData.interfaces.*; import org.jCharts.test.HTMLGenerator; import org.jCharts.test.HTMLTestable; import org.jCharts.types.ChartType; import org.jCharts.properties.PropertyException; import org.jCharts.axisChart.AxisChart; import java.util.HashMap; import java.util.Iterator; /********************************************************************************************* * Collection of all IAxisPlotDataSets to display in an AxisChart * **********************************************************************************************/ public class ScatterPlotDataSeries extends AxisDataSeries implements IScatterPlotDataSeries, HTMLTestable { //private IScatterPlotDataSet iScatterPlotDataSet; /****************************************************************************************** * Constructor * * @param xAxisTitle if this is NULL, no title will be displayed * @param yAxisTitle if this is NULL, no title will be displayed * @param chartTitle if this is NULL, no title will be displayed *******************************************************************************************/ public ScatterPlotDataSeries( IScatterPlotDataSet iScatterPlotDataSet, String xAxisTitle, String yAxisTitle, String chartTitle ) { super( xAxisTitle, yAxisTitle, chartTitle ); super.addIAxisPlotDataSet( iScatterPlotDataSet ); } /****************************************************************************************** * Returns the number of IAxisChartDataSet Objects in this series * * @return int * @deprecated ****************************************************************************************** public int getNumberOfIAxisChartDataSets() { return this.dataSets.size(); } /****************************************************************************************** * Returns the number of IAxisPlotDataSet Objects in this series * * @return int ****************************************************************************************** public int size() { return this.dataSets.size(); } /****************************************************************************************** * * @return IScatterPlotDataSet * @deprecated ****************************************************************************************** public IScatterPlotDataSet getIScatterPlotDataSet() { return this.iScatterPlotDataSet; } /****************************************************************************************** * Returns an Iterator over a List of IAxisPlotDataSet Objects * * @return Iterator over a List of IAxisPlotDataSet Objects *******************************************************************************************/ /* public Iterator getIAxisPlotDataSetIterator() { return this.dataSets.values().iterator(); } */ /****************************************************************************************** * Returns the total number data dimensions in all of the IAxisChartDataSets contained in * this collection. For example, if this contains two IAxisChartDataSets and each one * contains 3 dimensions ( 3 lines and 3 sets of points ), this should return six. This * provides a means to avoid looping the contents of the series each time i need the value. * // * @return int ****************************************************************************************** public int getTotalNumberOfDataSets() { return this.totalNumberOfDataSets; } /********************************************************************************************* * Enables the testing routines to display the contents of this Object. * * @param htmlGenerator **********************************************************************************************/ public void toHTML( HTMLGenerator htmlGenerator ) { /* htmlGenerator.propertiesTableRowStart(); { htmlGenerator.propertiesTableStart( this.getClass().getName() ); htmlGenerator.addTableRow( "xAxisLabels", HTMLGenerator.arrayToString( this.xAxisLabels ) ); htmlGenerator.addTableRow( "totalNumberOfDataSets", Integer.toString( totalNumberOfDataSets ) ); htmlGenerator.propertiesTableEnd(); } htmlGenerator.propertiesTableRowEnd(); */ /* htmlGenerator.propertiesTableRowStart(); { //---loop the data sets Iterator iterator=this.getIAxisPlotDataSetIterator(); Object object; while( iterator.hasNext() ) { object=iterator.next(); if( object instanceof HTMLTestable ) { ( (HTMLTestable) object ).toHTML( htmlGenerator ); } } } htmlGenerator.propertiesTableRowEnd(); */ } } jcharts-0.7.5/src/org/jCharts/chartData/ScatterPlotDataSet.java0000644000175000001440000002345307751071402023450 0ustar onkarusers/*********************************************************************************************** * File Info: $Id: ScatterPlotDataSet.java,v 1.2 2003/02/17 02:52:45 nathaniel_auvil Exp $ * Copyright (C) 2002 * Author: Nathaniel G. Auvil * Contributor(s): * * Copyright 2002 (C) Nathaniel G. Auvil. All Rights Reserved. * * Redistribution and use of this software and associated documentation ("Software"), with or * without modification, are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain copyright statements and notices. * Redistributions must also contain a copy of this document. * * 2. Redistributions in binary form must reproduce the above copyright notice, this list of * conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. * * 3. The name "jCharts" or "Nathaniel G. Auvil" must not be used to endorse or promote * products derived from this Software without prior written permission of Nathaniel G. * Auvil. For written permission, please contact nathaniel_auvil@users.sourceforge.net * * 4. Products derived from this Software may not be called "jCharts" nor may "jCharts" appear * in their names without prior written permission of Nathaniel G. Auvil. jCharts is a * registered trademark of Nathaniel G. Auvil. * * 5. Due credit should be given to the jCharts Project (http://jcharts.sourceforge.net/). * * THIS SOFTWARE IS PROVIDED BY Nathaniel G. Auvil AND CONTRIBUTORS ``AS IS'' AND ANY * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL * jCharts OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE ************************************************************************************************/ package org.jCharts.chartData; import org.jCharts.chartData.interfaces.IScatterPlotDataSet; import org.jCharts.properties.ChartTypeProperties; import org.jCharts.properties.ScatterPlotProperties; import org.jCharts.test.HTMLGenerator; import org.jCharts.test.HTMLTestable; import org.jCharts.types.ChartType; import java.awt.*; import java.awt.geom.Point2D; import java.util.ArrayList; public class ScatterPlotDataSet implements IScatterPlotDataSet, HTMLTestable { //---use this to clone for better performance than creating new private static Point2D.Double POINT= new Point2D.Double(); private ArrayList data; private ArrayList legendLabels; private ArrayList paints; private ScatterPlotProperties scatterPlotProperties; private int numDataItems= -1; /****************************************************************************************** * Constructor * * @param scatterPlotProperties *******************************************************************************************/ public ScatterPlotDataSet( ScatterPlotProperties scatterPlotProperties ) { this.data = new ArrayList(); this.legendLabels = new ArrayList(); this.paints = new ArrayList(); this.scatterPlotProperties = scatterPlotProperties; } /****************************************************************************************** * Returns the type constant that this data set should be plotted as. * * @return ChartType * @see org.jCharts.types.ChartType *******************************************************************************************/ public final ChartType getChartType() { return ChartType.SCATTER_PLOT; } /**************************************************************************************** * * @param points * @param paint * @param legendLabel ***************************************************************************************/ public void addDataPoints( Point2D.Double[] points, Paint paint, String legendLabel ) { this.data.add( points ); this.paints.add( paint ); this.legendLabels.add( legendLabel ); this.numDataItems= points.length; } /************************************************************************************************ * Performs a limited validation of data. * * @throws ChartDataException *************************************************************************************************/ public void validate() throws ChartDataException { Point2D.Double[] points; for( int i=0; i < this.data.size(); i++ ) { points= (Point2D.Double[]) this.data.get( i ); if( points.length != this.numDataItems ) { throw new ChartDataException( "All Arrays of Point Objects must have the same length." ); } if( this.paints.get( i ) == null ) { throw new ChartDataException( "The 'Paint' implementation can not be NULL." ); } } if( this.scatterPlotProperties == null ) { throw new ChartDataException( "ScatterPlotProperties can not be NULL." ); } } /****************************************************************************************** * Returns the value in the data set at the specified position. * * @param dataset * @param index * @return Point.Double *******************************************************************************************/ public Point2D.Double getValue( int dataset, int index ) { return ( (Point2D.Double[]) this.data.get( dataset ) )[ index ]; } /****************************************************************************************** * Returns the legend label for the passed index. This index corresponds to the DataSet * for which label you want. * * @param index * @return String *******************************************************************************************/ public final String getLegendLabel( int index ) { if( this.legendLabels == null ) { return null; } else { return (String) this.legendLabels.get( index ); } } /********************************************************************************************* * Returns the number of Legend Labels to display. This may not be the same as the number of * Data Items, as in AxisCharts, or Data Sets, as in Pie Charts. * * @return int **********************************************************************************************/ public int getNumberOfLegendLabels() { if( this.legendLabels == null ) { return 0; } else { return this.legendLabels.size(); } } /****************************************************************************************** * Returns the legend label for the passed index. This index corresponds to the DataSet * for which label you want. * * @param index * @return Paint *******************************************************************************************/ public Paint getPaint( int index ) { return (Paint) this.paints.get( index ); } /****************************************************************************************** * * @return ChartTypeProperties *******************************************************************************************/ public ChartTypeProperties getChartTypeProperties() { return this.scatterPlotProperties; } /****************************************************************************************** * Returns the number of elements in the data set. * * @return int *******************************************************************************************/ public int getNumberOfDataSets() { return this.data.size(); } /****************************************************************************************** * Returns the number of elements in the data set. * * @return int *******************************************************************************************/ public int getNumberOfDataItems() { return this.numDataItems; } /***************************************************************************************** * Take advantage of the face Cloning performs better than creating new for highly used * Objects. * * @return Point2D.Double ****************************************************************************************/ public static final Point2D.Double createPoint2DDouble() { return (Point2D.Double) POINT.clone(); } /********************************************************************************************* * Enables the testing routines to display the contents of this Object. * * @param htmlGenerator **********************************************************************************************/ public void toHTML( HTMLGenerator htmlGenerator ) { htmlGenerator.propertiesTableStart( this.getClass().getName() ); htmlGenerator.addTableRow( "data", HTMLGenerator.arrayToString( this.data.toArray( new Point2D.Double[ this.legendLabels.size() ] ) ) ); if( this.legendLabels != null ) { htmlGenerator.addTableRow( "legendLabels", HTMLGenerator.arrayToString( this.legendLabels.toArray( new String[ this.legendLabels.size() ] ) ) ); } htmlGenerator.addTableRow( "paints", HTMLGenerator.arrayToString( this.paints.toArray( new Paint[ this.paints.size() ] ) ) ); htmlGenerator.propertiesTableEnd(); htmlGenerator.chartTableRowStart(); this.scatterPlotProperties.toHTML( htmlGenerator ); htmlGenerator.chartTableRowEnd(); } } jcharts-0.7.5/src/org/jCharts/chartData/StockChartDataSet.java0000644000175000001440000003102607751071402023244 0ustar onkarusers/*********************************************************************************************** * File Info: $Id: StockChartDataSet.java,v 1.3 2003/02/17 02:52:45 nathaniel_auvil Exp $ * Copyright (C) 2002 * Author: Nathaniel G. Auvil * Contributor(s): * * Copyright 2002 (C) Nathaniel G. Auvil. All Rights Reserved. * * Redistribution and use of this software and associated documentation ("Software"), with or * without modification, are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain copyright statements and notices. * Redistributions must also contain a copy of this document. * * 2. Redistributions in binary form must reproduce the above copyright notice, this list of * conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. * * 3. The name "jCharts" or "Nathaniel G. Auvil" must not be used to endorse or promote * products derived from this Software without prior written permission of Nathaniel G. * Auvil. For written permission, please contact nathaniel_auvil@users.sourceforge.net * * 4. Products derived from this Software may not be called "jCharts" nor may "jCharts" appear * in their names without prior written permission of Nathaniel G. Auvil. jCharts is a * registered trademark of Nathaniel G. Auvil. * * 5. Due credit should be given to the jCharts Project (http://jcharts.sourceforge.net/). * * THIS SOFTWARE IS PROVIDED BY Nathaniel G. Auvil AND CONTRIBUTORS ``AS IS'' AND ANY * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL * jCharts OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE ************************************************************************************************/ package org.jCharts.chartData; import org.jCharts.chartData.interfaces.IStockChartDataSet; import org.jCharts.properties.*; import org.jCharts.test.HTMLGenerator; import org.jCharts.test.HTMLTestable; import org.jCharts.types.ChartType; import org.jCharts.types.StockChartDataType; import java.awt.*; public class StockChartDataSet implements IStockChartDataSet, HTMLTestable { private ChartType chartType=ChartType.STOCK; private double[] high; private double[] low; private double[] open; private double[] close; //---keep this value for reference sake. Start with high and low private int numberOfDataSets=2; private String[] legendLabels; private Paint[] paints; private StockChartProperties stockChartProperties; /****************************************************************************************** * Constructor * * @param high * @param highLegendLabel * @param low * @param lowLegendLabel * @param stockChartProperties properties Object specific to the type of chart you are rendering. * @throws ChartDataException performs a limited validation of the data *******************************************************************************************/ public StockChartDataSet( double[] high, String highLegendLabel, double[] low, String lowLegendLabel, Paint highLowPaint, StockChartProperties stockChartProperties ) throws ChartDataException { this.high=high; this.low=low; this.legendLabels=new String[ 5 ]; this.legendLabels[ StockChartDataType.HIGH.getInt() ]=highLegendLabel; this.legendLabels[ StockChartDataType.LOW.getInt() ]=lowLegendLabel; this.paints=new Paint[ 5 ]; this.paints[ StockChartDataType.HIGH.getInt() ]=highLowPaint; this.paints[ StockChartDataType.LOW.getInt() ]=highLowPaint; this.stockChartProperties=stockChartProperties; } /************************************************************************************************ * Performs a limited validation of data passed to Constructor. * * @throws ChartDataException * @throws PropertyException *************************************************************************************************/ public void validate() throws ChartDataException, PropertyException { if( high == null || low == null ) { throw new ChartDataException( "The Hi/Low values can not be NULL." ); } if( high.length != low.length ) { throw new ChartDataException( "The Hi/Low Arrays must have equal length." ); } if( this.paints[ StockChartDataType.HIGH.getInt() ] == null ) { throw new ChartDataException( "The Hi/Low Paint implementation can not be NULL." ); } this.stockChartProperties.validate( this ); } /****************************************************************************************** * Returns the legend label for the passed index. This index corresponds to the DataSet * for which label you want. * * @param index * @return String *******************************************************************************************/ public String getLegendLabel( int index ) { return this.legendLabels[ index ]; } /********************************************************************************************* * Returns the number of Legend Labels to display. * * @return int **********************************************************************************************/ public int getNumberOfLegendLabels() { return this.legendLabels.length; } /****************************************************************************************** * Returns the number of elements in the data set. All data sets must be of the same length * so just look at the first one. * * @return int *******************************************************************************************/ public int getNumberOfDataItems() { //---always have a high and a low return this.high.length; } /*************************************************************************************************** * Sets the 'Close' values * * @param data * @param legendLabel * @param paint **************************************************************************************************/ public void setCloseValues( double[] data, String legendLabel, Paint paint ) { this.numberOfDataSets++; this.close=data; this.legendLabels[ StockChartDataType.CLOSE.getInt() ]=legendLabel; this.paints[ StockChartDataType.CLOSE.getInt() ]=paint; } /*************************************************************************************************** * Sets the 'Open' values * * @param data * @param legendLabel * @param paint **************************************************************************************************/ public void setOpenValues( double[] data, String legendLabel, Paint paint ) { this.numberOfDataSets++; this.open=data; this.legendLabels[ StockChartDataType.OPEN.getInt() ]=legendLabel; this.paints[ StockChartDataType.OPEN.getInt() ]=paint; } /********************************************************************************************* * Sets the 'Volume' values * * @param data[] * @param legendLabel * @param paint ********************************************************************************************* public void setVolumeValues( double[] data, String legendLabel, Paint paint ) { this.numberOfDataSets++; this.volume= data; this.legendLabels[ StockChartDataType.VOLUME.getInt() ]= legendLabel; this.paints[ StockChartDataType.VOLUME.getInt() ]= paint; } */ /****************************************************************************************** * * @param index * @return double *******************************************************************************************/ public double getHighValue( int index ) { return this.high[ index ]; } /****************************************************************************************** * * @param index * @return double *******************************************************************************************/ public double getLowValue( int index ) { return this.low[ index ]; } /****************************************************************************************** * * @param index * @return double *******************************************************************************************/ public double getCloseValue( int index ) { return this.close[ index ]; } /****************************************************************************************** * * @return boolean *******************************************************************************************/ public boolean hasCloseValues() { return ( this.close != null ); } /****************************************************************************************** * * @param index * @return double *******************************************************************************************/ public double getOpenValue( int index ) { return this.open[ index ]; } /****************************************************************************************** * * @return boolean *******************************************************************************************/ public boolean hasOpenValues() { return ( this.open != null ); } /****************************************************************************************** * * @param index * @return double ******************************************************************************************* public double getVolumeValue( int index ) { return this.volume[ index ]; } */ /****************************************************************************************** * * @return boolean ******************************************************************************************* public boolean hasVolumeValues() { return ( this.volume != null ); } */ /****************************************************************************************** * Returns the type constant that this data set should be plotted as. * * @return ChartType * @see ChartType *******************************************************************************************/ public ChartType getChartType() { return this.chartType; } /****************************************************************************************** * Returns the chart specific properties * * @return ChartTypeProperties *******************************************************************************************/ public ChartTypeProperties getChartTypeProperties() { return this.stockChartProperties; } /****************************************************************************************** * Returns the number of IAxisChartDataSet Objects in this series * * @return int ******************************************************************************************/ public int getNumberOfDataSets() { return this.numberOfDataSets; } /****************************************************************************************** * Returns the number of IAxisChartDataSet Objects in this series * * @return int ******************************************************************************************/ public Paint getPaint( int index ) { return this.paints[ index ]; } /********************************************************************************************* * Enables the testing routines to display the contents of this Object. * * @param htmlGenerator **********************************************************************************************/ public void toHTML( HTMLGenerator htmlGenerator ) { //super.toHTML( htmlGenerator ); /* //String name= this.getClass().getSuperclass().getName() + "->"; Field[] fields= this.getClass().getDeclaredFields(); for( int i=0; i< fields.length; i++ ) { htmlGenerator.addTableRow( fields[ i ].getName(), fields[ i ].get( this ) ); } */ } } jcharts-0.7.5/src/org/jCharts/chartText/0000755000175000001440000000000007751071402017137 5ustar onkarusersjcharts-0.7.5/src/org/jCharts/chartText/BarValueGroup.java0000644000175000001440000004271407751071402022530 0ustar onkarusers/*********************************************************************************************** * File Info: $Id: BarValueGroup.java,v 1.1 2002/12/05 22:07:28 nathaniel_auvil Exp $ * Copyright (C) 2000 * Author: John Thomsen * Contributor(s): * * Copyright 2002 (C) Nathaniel G. Auvil. All Rights Reserved. * * Redistribution and use of this software and associated documentation * ("Software"), with or without modification, are permitted provided * that the following conditions are met: * * 1. Redistributions of source code must retain copyright * statements and notices. Redistributions must also contain a * copy of this document. * * 2. Redistributions in binary form must reproduce the * above copyright notice, this list of conditions and the * following disclaimer in the documentation and/or other * materials provided with the distribution. * * 3. The name "jCharts" or "Nathaniel G. Auvil" must not be used to * endorse or promote products derived from this Software without * prior written permission of Nathaniel G. Auvil. For written * permission, please contact nathaniel_auvil@users.sourceforge.net * * 4. Products derived from this Software may not be called "jCharts" * nor may "jCharts" appear in their names without prior written * permission of Nathaniel G. Auvil. jCharts is a registered * trademark of Nathaniel G. Auvil. * * 5. Due credit should be given to the jCharts Project * (http://jcharts.sourceforge.net/). * * THIS SOFTWARE IS PROVIDED BY Nathaniel G. Auvil AND CONTRIBUTORS * ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT * NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL * jCharts OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED * OF THE POSSIBILITY OF SUCH DAMAGE. ************************************************************************************************/ package org.jCharts.chartText; import org.jCharts.chartData.interfaces.IAxisChartDataSet; import org.jCharts.properties.AxisProperties; import org.jCharts.properties.BarChartProperties; import org.jCharts.chartText.TextTag; import org.jCharts.axisChart.AxisChart; import java.awt.*; import java.awt.font.FontRenderContext; import java.awt.geom.Rectangle2D; import java.text.NumberFormat; import java.util.ArrayList; /** */ public class BarValueGroup { /** Helper class to handle a barValue - wraps TextTag * Meant to be called only by BarValueGroup class. */ protected class BarValue extends TextTag { private Rectangle2D.Float barRect; //private Rectangle2D.Float bounds; private int startPosition = 0; private boolean isNegative = false; private String text; public BarValue( String text, Font font, FontRenderContext fontRenderContext, Rectangle2D.Float barRect, int startPosition, boolean isNegative ) { super( text, font, fontRenderContext ); this.text = text; this.barRect = barRect; this.startPosition = startPosition; this.isNegative = isNegative; } public Rectangle2D.Float getBarRect() { return this.barRect; } public int getStartPosition() { return this.startPosition; } public boolean getIsNegative() { return this.isNegative; } public String getText() { return this.text; } } // -- End of inner class BarValue private AxisChart axisChart; //private IAxisChartDataSet iAxisChartDataSet; // Values to create or get once... private FontRenderContext fontRenderContext; private boolean isVertical; private BarChartProperties barChartProperties; private AxisProperties axisProperties; private NumberFormat numberFormat; private boolean showBarValues; private int barValuePosition; private int barValueItem; private Font barValueFont; private Paint barValueFontColor; private float horizontalPadding; private float verticalPadding; private double totalDataValue = 0.0d; private float centerChart = 0.0f; private ArrayList textTagList; public BarValueGroup( AxisChart axisChart, IAxisChartDataSet iAxisChartDataSet ) { /* this.barChartProperties = ( BarChartProperties ) iAxisChartDataSet.getChartTypeProperties(); this.showBarValues = barChartProperties.getShowBarValues(); //---NOTE: Aborting HERE if not needed. if( this.showBarValues == false ) return; // <--- Possible return. this.axisChart = axisChart; //this.iAxisChartDataSet = iAxisChartDataSet; this.axisProperties = axisChart.getAxisProperties(); this.isVertical = ( axisProperties.getOrientation() == AxisProperties.VERTICAL ); this.barValuePosition = barChartProperties.getShowBarValuesPosition(); this.barValueItem = barChartProperties.getShowBarValuesItemToDisplay(); this.barValueFont = barChartProperties.getShowBarValuesFont(); this.barValueFontColor = barChartProperties.getShowBarValuesFontColor(); for( int i = 0; i < iAxisChartDataSet.getNumberOfDataItems(); i++ ) { double dataValue = iAxisChartDataSet.getValue( 0, i ); totalDataValue += ( dataValue > 0 ) ? dataValue : -dataValue; } int precision = barChartProperties.getShowBarValuesPrecision(); if( barChartProperties.getShowBarValuesAsMoney() ) { numberFormat = NumberFormat.getCurrencyInstance(); } if( precision > 0 || numberFormat != null ) { if( numberFormat == null ) { numberFormat = NumberFormat.getInstance(); } numberFormat.setMaximumFractionDigits( precision ); numberFormat.setMinimumFractionDigits( precision ); } if( isVertical ) { this.verticalPadding = barChartProperties.getShowBarValuesVerticalPadding(); } else { this.horizontalPadding = barChartProperties.getShowBarValuesHorizontalPadding(); } this.fontRenderContext = axisChart.getGraphics2D().getFontRenderContext(); this.centerChart = ( isVertical ) ? axisChart.getVerticalAxisPixelLength() : axisChart.getHorizontalAxisPixelLength(); this.centerChart /= 2.0f; textTagList = null; */ } /******************************************************************************************************* * Gets the text associated (by the user) for the given bar value. * Meant only to be called by BarChart.render() ********************************************************************************************************/ private String getBarValueAt( int i, double dataValue ) { /* String str = ""; if( barValueItem == BarChartProperties.SHOW_CUSTOM_STRINGS ) { return barChartProperties.getBarValuesString( i ); } if( barValueItem == BarChartProperties.SHOW_LABEL || barValueItem == BarChartProperties.SHOW_LABEL_AND_PERCENTAGE || barValueItem == BarChartProperties.SHOW_LABEL_AND_VALUE ) { str = axisChart.getIDataSeries().getLabelAxisLabel( i ); } if( barValueItem != BarChartProperties.SHOW_LABEL ) { String pct = ""; if( barValueItem == BarChartProperties.SHOW_LABEL_AND_PERCENTAGE || barValueItem == BarChartProperties.SHOW_LABEL_AND_VALUE ) { str += ": "; } if( barValueItem == BarChartProperties.SHOW_PERCENTAGE || barValueItem == BarChartProperties.SHOW_LABEL_AND_PERCENTAGE ) { dataValue = ( dataValue / totalDataValue ) * 100; pct = "%"; } if( numberFormat == null ) { str += ( int ) dataValue + pct; } else { str += numberFormat.format( dataValue ) + pct; } } return str; */ return null; } /******************************************************************************************************* * Gets the rectangle coords associated (by the user) for the given bar value. * Meant only to be called by BarChart.render() ********************************************************************************************************/ private Rectangle2D.Float getBarValueRectangleCoordinates( int position, BarValue barValue ) { //---Called by getBarValueRectangle //---Will this spacingwork for Vertical Text? Probably not. /* float stringWidth = barValue.getWidth(); float stringHeight = barValue.getHeight(); Rectangle2D.Float barRect = barValue.getBarRect(); Rectangle2D.Float displayPosition = new Rectangle2D.Float( barRect.x, barRect.y, stringWidth + ( 2 * horizontalPadding ), stringHeight + ( 2 * verticalPadding ) ); float offset = 0.0f; if( position == BarChartProperties.BEYOND_BAR ) { //System.out.println("BEYOND"); offset = ( isVertical ) ? barRect.height : barRect.width; offset += ( isVertical ) ? verticalPadding : horizontalPadding; } else if( position == BarChartProperties.BEFORE_BAR ) { //System.out.println("BEFORE"); offset -= ( isVertical ) ? stringHeight : stringWidth; offset -= ( isVertical ) ? verticalPadding : horizontalPadding; } else if( position == BarChartProperties.END_OF_BAR ) { //System.out.println("END"); offset = ( isVertical ) ? barRect.height : barRect.width; offset -= ( isVertical ) ? verticalPadding : horizontalPadding; offset -= ( isVertical ) ? stringHeight : stringWidth; } else if( position == BarChartProperties.CENTER_OF_BAR ) { //System.out.println("CENTER"); offset = ( isVertical ) ? barRect.height / 2.0f : barRect.width / 2.0f; offset += ( isVertical ) ? verticalPadding : horizontalPadding; offset -= ( isVertical ) ? stringHeight / 2.0f : stringWidth / 2.0f; } else if( position == BarChartProperties.BASE_OF_BAR ) { //System.out.println("BASE"); offset += ( isVertical ) ? verticalPadding : horizontalPadding; } else if( position == BarChartProperties.CENTER_OF_CHART ) { //System.out.println("CENTER_CHART"); offset = centerChart; offset -= ( isVertical ) ? stringHeight / 2.0f : stringWidth / 2.0f; } else { return null; } if( isVertical ) { displayPosition.y += barRect.height - offset; displayPosition.x += ( barRect.width - stringWidth ) / 2.0f; } else { displayPosition.x += offset; displayPosition.y += ( barRect.height ) / 2.0f; // Why does this need to be 3? 2 should work right. displayPosition.y += ( stringHeight ) / 2.0f; } return displayPosition; */ return null; } /** Not sure why this was left out of Rectangle2D... */ private float getRight( Rectangle2D.Float r ) { return r.x + r.width; } /** Not sure why this was left out of Rectangle2D... */ private float getBottom( Rectangle2D.Float r ) { return r.y + r.height; } /******************************************************************************************************* * Gets the rectangle associated (by the user) for the given bar value. * Meant only to be called by BarChart.render() ********************************************************************************************************/ private void setBarValuePosition( BarValue barValue, Rectangle2D.Float bounds ) { /* if( barValue == null ) return; //boolean moved = false; //---Extra space needed above (or below) baseline float ySpace = ( barValue.getHeight() / 2 ) + verticalPadding; //---Holder to contain the coordinates for text display. Rectangle2D.Float displayPosition; //---The rectangle for the Bar on (in, around) which we display Rectangle2D.Float barRect = barValue.getBarRect(); //---Position relative to the Bar int position = barValue.getStartPosition(); //---Remap if in the negative area if( barValue.getIsNegative() ) { if( barValuePosition == BarChartProperties.END_OF_BAR ) { position = BarChartProperties.BASE_OF_BAR; } else if( barValuePosition == BarChartProperties.BEYOND_BAR ) { position = BarChartProperties.BEFORE_BAR; } else if( barValuePosition == BarChartProperties.BASE_OF_BAR ) { position = BarChartProperties.END_OF_BAR; } } //---The string to be displayed //String str = barValue.getText(); //---Debug //System.out.println("Position:"+str+" at ("+position+")"); //---Get default coordinates. displayPosition = getBarValueRectangleCoordinates( position, barValue ); //---Special case, if before, then we move to base if too far left or down //---Should only happen on charts with negative values. if( position == BarChartProperties.BEFORE_BAR ) { if( ( isVertical == false && displayPosition.x < bounds.x ) || ( isVertical && getBottom( displayPosition ) > getBottom( bounds ) ) ) { position = BarChartProperties.BASE_OF_BAR; //moved = true; displayPosition = getBarValueRectangleCoordinates( position, barValue ); //System.out.println("0:Moved "+str+" to BASE_OF_BAR"); } } //---Do we have to shift it over a bit? //---Does it run outside the bars rectangle? if( position == BarChartProperties.BASE_OF_BAR || position == BarChartProperties.CENTER_OF_BAR ) { // Ignore ones that are too wide in vertical chart, or tall in horizontal chart if( ( isVertical && ( displayPosition.y - ( ySpace ) ) < barRect.y ) || ( isVertical == false && getRight( displayPosition ) > getRight( barRect ) ) ) { // Move needed position = BarChartProperties.END_OF_BAR; //moved = true; displayPosition = getBarValueRectangleCoordinates( position, barValue ); //System.out.println("1:Moved "+str+" to END_OF_BAR"); } } //---Does it run over left/bottom edge of chart (bounded area)? if( position == BarChartProperties.END_OF_BAR || position == BarChartProperties.CENTER_OF_BAR ) { if( ( isVertical == false && displayPosition.x < bounds.x ) || ( isVertical && ( getBottom( displayPosition ) + ySpace ) > getBottom( bounds ) ) ) { position = BarChartProperties.BEYOND_BAR; //moved = true; displayPosition = getBarValueRectangleCoordinates( position, barValue ); //System.out.println("2:Moved "+str+" to BEYOND_BAR"); } } //---Does it run over right/top edge of chart (bounds)? if( position == BarChartProperties.BEYOND_BAR ) { boolean mustMove = false; if( isVertical == false ) { if( getRight( displayPosition ) > getRight( bounds ) ) { //System.out.println("Fail " + (displayPosition.x + displayPosition.width) + " > " + (bounds.x + bounds.width)); mustMove = true; } } else { if( ( displayPosition.y + ySpace ) <= bounds.y ) { mustMove = true; } } if( mustMove ) { position = BarChartProperties.END_OF_BAR; //moved = true; displayPosition = getBarValueRectangleCoordinates( position, barValue ); //System.out.println("3:Moved "+str+" to END_OF_BAR"); } } barValue.setPosition( displayPosition.x, displayPosition.y ); */ } /** Adds a bar value for the given data item, if barValues are on */ public void addBarValue( int i, double dataValue, Rectangle2D.Float barRect ) { /* if( this.showBarValues == false ) { return; } BarValue barValue = null; String str = getBarValueAt( i, dataValue ); if( str != null ) { float originX = axisChart.getXAxisOrigin(); float originY = axisChart.getYAxisOrigin(); float startingCoordinate = axisChart.getDataAxis().getZeroLineCoordinate(); Rectangle2D.Float bounds = new Rectangle2D.Float(); bounds.x = originX; bounds.y = originY; bounds.width = axisChart.getHorizontalAxis().getPixelLength(); bounds.height = axisChart.getVerticalAxis().getPixelLength(); if( dataValue < 0 ) { if( isVertical ) { //-- Bound on entire chart. bounds.y = originY - bounds.height; } else { //-- Bound on entire chart - already okay. } } else { if( isVertical ) { //-- Bound from starting to top of chart. bounds.y -= bounds.height; bounds.height -= ( originY - startingCoordinate ); } else { //-- Bound from starting to right side of chart bounds.x = startingCoordinate; bounds.width -= ( startingCoordinate - originX ); } } barValue = new BarValue( str, barValueFont, fontRenderContext, barRect, barValuePosition, ( dataValue < 0 ) ); setBarValuePosition( barValue, bounds ); if( textTagList == null ) { textTagList = new ArrayList(); } textTagList.add( barValue ); } */ } /** renders any barValues */ public void render( Graphics2D g2d ) { if( textTagList == null || this.showBarValues == false ) { return; } TextTag tag; Paint p = this.barValueFontColor; g2d.setFont( this.barValueFont ); for( int i = 0; i < textTagList.size(); i++ ) { tag = ( TextTag ) textTagList.get( i ); tag.render( g2d, p ); // Text tag sets the Paint every time if not null // So, we might save a small bit of time by changing // this to null after first time. p = null; } } } jcharts-0.7.5/src/org/jCharts/chartText/NumericTagGroup.java0000644000175000001440000001335707751071402023066 0ustar onkarusers/*********************************************************************************************** * File Info: $Id: NumericTagGroup.java,v 1.5 2003/04/19 01:56:15 nathaniel_auvil Exp $ * Copyright (C) 2002 * Author: Nathaniel G. Auvil * Contributor(s): John Thomsen * * Copyright 2002 (C) Nathaniel G. Auvil. All Rights Reserved. * * Redistribution and use of this software and associated documentation ("Software"), with or * without modification, are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain copyright statements and notices. * Redistributions must also contain a copy of this document. * * 2. Redistributions in binary form must reproduce the above copyright notice, this list of * conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. * * 3. The name "jCharts" or "Nathaniel G. Auvil" must not be used to endorse or promote * products derived from this Software without prior written permission of Nathaniel G. * Auvil. For written permission, please contact nathaniel_auvil@users.sourceforge.net * * 4. Products derived from this Software may not be called "jCharts" nor may "jCharts" appear * in their names without prior written permission of Nathaniel G. Auvil. jCharts is a * registered trademark of Nathaniel G. Auvil. * * 5. Due credit should be given to the jCharts Project (http://jcharts.sourceforge.net/). * * THIS SOFTWARE IS PROVIDED BY Nathaniel G. Auvil AND CONTRIBUTORS ``AS IS'' AND ANY * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL * jCharts OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE ************************************************************************************************/ package org.jCharts.chartText; import org.jCharts.axisChart.axis.scale.ScaleCalculator; import org.jCharts.properties.util.ChartFont; import java.awt.font.FontRenderContext; import java.text.NumberFormat; public class NumericTagGroup extends TextTagGroup { private NumberFormat numberFormat; /****************************************************************************************** * * @param chartFont * @param fontRenderContext * @param isCurrency * @param isPercent * @param showCommas * @param roundingPowerOfTen the exponent of ten to round to: 1=10, -1=.1, 3=1000, etc... *******************************************************************************************/ public NumericTagGroup( ChartFont chartFont, FontRenderContext fontRenderContext, boolean isCurrency, boolean isPercent, boolean showCommas, int roundingPowerOfTen ) { super( chartFont, fontRenderContext ); this.numberFormat = getNumberFormatInstance( isCurrency, isPercent, showCommas, roundingPowerOfTen ); } /********************************************************************************************* * Allow use of this logic to not only this class but to the chart label values. * * @param isCurrency * @param isPercent * @param showCommas * @param roundingPowerOfTen * @return NumberFormat ********************************************************************************************/ public static final NumberFormat getNumberFormatInstance( boolean isCurrency, boolean isPercent, boolean showCommas, int roundingPowerOfTen ) { NumberFormat numberFormat; //---CURRENCY if( isCurrency ) { numberFormat = NumberFormat.getCurrencyInstance(); } else if( isPercent ) { numberFormat = NumberFormat.getPercentInstance(); } else { numberFormat = NumberFormat.getInstance(); } //---COMMAS if( showCommas ) { numberFormat.setGroupingUsed( true ); } else { numberFormat.setGroupingUsed( false ); } //---TRIM OFF DECIMAL PLACES IF ROUND TO WHOLE NUMBER if( roundingPowerOfTen >= 0 ) { numberFormat.setMaximumFractionDigits( 0 ); numberFormat.setMinimumFractionDigits( 0 ); } else { numberFormat.setMaximumFractionDigits( -roundingPowerOfTen ); numberFormat.setMinimumFractionDigits( -roundingPowerOfTen ); } return numberFormat; } /****************************************************************************************** * * @param value *****************************************************************************************/ public void addLabel( double value ) { super.addLabel( this.numberFormat.format( value ) ); } /******************************************************************************************* * Creates the axis labels for the passed ScaleCalculator instance. * * @param scaleCalculator *******************************************************************************************/ public void createAxisScaleLabels( ScaleCalculator scaleCalculator ) { double value = scaleCalculator.getMinValue(); this.addLabel( value ); for( int i = 1; i < scaleCalculator.getNumberOfScaleItems(); i++ ) { value += scaleCalculator.getIncrement(); this.addLabel( value ); } } } jcharts-0.7.5/src/org/jCharts/chartText/TextTag.java0000644000175000001440000003250507751071402021367 0ustar onkarusers /*********************************************************************************************** * File Info: $Id: TextTag.java,v 1.5 2003/03/09 22:42:11 nathaniel_auvil Exp $ * Copyright (C) 2002 * Author: John Thomsen * Contributor(s): Nathaniel G. Auvil * * Copyright 2002 (C) Nathaniel G. Auvil. All Rights Reserved. * * Redistribution and use of this software and associated documentation ("Software"), with or * without modification, are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain copyright statements and notices. * Redistributions must also contain a copy of this document. * * 2. Redistributions in binary form must reproduce the above copyright notice, this list of * conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. * * 3. The name "jCharts" or "Nathaniel G. Auvil" must not be used to endorse or promote * products derived from this Software without prior written permission of Nathaniel G. * Auvil. For written permission, please contact nathaniel_auvil@users.sourceforge.net * * 4. Products derived from this Software may not be called "jCharts" nor may "jCharts" appear * in their names without prior written permission of Nathaniel G. Auvil. jCharts is a * registered trademark of Nathaniel G. Auvil. * * 5. Due credit should be given to the jCharts Project (http://jcharts.sourceforge.net/). * * THIS SOFTWARE IS PROVIDED BY Nathaniel G. Auvil AND CONTRIBUTORS ``AS IS'' AND ANY * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL * jCharts OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE ************************************************************************************************/ package org.jCharts.chartText; import org.jCharts.test.HTMLGenerator; import org.jCharts.test.HTMLTestable; import org.jCharts.chartData.ChartDataException; import java.awt.*; import java.awt.font.FontRenderContext; import java.awt.font.TextLayout; import java.awt.geom.Rectangle2D; import java.io.Serializable; import java.lang.reflect.Field; import java.util.Hashtable; public class TextTag implements HTMLTestable, Serializable { //---Strangely, we don't need to store the text itself. (yet) private float xPosition = 0; private float yPosition = 0; private TextLayout textLayout = null; private Hashtable attributes = null; private boolean isHidden = false; //---derived values private float width = 0; private float height = 0; private float fontAscent = 0; private float fontDescent = 0; private boolean isDerived = false; private Font derivedFont= null; private String text; //for toString(); private Font font; //for toString(); /********************************************************************************************* * Default constructor - for untransformed fonts. * **********************************************************************************************/ public TextTag( String text, Font baseFont, FontRenderContext fontRenderContext ) { this( text, baseFont, null, fontRenderContext ); } /********************************************************************************************* * Constructor when using transformed (derived) fonts * * The need for this arises because the java metrics classes return either 0 or very strange * values for the width and height of a string (TextLayout, LineMetrics, etc..) when * the font is derived * * @param text * @param baseFont is the original (untransformed) font. * @param derivedFont is the transformed font * @param fontRenderContext **********************************************************************************************/ public TextTag( String text, Font baseFont, Font derivedFont, FontRenderContext fontRenderContext ) { this.textLayout = new TextLayout( text, baseFont, fontRenderContext ); this.isDerived = (derivedFont != null); this.derivedFont= derivedFont; //---Dimensions this.width = this.textLayout.getAdvance(); this.height = this.textLayout.getAscent() + this.textLayout.getDescent(); //---need this to offset font rendering, as rendering is at the baseline not bottom or top, this.fontAscent = this.textLayout.getAscent(); this.fontDescent = this.textLayout.getDescent(); this.font = (this.isDerived) ? derivedFont : baseFont; this.text = text; // System.out.println(">"+text+" Bounds:"+textLayout.getBounds() ); // System.out.println(" >Ascent "+textLayout.getAscent()+" Descent:"+textLayout.getDescent() ); // System.out.println(" >isVertical "+textLayout.isVertical()); // // LineMetrics lm = font.getLineMetrics(text, fontRenderContext); // System.out.println(" Metrics:" + lm.getHeight() + " " + lm.getAscent() + lm.getDescent()); } /******************************************************************************************** * ********************************************************************************************/ public float getWidth() { return this.width; } /******************************************************************************************** * ********************************************************************************************/ public float getHeight() { return this.height; } /******************************************************************************************** * ********************************************************************************************/ public float getFontAscent() { return this.fontAscent; } /******************************************************************************************** * ********************************************************************************************/ public float getFontDescent() { return this.fontDescent; } /******************************************************************************************** * ********************************************************************************************/ public void setPosition( float x, float y ) { this.xPosition = x; this.yPosition = y; //System.out.println("TEXT:==>"+text+"< at "+x+","+y); } /******************************************************************************************** * ********************************************************************************************/ public void setXPosition( float x ) { this.xPosition = x; } /******************************************************************************************** * ********************************************************************************************/ public void setYPosition( float y ) { this.yPosition = y; } /******************************************************************************************** * ********************************************************************************************/ public float getXPosition() { return this.xPosition; } /******************************************************************************************** * ********************************************************************************************/ public float getYPosition() { return this.yPosition; } /******************************************************************************************** * ********************************************************************************************/ public float getRightSide() { return this.xPosition + this.width; } /******************************************************************************************** * ********************************************************************************************/ public float getBottomSide() { return this.yPosition + this.height; } /******************************************************************************************** * ********************************************************************************************/ public Rectangle2D.Float getRectangle() { return new Rectangle2D.Float( this.xPosition, this.yPosition, this.width, this.height ); } /******************************************************************************************** * ********************************************************************************************/ public void setHidden( boolean b ) { this.isHidden = b; } /******************************************************************************************** * ********************************************************************************************/ public boolean getHidden() { return this.isHidden; } public String getText() { return text; } /******************************************************************************************** * ********************************************************************************************/ public void addAttribute( String name, Object o ) { if( attributes == null ) { attributes = new Hashtable(); } attributes.put( name, o ); } /******************************************************************************************** * ********************************************************************************************/ public Object getAttribute( String name ) { if( attributes == null ) { return null; } return attributes.get( name ); } /********************************************************************************************** * Renders the text, at the position - renders from the top (instead of baseline) * * @param g2d * @param fontColor **********************************************************************************************/ public void render( Graphics2D g2d, Paint fontColor ) { if( fontColor != null ) { g2d.setPaint( fontColor ); } if( this.isHidden == false ) { if( isDerived ) { g2d.setFont( this.derivedFont ); g2d.drawString( this.text, this.xPosition, this.yPosition ); } else { textLayout.draw( g2d, this.xPosition, this.yPosition ); } //---Debug comparison code. //g2d.setFont( this.font ); //g2d.drawString(this.text, this.xPosition, this.yPosition); /* Interesting... System.out.println("Ascent:"+this.fontAscent); System.out.println("Descent:"+this.fontDescent); System.out.println("Height:"+this.heightNeeded); System.out.println("Width:"+this.widthNeeded); */ } } /********************************************************************************************** * Renders the text, at the position - renders from the top (instead of baseline) * * @param g2d **********************************************************************************************/ public void render( Graphics2D g2d, float x, float y ) { textLayout.draw( g2d, x, y ); /* if( fontColor != null ) { g2d.setPaint( fontColor ); } if( this.isHidden == false ) { if( isDerived ) { g2d.drawString( this.text, x, y ); } else { textLayout.draw( g2d, x, y ); } } */ } /********************************************************************************************* * Enables the testing routines to display the contents of this Object. * * @param htmlGenerator **********************************************************************************************/ public void toHTML( HTMLGenerator htmlGenerator ) { htmlGenerator.propertiesTableStart( this.getClass().getName() ); Field[] fields = this.getClass().getDeclaredFields(); for( int i = 0; i < fields.length; i++ ) { try { htmlGenerator.addField( fields[ i ].getName(), fields[ i ].get( this ) ); } catch( IllegalAccessException illegalAccessException ) { illegalAccessException.printStackTrace(); } } htmlGenerator.propertiesTableEnd(); } /******************************************************************************************** * * @return ********************************************************************************************/ public String toString() { String str = "TextTag: '" + this.text + "',x=" + this.xPosition + ",y=" + this.yPosition; str += "width=" + this.width + ",height=" + this.height; str += ",font=" + this.font.getName() + "," + this.font.getSize(); if( attributes != null && attributes.size() > 0 ) { java.util.Enumeration enum = attributes.keys(); str += "\nAttributes:"; while( enum.hasMoreElements() ) { Object ob = enum.nextElement(); str += " [" + ob.toString() + "]=[" + attributes.get( ob ).toString() + "]\n"; } } return str; } }jcharts-0.7.5/src/org/jCharts/chartText/TextTagGroup.java0000644000175000001440000002310407751071402022377 0ustar onkarusers/*********************************************************************************************** * File Info: $Id: TextTagGroup.java,v 1.6 2003/02/07 02:12:52 nathaniel_auvil Exp $ * Copyright (C) 2002 * Author: Nathaniel G. Auvil * Contributor(s): * * Copyright 2002 (C) Nathaniel G. Auvil. All Rights Reserved. * * Redistribution and use of this software and associated documentation ("Software"), with or * without modification, are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain copyright statements and notices. * Redistributions must also contain a copy of this document. * * 2. Redistributions in binary form must reproduce the above copyright notice, this list of * conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. * * 3. The name "jCharts" or "Nathaniel G. Auvil" must not be used to endorse or promote * products derived from this Software without prior written permission of Nathaniel G. * Auvil. For written permission, please contact nathaniel_auvil@users.sourceforge.net * * 4. Products derived from this Software may not be called "jCharts" nor may "jCharts" appear * in their names without prior written permission of Nathaniel G. Auvil. jCharts is a * registered trademark of Nathaniel G. Auvil. * * 5. Due credit should be given to the jCharts Project (http://jcharts.sourceforge.net/). * * THIS SOFTWARE IS PROVIDED BY Nathaniel G. Auvil AND CONTRIBUTORS ``AS IS'' AND ANY * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL * jCharts OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE ************************************************************************************************/ package org.jCharts.chartText; import org.jCharts.test.HTMLGenerator; import org.jCharts.test.HTMLTestable; import org.jCharts.properties.util.ChartFont; import java.awt.*; import java.awt.font.FontRenderContext; import java.io.Serializable; import java.lang.reflect.Field; import java.util.ArrayList; import java.util.Collection; public class TextTagGroup implements HTMLTestable, Serializable { private float widestLabel = 0.0f; private float tallestLabel = 0.0f; private float totalLabelWidths = 0.0f; private ArrayList textTags; private ChartFont chartFont; private FontRenderContext fontRenderContext; //---Strangely, we don't need to store the text itself. (yet) // private ArrayList group; // private Font baseFont; // private Font derivedFont; // private Paint fontColor; // private float tallestTextTag = 0.0f; // private float widestTextTag = 0.0f; // private boolean computedTallestAndWidest = false; /****************************************************************************************** * Constructor * * @param chartFont * @param fontRenderContext *******************************************************************************************/ public TextTagGroup( ChartFont chartFont, FontRenderContext fontRenderContext ) { this.textTags = new ArrayList( 30 ); this.chartFont= chartFont; this.fontRenderContext= fontRenderContext; } /****************************************************************************************** * * @param label *******************************************************************************************/ public void addLabel( String label ) { TextTag textTag= new TextTag( label, this.chartFont.getFont(), this.fontRenderContext ); this.textTags.add( textTag ); this.widestLabel = Math.max( textTag.getWidth(), this.widestLabel ); this.totalLabelWidths += textTag.getWidth(); this.tallestLabel = Math.max( textTag.getHeight(), this.tallestLabel ); } /****************************************************************************************** * Returns the number of labels * * @return int ******************************************************************************************/ public int size() { return this.textTags.size(); } /******************************************************************************************* * Horizontal plots render the data from top down so rendering alogorithm needs to get the * labels in reverse order to make things easier. * *******************************************************************************************/ public void reverse() { ArrayList reverse= new ArrayList( this.textTags.size() ); for( int i= this.textTags.size() - 1; i >= 0 ; i-- ) { reverse.add( this.textTags.get( i ) ); } this.textTags= reverse; } /****************************************************************************************** * Calculates the width and height needed by the passed String when rendered * // * @param iDataSeries / * @param font // * @param fontRenderContext ******************************************************************************************* public void processLabels( IDataSeries iDataSeries) { //LOOP for( int i = 0; i < iDataSeries.getNumberOfXAxisLabels(); i++ ) { this.axisLabelProcessor.processLabel( iDataSeries.getXAxisLabel( i ), axisLabelFont, fontRenderContext ); } TextLayout textLayout = new TextLayout( label, font, fontRenderContext ); //---WIDTH this.labelWidths[ counter ] = textLayout.getAdvance(); this.widestLabel = Math.max( this.labelWidths[ counter ], this.widestLabel ); this.totalLabelWidths += this.labelWidths[ counter ]; //---HEIGHT this.labelHeights[ counter ] = textLayout.getAscent() + textLayout.getDescent(); this.tallestLabel = Math.max( this.labelHeights[ counter ], this.tallestLabel ); //---need this to offset font rendering, as rendering is at the baseline not bottom or top, this.fontDescent = textLayout.getDescent(); this.counter++; } /****************************************************************************************** * * ******************************************************************************************/ public float getWidestLabel() { return this.widestLabel; } /****************************************************************************************** * * ******************************************************************************************/ public float getTallestLabel() { return this.tallestLabel; } /****************************************************************************************** * * ******************************************************************************************/ public float getTotalLabelWidths() { return this.totalLabelWidths; } /****************************************************************************************** * * @param index * @return TextTag ******************************************************************************************/ public TextTag getTextTag( int index ) { return (TextTag) this.textTags.get( index ); } /********************************************************************************************** * Renders the text, at the position - renders from the top (instead of baseline) * * @param index * @param g2d * @param x * @param y **********************************************************************************************/ public void render( int index, Graphics2D g2d, float x, float y ) { this.chartFont.setupGraphics2D( g2d ); this.getTextTag( index ).render( g2d, x, y ); } /********************************************************************************************** * Renders all the text in this group. * * ********************************************************************************************** public void renderTag( int index, Graphics2D g2d ) { TextTag tag; //Paint p = this.fontColor; g2d.setPaint( this. ); //g2d.setFont( (this.derivedFont == null) ? baseFont : derivedFont ); for( int i = 0; i < group.size(); i++ ) { tag = ( TextTag ) group.get( i ); tag.render( g2d, p ); // Text tag sets the Paint every time if not null // So, we might save a small bit of time by changing // this to null after first time. p = null; } } /********************************************************************************************* * Enables the testing routines to display the contents of this Object. * * @param htmlGenerator **********************************************************************************************/ public void toHTML( HTMLGenerator htmlGenerator ) { htmlGenerator.propertiesTableStart( this.getClass().getName() ); Field[] fields = this.getClass().getDeclaredFields(); for( int i = 0; i < fields.length; i++ ) { try { htmlGenerator.addField( fields[ i ].getName(), fields[ i ].get( this ) ); } catch( IllegalAccessException illegalAccessException ) { illegalAccessException.printStackTrace(); } } htmlGenerator.propertiesTableEnd(); } }jcharts-0.7.5/src/org/jCharts/encoders/0000755000175000001440000000000007751071402016773 5ustar onkarusersjcharts-0.7.5/src/org/jCharts/encoders/BinaryEncoderUtil.java0000644000175000001440000001017607751071402023225 0ustar onkarusers/*********************************************************************************************** * File Info: $Id: BinaryEncoderUtil.java,v 1.5 2003/03/14 03:22:43 nathaniel_auvil Exp $ * Copyright (C) 2002 * Author: Nathaniel G. Auvil * Contributor(s): * * Copyright 2002 (C) Nathaniel G. Auvil. All Rights Reserved. * * Redistribution and use of this software and associated documentation ("Software"), with or * without modification, are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain copyright statements and notices. * Redistributions must also contain a copy of this document. * * 2. Redistributions in binary form must reproduce the above copyright notice, this list of * conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. * * 3. The name "jCharts" or "Nathaniel G. Auvil" must not be used to endorse or promote * products derived from this Software without prior written permission of Nathaniel G. * Auvil. For written permission, please contact nathaniel_auvil@users.sourceforge.net * * 4. Products derived from this Software may not be called "jCharts" nor may "jCharts" appear * in their names without prior written permission of Nathaniel G. Auvil. jCharts is a * registered trademark of Nathaniel G. Auvil. * * 5. Due credit should be given to the jCharts Project (http://jcharts.sourceforge.net/). * * THIS SOFTWARE IS PROVIDED BY Nathaniel G. Auvil AND CONTRIBUTORS ``AS IS'' AND ANY * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL * jCharts OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE ************************************************************************************************/ package org.jCharts.encoders; import org.jCharts.Chart; import org.jCharts.chartData.ChartDataException; import org.jCharts.properties.PropertyException; import java.awt.image.BufferedImage; import java.io.IOException; /******************************************************************************************** * * **********************************************************************************************/ public final class BinaryEncoderUtil { /****************************************************************************************** * * ******************************************************************************************/ private BinaryEncoderUtil() throws Exception { throw new Exception( "No need to create an instance of this class!" ); } /****************************************************************************************** * * @param chart * @throws ChartDataException * @throws PropertyException * @throws IOException *******************************************************************************************/ static final BufferedImage render( Chart chart ) throws ChartDataException, PropertyException, IOException { BufferedImage bufferedImage = null; //---if we use an ImageMap, we already have rendered the chart byt the time we get here so, //--- simply return the rendered image. if( chart.getGenerateImageMapFlag() ) { bufferedImage = chart.getBufferedImage(); } //---else, create a new BufferedImage and set the Graphics2D onto the chart. else { bufferedImage = new BufferedImage( chart.getImageWidth(), chart.getImageHeight(), BufferedImage.TYPE_INT_RGB ); chart.setGraphics2D( bufferedImage.createGraphics() ); chart.render(); } return bufferedImage; } } jcharts-0.7.5/src/org/jCharts/encoders/JPEGEncoder.java0000644000175000001440000001225007751071402021663 0ustar onkarusers/*********************************************************************************************** * File Info: $Id: JPEGEncoder.java,v 1.6 2003/03/14 03:22:43 nathaniel_auvil Exp $ * Copyright (C) 2002 * Author: Nathaniel G. Auvil * Contributor(s): * * Copyright 2002 (C) Nathaniel G. Auvil. All Rights Reserved. * * Redistribution and use of this software and associated documentation ("Software"), with or * without modification, are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain copyright statements and notices. * Redistributions must also contain a copy of this document. * * 2. Redistributions in binary form must reproduce the above copyright notice, this list of * conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. * * 3. The name "jCharts" or "Nathaniel G. Auvil" must not be used to endorse or promote * products derived from this Software without prior written permission of Nathaniel G. * Auvil. For written permission, please contact nathaniel_auvil@users.sourceforge.net * * 4. Products derived from this Software may not be called "jCharts" nor may "jCharts" appear * in their names without prior written permission of Nathaniel G. Auvil. jCharts is a * registered trademark of Nathaniel G. Auvil. * * 5. Due credit should be given to the jCharts Project (http://jcharts.sourceforge.net/). * * THIS SOFTWARE IS PROVIDED BY Nathaniel G. Auvil AND CONTRIBUTORS ``AS IS'' AND ANY * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL * jCharts OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE ************************************************************************************************/ package org.jCharts.encoders; import org.jCharts.Chart; import org.jCharts.chartData.ChartDataException; import org.jCharts.properties.PropertyException; import javax.imageio.*; import javax.imageio.plugins.jpeg.JPEGImageWriteParam; import javax.imageio.stream.ImageOutputStream; import java.awt.image.BufferedImage; import java.awt.image.IndexColorModel; import java.io.IOException; import java.io.OutputStream; import java.util.Iterator; /******************************************************************************************** * This class REQUIRES the jdk 1.4 * **********************************************************************************************/ public final class JPEGEncoder { private static final String JPEG = "jpeg"; static { //---do not use a file cache as hurts performance ImageIO.setUseCache( false ); } /****************************************************************************************** * * ******************************************************************************************/ private JPEGEncoder() throws Exception { throw new Exception( "No need to create an instance of this class!" ); } /****************************************************************************************** * Encodes the chart to a JPEG format. If you are generating large dimension images, the file * size can get quite large. You can try decreasing the quality to decrease the file size. * * @param outputStream * @param quality float value from 0.0f(worst image quality) - 1.0f(best image quality) * @throws ChartDataException * @throws PropertyException * @throws IOException *******************************************************************************************/ public static final void encode( Chart chart, float quality, OutputStream outputStream ) throws ChartDataException, PropertyException, IOException { BufferedImage bufferedImage = BinaryEncoderUtil.render( chart ); Iterator writers = ImageIO.getImageWritersByFormatName( JPEG ); ImageWriter imageWriter = (ImageWriter) writers.next(); JPEGImageWriteParam params = new JPEGImageWriteParam( null ); params.setCompressionMode( ImageWriteParam.MODE_EXPLICIT ); params.setCompressionQuality( quality ); params.setProgressiveMode( javax.imageio.ImageWriteParam.MODE_DISABLED ); params.setDestinationType( new ImageTypeSpecifier( IndexColorModel.getRGBdefault(), IndexColorModel.getRGBdefault().createCompatibleSampleModel( 16, 16 ) ) ); ImageOutputStream imageOutputStream = ImageIO.createImageOutputStream( outputStream ); imageWriter.setOutput( imageOutputStream ); imageWriter.write( null, new IIOImage( bufferedImage, null, null ), params ); imageOutputStream.close(); imageWriter.dispose(); } } jcharts-0.7.5/src/org/jCharts/encoders/JPEGEncoder13.java0000644000175000001440000001122707751071402022032 0ustar onkarusers/*********************************************************************************************** * File Info: $Id: JPEGEncoder13.java,v 1.6 2003/03/14 03:22:42 nathaniel_auvil Exp $ * Copyright (C) 2002 * Author: Nathaniel G. Auvil * Contributor(s): * * Copyright 2002 (C) Nathaniel G. Auvil. All Rights Reserved. * * Redistribution and use of this software and associated documentation ("Software"), with or * without modification, are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain copyright statements and notices. * Redistributions must also contain a copy of this document. * * 2. Redistributions in binary form must reproduce the above copyright notice, this list of * conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. * * 3. The name "jCharts" or "Nathaniel G. Auvil" must not be used to endorse or promote * products derived from this Software without prior written permission of Nathaniel G. * Auvil. For written permission, please contact nathaniel_auvil@users.sourceforge.net * * 4. Products derived from this Software may not be called "jCharts" nor may "jCharts" appear * in their names without prior written permission of Nathaniel G. Auvil. jCharts is a * registered trademark of Nathaniel G. Auvil. * * 5. Due credit should be given to the jCharts Project (http://jcharts.sourceforge.net/). * * THIS SOFTWARE IS PROVIDED BY Nathaniel G. Auvil AND CONTRIBUTORS ``AS IS'' AND ANY * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL * jCharts OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE ************************************************************************************************/ package org.jCharts.encoders; import com.sun.image.codec.jpeg.*; import org.jCharts.Chart; import org.jCharts.chartData.ChartDataException; import org.jCharts.properties.PropertyException; import java.awt.image.*; import java.io.IOException; import java.io.OutputStream; /******************************************************************************************* * Provided for backwards compatibility for jdk 1.3 * *********************************************************************************************/ public final class JPEGEncoder13 { /****************************************************************************************** * * ******************************************************************************************/ private JPEGEncoder13() throws Exception { throw new Exception( "No need to create an instance of this class!" ); } /****************************************************************************************** * Encodes the chart to a JPEG format. If you are generating large dimension images, the file * size can get quite large. You can try decreasing the quality to decrease the file size. * * @param outputStream * @param quality float value from 0.0f(worst image quality) - 1.0f(best image quality) * @throws ChartDataException * @throws PropertyException * @throws IOException *******************************************************************************************/ public static final void encode( Chart chart, float quality, OutputStream outputStream ) throws ChartDataException, PropertyException, IOException { BufferedImage bufferedImage = BinaryEncoderUtil.render( chart ); float[] sharpKernel = {0.0f, -1.0f, 0.0f, -1.0f, 5.0f, -1.0f, 0.0f, -1.0f, 0.0f}; BufferedImageOp sharpen = new ConvolveOp( new Kernel( 3, 3, sharpKernel ), ConvolveOp.EDGE_NO_OP, null ); BufferedImage sharp = sharpen.filter( bufferedImage, null ); //---create an encoder object for the BufferedImage. JPEGEncodeParam jpegParam = JPEGCodec.getDefaultJPEGEncodeParam( sharp ); jpegParam.setQuality( quality, false ); JPEGImageEncoder jpeg = JPEGCodec.createJPEGEncoder( outputStream, jpegParam ); //---encode the BufferedImage. jpeg.encode( bufferedImage ); } } jcharts-0.7.5/src/org/jCharts/encoders/PNGEncoder.java0000644000175000001440000001003707751071402021563 0ustar onkarusers/*********************************************************************************************** * File Info: $Id: PNGEncoder.java,v 1.6 2003/03/14 03:22:42 nathaniel_auvil Exp $ * Copyright (C) 2002 * Author: Nathaniel G. Auvil * Contributor(s): * * Copyright 2002 (C) Nathaniel G. Auvil. All Rights Reserved. * * Redistribution and use of this software and associated documentation ("Software"), with or * without modification, are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain copyright statements and notices. * Redistributions must also contain a copy of this document. * * 2. Redistributions in binary form must reproduce the above copyright notice, this list of * conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. * * 3. The name "jCharts" or "Nathaniel G. Auvil" must not be used to endorse or promote * products derived from this Software without prior written permission of Nathaniel G. * Auvil. For written permission, please contact nathaniel_auvil@users.sourceforge.net * * 4. Products derived from this Software may not be called "jCharts" nor may "jCharts" appear * in their names without prior written permission of Nathaniel G. Auvil. jCharts is a * registered trademark of Nathaniel G. Auvil. * * 5. Due credit should be given to the jCharts Project (http://jcharts.sourceforge.net/). * * THIS SOFTWARE IS PROVIDED BY Nathaniel G. Auvil AND CONTRIBUTORS ``AS IS'' AND ANY * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL * jCharts OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE ************************************************************************************************/ package org.jCharts.encoders; import org.jCharts.Chart; import org.jCharts.chartData.ChartDataException; import org.jCharts.properties.PropertyException; import javax.imageio.ImageIO; import java.awt.image.BufferedImage; import java.io.IOException; import java.io.OutputStream; /******************************************************************************************** * This class REQUIRES the jdk 1.4 * **********************************************************************************************/ public final class PNGEncoder { private static final String PNG = "png"; static { //---do not use a file cache as hurts performance ImageIO.setUseCache( false ); } /****************************************************************************************** * * ******************************************************************************************/ private PNGEncoder() throws Exception { throw new Exception( "No need to create an instance of this class!" ); } /****************************************************************************************** * Encodes the Chart to an OutputStream which can be a file or any other OutputStream * implementation. * * @param chart * @param outputStream * @throws ChartDataException * @throws PropertyException * @throws IOException *******************************************************************************************/ public static final void encode( Chart chart, OutputStream outputStream ) throws ChartDataException, PropertyException, IOException { BufferedImage bufferedImage = BinaryEncoderUtil.render( chart ); ImageIO.write( bufferedImage, PNG, outputStream ); } } jcharts-0.7.5/src/org/jCharts/encoders/ServletEncoderHelper.java0000644000175000001440000001502207751071402023722 0ustar onkarusers/*********************************************************************************************** * File Info: $Id: ServletEncoderHelper.java,v 1.1 2003/03/14 03:22:42 nathaniel_auvil Exp $ * Copyright (C) 2002 * Author: Nathaniel G. Auvil * Contributor(s): * * Copyright 2002 (C) Nathaniel G. Auvil. All Rights Reserved. * * Redistribution and use of this software and associated documentation ("Software"), with or * without modification, are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain copyright statements and notices. * Redistributions must also contain a copy of this document. * * 2. Redistributions in binary form must reproduce the above copyright notice, this list of * conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. * * 3. The name "jCharts" or "Nathaniel G. Auvil" must not be used to endorse or promote * products derived from this Software without prior written permission of Nathaniel G. * Auvil. For written permission, please contact nathaniel_auvil@users.sourceforge.net * * 4. Products derived from this Software may not be called "jCharts" nor may "jCharts" appear * in their names without prior written permission of Nathaniel G. Auvil. jCharts is a * registered trademark of Nathaniel G. Auvil. * * 5. Due credit should be given to the jCharts Project (http://jcharts.sourceforge.net/). * * THIS SOFTWARE IS PROVIDED BY Nathaniel G. Auvil AND CONTRIBUTORS ``AS IS'' AND ANY * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL * jCharts OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE ************************************************************************************************/ package org.jCharts.encoders; import org.jCharts.Chart; import org.jCharts.chartData.ChartDataException; import org.jCharts.properties.PropertyException; import javax.servlet.http.HttpServletResponse; import java.io.IOException; public class ServletEncoderHelper { public static final String SVG_MIME_TYPE = "image/svg+xml"; public static final String PNG_MIME_TYPE = "image/png"; public static final String JPEG_MIME_TYPE = "image/jpeg"; /****************************************************************************************** * Convenience method to call from a Servlet or JSP. This method will set the appropriate * mime type and then export the chart as the response. * * We cannot overload encode(...) as it will create a compile time dependency with the * HttpServletResponse Class which will require the J2EE libraries. * * @param chart * @param httpServletResponse * @throws ChartDataException * @throws PropertyException * @throws IOException * @since 0.7 ******************************************************************************************/ public static final void encodeServlet( Chart chart, HttpServletResponse httpServletResponse ) throws ChartDataException, PropertyException, IOException { httpServletResponse.setContentType( SVG_MIME_TYPE ); SVGEncoder.encode( chart, httpServletResponse.getOutputStream() ); } /****************************************************************************************** * Convenience method to call from a Servlet or JSP. This method will set the appropriate * mime type and then export the chart as the response. * * We cannot overload encode(...) as it will create a compile time dependency with the * HttpServletResponse Class which will require the J2EE libraries. * * @param chart * @param quality float value from 0.0f(worst image quality) - 1.0f(best image quality) * @param httpServletResponse * @throws ChartDataException * @throws PropertyException * @throws IOException * @since 0.7 ******************************************************************************************/ public static final void encodeJPEG13( Chart chart, float quality, HttpServletResponse httpServletResponse ) throws ChartDataException, PropertyException, IOException { httpServletResponse.setContentType( JPEG_MIME_TYPE ); JPEGEncoder13.encode( chart, quality, httpServletResponse.getOutputStream() ); } /****************************************************************************************** * Convenience method to call from a Servlet or JSP. This method will set the appropriate * mime type and then export the chart as the response. * * @param chart * @param quality float value from 0.0f(worst image quality) - 1.0f(best image quality) * @param httpServletResponse * @throws ChartDataException * @throws PropertyException * @throws IOException ******************************************************************************************/ public static final void encodeJPEG( Chart chart, float quality, HttpServletResponse httpServletResponse ) throws ChartDataException, PropertyException, IOException { httpServletResponse.setContentType( JPEG_MIME_TYPE ); JPEGEncoder.encode( chart, quality, httpServletResponse.getOutputStream() ); } /****************************************************************************************** * Convenience method to call from a Servlet or JSP. This method will set the appropriate * mime type and then export the chart as the response. * * @param chart * @param httpServletResponse * @throws org.jCharts.chartData.ChartDataException * @throws org.jCharts.properties.PropertyException * @throws java.io.IOException ******************************************************************************************/ public static final void encodePNG( Chart chart, HttpServletResponse httpServletResponse ) throws ChartDataException, PropertyException, IOException { httpServletResponse.setContentType( PNG_MIME_TYPE ); PNGEncoder.encode( chart, httpServletResponse.getOutputStream() ); } } jcharts-0.7.5/src/org/jCharts/encoders/SVGEncoder.java0000644000175000001440000001126607751071402021603 0ustar onkarusers/*********************************************************************************************** * File Info: $Id: SVGEncoder.java,v 1.6 2003/03/14 03:22:41 nathaniel_auvil Exp $ * Copyright (C) 2002 * Author: Nathaniel G. Auvil * Contributor(s): * * Copyright 2002 (C) Nathaniel G. Auvil. All Rights Reserved. * * Redistribution and use of this software and associated documentation ("Software"), with or * without modification, are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain copyright statements and notices. * Redistributions must also contain a copy of this document. * * 2. Redistributions in binary form must reproduce the above copyright notice, this list of * conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. * * 3. The name "jCharts" or "Nathaniel G. Auvil" must not be used to endorse or promote * products derived from this Software without prior written permission of Nathaniel G. * Auvil. For written permission, please contact nathaniel_auvil@users.sourceforge.net * * 4. Products derived from this Software may not be called "jCharts" nor may "jCharts" appear * in their names without prior written permission of Nathaniel G. Auvil. jCharts is a * registered trademark of Nathaniel G. Auvil. * * 5. Due credit should be given to the jCharts Project (http://jcharts.sourceforge.net/). * * THIS SOFTWARE IS PROVIDED BY Nathaniel G. Auvil AND CONTRIBUTORS ``AS IS'' AND ANY * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL * jCharts OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE ************************************************************************************************/ package org.jCharts.encoders; import org.apache.batik.dom.GenericDOMImplementation; import org.apache.batik.svggen.SVGGraphics2D; import org.jCharts.Chart; import org.jCharts.chartData.ChartDataException; import org.jCharts.imageMap.ImageMapNotSupportedException; import org.jCharts.properties.PropertyException; import org.w3c.dom.DOMImplementation; import org.w3c.dom.Document; import java.io.*; /******************************************************************************************** * This class REQUIRES the Apache XML Batik libraries to run. * **********************************************************************************************/ public final class SVGEncoder { /****************************************************************************************** * * ******************************************************************************************/ private SVGEncoder() throws Exception { throw new Exception( "No need to create an instance of this class!" ); } /****************************************************************************************** * Encodes the Chart to an OutputStream which can be a file or any other OutputStream * implementation. * * @param chart * @param outputStream * @throws ChartDataException * @throws PropertyException * @throws IOException *******************************************************************************************/ public static final void encode( Chart chart, OutputStream outputStream ) throws ChartDataException, PropertyException, IOException { //---hopefully eliminate support requests asking about this... if( chart.getImageMap() != null ) { throw new ImageMapNotSupportedException( "HTML client-side image maps are not supported by the SVG format." ); } //---Get a DOMImplementation DOMImplementation domImpl = GenericDOMImplementation.getDOMImplementation(); //---Create an instance of org.w3c.dom.Document Document document = domImpl.createDocument( null, "svg", null ); //---Create an instance of the SVG Generator SVGGraphics2D svgGenerator = new SVGGraphics2D( document ); chart.setGraphics2D( svgGenerator ); chart.render(); Writer writer = new OutputStreamWriter( outputStream, "UTF-8" ); svgGenerator.stream( writer, false ); writer.flush(); writer.close(); } } jcharts-0.7.5/src/org/jCharts/imageMap/0000755000175000001440000000000007751071402016711 5ustar onkarusersjcharts-0.7.5/src/org/jCharts/imageMap/AreaShape.java0000644000175000001440000000672207751071402021414 0ustar onkarusers/*********************************************************************************************** * File Info: $Id: AreaShape.java,v 1.2 2002/10/14 20:52:04 nathaniel_auvil Exp $ * Copyright (C) 2001 * Author: Nathaniel G. Auvil * Contributor(s): * * Copyright 2002 (C) Nathaniel G. Auvil. All Rights Reserved. * * Redistribution and use of this software and associated documentation * ("Software"), with or without modification, are permitted provided * that the following conditions are met: * * 1. Redistributions of source code must retain copyright * statements and notices. Redistributions must also contain a * copy of this document. * * 2. Redistributions in binary form must reproduce the * above copyright notice, this list of conditions and the * following disclaimer in the documentation and/or other * materials provided with the distribution. * * 3. The name "jCharts" or "Nathaniel G. Auvil" must not be used to * endorse or promote products derived from this Software without * prior written permission of Nathaniel G. Auvil. For written * permission, please contact nathaniel_auvil@users.sourceforge.net * * 4. Products derived from this Software may not be called "jCharts" * nor may "jCharts" appear in their names without prior written * permission of Nathaniel G. Auvil. jCharts is a registered * trademark of Nathaniel G. Auvil. * * 5. Due credit should be given to the jCharts Project * (http://jcharts.sourceforge.net/). * * THIS SOFTWARE IS PROVIDED BY Nathaniel G. Auvil AND CONTRIBUTORS * ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT * NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL * jCharts OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED * OF THE POSSIBILITY OF SUCH DAMAGE. ************************************************************************************************/ package org.jCharts.imageMap; import java.io.Serializable; /***************************************************************************************** * * ******************************************************************************************/ public class AreaShape implements Serializable { public static final AreaShape RECTANGLE=new AreaShape( "rect" ); public static final AreaShape CIRCLE=new AreaShape( "circle" ); public static final AreaShape POLYGON=new AreaShape( "poly" ); private String value; /*************************************************************************************** * * @param value ****************************************************************************************/ private AreaShape( String value ) { this.value=value; } /*************************************************************************************** * * @return value ****************************************************************************************/ public String getValue() { return this.value; } } jcharts-0.7.5/src/org/jCharts/imageMap/CircleMapArea.java0000644000175000001440000001075207751071402022211 0ustar onkarusers/*********************************************************************************************** * File Info: $Id: CircleMapArea.java,v 1.3 2003/02/19 23:26:17 nathaniel_auvil Exp $ * Copyright (C) 2001 * Author: Nathaniel G. Auvil * Contributor(s): * * Copyright 2002 (C) Nathaniel G. Auvil. All Rights Reserved. * * Redistribution and use of this software and associated documentation * ("Software"), with or without modification, are permitted provided * that the following conditions are met: * * 1. Redistributions of source code must retain copyright * statements and notices. Redistributions must also contain a * copy of this document. * * 2. Redistributions in binary form must reproduce the * above copyright notice, this list of conditions and the * following disclaimer in the documentation and/or other * materials provided with the distribution. * * 3. The name "jCharts" or "Nathaniel G. Auvil" must not be used to * endorse or promote products derived from this Software without * prior written permission of Nathaniel G. Auvil. For written * permission, please contact nathaniel_auvil@users.sourceforge.net * * 4. Products derived from this Software may not be called "jCharts" * nor may "jCharts" appear in their names without prior written * permission of Nathaniel G. Auvil. jCharts is a registered * trademark of Nathaniel G. Auvil. * * 5. Due credit should be given to the jCharts Project * (http://jcharts.sourceforge.net/). * * THIS SOFTWARE IS PROVIDED BY Nathaniel G. Auvil AND CONTRIBUTORS * ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT * NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL * jCharts OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED * OF THE POSSIBILITY OF SUCH DAMAGE. ************************************************************************************************/ package org.jCharts.imageMap; import java.io.Serializable; import java.awt.geom.Point2D; /***************************************************************************************** * * ******************************************************************************************/ public final class CircleMapArea extends ImageMapArea implements Serializable { //---only applies to circles private int radius=5; /*************************************************************************************** * * @param x * @param y * @param value * @param xAxisLabel * @param legendLabel ****************************************************************************************/ public CircleMapArea( float x, float y, double value, String xAxisLabel, String legendLabel ) { super( 1, value, xAxisLabel, legendLabel ); super.x[ 0 ]= (int) x; super.y[ 0 ]= (int) y; } /*************************************************************************************** * * @param x * @param y * @param value * @param legendLabel ****************************************************************************************/ public CircleMapArea( float x, float y, Point2D.Double value, String legendLabel ) { super( 1, value, legendLabel ); super.x[ 0 ]= (int) x; super.y[ 0 ]= (int) y; } /*************************************************************************************** * * @return AreaShape ****************************************************************************************/ public AreaShape getAreaShape() { return AreaShape.CIRCLE; } /*************************************************************************************** * Allows user to specify the radius for each circle * * @param radius ****************************************************************************************/ public void setRadius( int radius ) { this.radius=radius; } protected void getCoordinates( StringBuffer html ) { html.append( this.x[ 0 ] + "," + this.y[ 0 ] + "," + this.radius ); } } jcharts-0.7.5/src/org/jCharts/imageMap/ImageMap.java0000644000175000001440000000702007751071402021233 0ustar onkarusers/*********************************************************************************************** * File Info: $Id: ImageMap.java,v 1.3 2003/02/09 23:01:07 nathaniel_auvil Exp $ * Copyright (C) 2000 * Author: Nathaniel G. Auvil * Contributor(s): * * Copyright 2002 (C) Nathaniel G. Auvil. All Rights Reserved. * * Redistribution and use of this software and associated documentation ("Software"), with or * without modification, are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain copyright statements and notices. * Redistributions must also contain a copy of this document. * * 2. Redistributions in binary form must reproduce the above copyright notice, this list of * conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. * * 3. The name "jCharts" or "Nathaniel G. Auvil" must not be used to endorse or promote * products derived from this Software without prior written permission of Nathaniel G. * Auvil. For written permission, please contact nathaniel_auvil@users.sourceforge.net * * 4. Products derived from this Software may not be called "jCharts" nor may "jCharts" appear * in their names without prior written permission of Nathaniel G. Auvil. jCharts is a * registered trademark of Nathaniel G. Auvil. * * 5. Due credit should be given to the jCharts Project (http://jcharts.sourceforge.net/). * * THIS SOFTWARE IS PROVIDED BY Nathaniel G. Auvil AND CONTRIBUTORS ``AS IS'' AND ANY * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL * jCharts OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE ************************************************************************************************/ package org.jCharts.imageMap; import java.io.Serializable; import java.util.ArrayList; import java.util.Iterator; /***************************************************************************************** * * ******************************************************************************************/ public final class ImageMap implements Serializable { private ArrayList areas; /*************************************************************************************** * * @param size the number of areas ****************************************************************************************/ public ImageMap( int size ) { this.areas= new ArrayList( size ); } /*************************************************************************************** * * @param imageMapArea ****************************************************************************************/ public void addImageMapArea( ImageMapArea imageMapArea ) { this.areas.add( imageMapArea ); } public Iterator getIterator() { return this.areas.iterator(); } public String toHTML() { StringBuffer s= new StringBuffer(); return s.toString(); } } jcharts-0.7.5/src/org/jCharts/imageMap/ImageMapArea.java0000644000175000001440000002031007751071402022021 0ustar onkarusers/*********************************************************************************************** * File Info: $Id: ImageMapArea.java,v 1.4 2003/02/19 23:26:17 nathaniel_auvil Exp $ * Copyright (C) 2001 * Author: Nathaniel G. Auvil * Contributor(s): * * Copyright 2002 (C) Nathaniel G. Auvil. All Rights Reserved. * * Redistribution and use of this software and associated documentation * ("Software"), with or without modification, are permitted provided * that the following conditions are met: * * 1. Redistributions of source code must retain copyright * statements and notices. Redistributions must also contain a * copy of this document. * * 2. Redistributions in binary form must reproduce the * above copyright notice, this list of conditions and the * following disclaimer in the documentation and/or other * materials provided with the distribution. * * 3. The name "jCharts" or "Nathaniel G. Auvil" must not be used to * endorse or promote products derived from this Software without * prior written permission of Nathaniel G. Auvil. For written * permission, please contact nathaniel_auvil@users.sourceforge.net * * 4. Products derived from this Software may not be called "jCharts" * nor may "jCharts" appear in their names without prior written * permission of Nathaniel G. Auvil. jCharts is a registered * trademark of Nathaniel G. Auvil. * * 5. Due credit should be given to the jCharts Project * (http://jcharts.sourceforge.net/). * * THIS SOFTWARE IS PROVIDED BY Nathaniel G. Auvil AND CONTRIBUTORS * ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT * NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL * jCharts OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED * OF THE POSSIBILITY OF SUCH DAMAGE. ************************************************************************************************/ package org.jCharts.imageMap; import java.io.Serializable; import java.awt.geom.Point2D; /***************************************************************************************** * * ******************************************************************************************/ public abstract class ImageMapArea implements Serializable { //---less overhead than creating Point Objects int[] x; int[] y; private double value; private String xAxisLabel; private String legendLabel; /*************************************************************************************** * * @param numberOfPoints * @param value * @param xAxisLabel * @param legendLabel ****************************************************************************************/ ImageMapArea( int numberOfPoints, double value, String xAxisLabel, String legendLabel ) { this.x=new int[ numberOfPoints ]; this.y=new int[ numberOfPoints ]; this.value=value; this.xAxisLabel=xAxisLabel; this.legendLabel=legendLabel; } /*************************************************************************************** * * @param numberOfPoints * @param point * @param legendLabel ****************************************************************************************/ ImageMapArea( int numberOfPoints, Point2D.Double point, String legendLabel ) { this.x=new int[ numberOfPoints ]; this.y=new int[ numberOfPoints ]; this.value= point.getY(); this.xAxisLabel= Double.toString( point.getX() ); this.legendLabel=legendLabel; } /************************************************************************************ * * @return AreaShape ***********************************************************************************/ abstract AreaShape getAreaShape(); /*************************************************************************************** * Returns the number of x,y coordinate pairs stored for the area * * @return int ****************************************************************************************/ public final int getNumberOfCoordinates() { return this.x.length; } /*************************************************************************************** * Returns the x coordinate at the specified index. Not returned as a Point Object so we * can avoid uneeded Object creation/destruction overhead. * * @return int ****************************************************************************************/ public final int getXCoordinate( int index ) { return this.x[ index ]; } /*************************************************************************************** * Returns the y coordinate at the specified index. Not returned as a Point Object so we * can avoid uneeded Object creation/destruction overhead. * * @return int ****************************************************************************************/ public final int getYCoordinate( int index ) { return this.y[ index ]; } /*************************************************************************************** * Returns the data set value represented by this map. * * @return double ****************************************************************************************/ public final double getValue() { return this.value; } /*************************************************************************************** * Rather than create an AxisChart specifc map area class just for this field, i put it * here. This is not applicable for PieCharts. * * @return String will return NULL for PieCharts ****************************************************************************************/ public final String getXAxisLabel() { return this.xAxisLabel; } /*************************************************************************************** * Returns the legend label represented by this map area. Will be NULL if you did not * pass a name to the data set constructor. * * @return String ****************************************************************************************/ public final String getLengendLabel() { return this.legendLabel; } /*************************************************************************************** * Appends the coordinates to the passed html buffer. This is needed to facilitate the * 'circle' map areas 'radius' value. * * @param html pass a reference to the StringBuffer so I can minimize Object creation ****************************************************************************************/ protected void getCoordinates( StringBuffer html ) { for( int i=0; i < this.x.length; i++ ) { html.append( this.x[ i ] + "," + this.y[ i ] ); if( i + 1 != this.x.length ) { html.append( "," ); } } } /************************************************************************************************** * Returns a
    HTML element. * The mapElementAttributes frees this method from having to declare all attributes of the HTML map * element. * * @param mapElementAttributes allows you to place any map attributes you want: * href, alt, onClick, onMouseOver, etc... * @return String the HTML ***************************************************************************************************/ public final String toHTML( String mapElementAttributes ) { StringBuffer html=new StringBuffer( 250 ); html.append( "\n" ); return html.toString(); } } jcharts-0.7.5/src/org/jCharts/imageMap/ImageMapNotSupportedException.java0000644000175000001440000000600107751071402025477 0ustar onkarusers/*********************************************************************************************** * File Info: $Id: ImageMapNotSupportedException.java,v 1.2 2002/10/14 20:52:05 nathaniel_auvil Exp $ * Copyright (C) 2001 * Author: Nathaniel G. Auvil * Contributor(s): * * Copyright 2002 (C) Nathaniel G. Auvil. All Rights Reserved. * * Redistribution and use of this software and associated documentation * ("Software"), with or without modification, are permitted provided * that the following conditions are met: * * 1. Redistributions of source code must retain copyright * statements and notices. Redistributions must also contain a * copy of this document. * * 2. Redistributions in binary form must reproduce the * above copyright notice, this list of conditions and the * following disclaimer in the documentation and/or other * materials provided with the distribution. * * 3. The name "jCharts" or "Nathaniel G. Auvil" must not be used to * endorse or promote products derived from this Software without * prior written permission of Nathaniel G. Auvil. For written * permission, please contact nathaniel_auvil@users.sourceforge.net * * 4. Products derived from this Software may not be called "jCharts" * nor may "jCharts" appear in their names without prior written * permission of Nathaniel G. Auvil. jCharts is a registered * trademark of Nathaniel G. Auvil. * * 5. Due credit should be given to the jCharts Project * (http://jcharts.sourceforge.net/). * * THIS SOFTWARE IS PROVIDED BY Nathaniel G. Auvil AND CONTRIBUTORS * ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT * NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL * jCharts OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED * OF THE POSSIBILITY OF SUCH DAMAGE. ************************************************************************************************/ package org.jCharts.imageMap; /***************************************************************************************** * * ******************************************************************************************/ public class ImageMapNotSupportedException extends RuntimeException { /*************************************************************************************** * * @param message ****************************************************************************************/ public ImageMapNotSupportedException( String message ) { super( message ); } } jcharts-0.7.5/src/org/jCharts/imageMap/PolyMapArea.java0000644000175000001440000000767307751071402021743 0ustar onkarusers/*********************************************************************************************** * File Info: $Id: PolyMapArea.java,v 1.2 2002/10/14 20:52:05 nathaniel_auvil Exp $ * Copyright (C) 2001 * Author: Nathaniel G. Auvil * Contributor(s): * * Copyright 2002 (C) Nathaniel G. Auvil. All Rights Reserved. * * Redistribution and use of this software and associated documentation * ("Software"), with or without modification, are permitted provided * that the following conditions are met: * * 1. Redistributions of source code must retain copyright * statements and notices. Redistributions must also contain a * copy of this document. * * 2. Redistributions in binary form must reproduce the * above copyright notice, this list of conditions and the * following disclaimer in the documentation and/or other * materials provided with the distribution. * * 3. The name "jCharts" or "Nathaniel G. Auvil" must not be used to * endorse or promote products derived from this Software without * prior written permission of Nathaniel G. Auvil. For written * permission, please contact nathaniel_auvil@users.sourceforge.net * * 4. Products derived from this Software may not be called "jCharts" * nor may "jCharts" appear in their names without prior written * permission of Nathaniel G. Auvil. jCharts is a registered * trademark of Nathaniel G. Auvil. * * 5. Due credit should be given to the jCharts Project * (http://jcharts.sourceforge.net/). * * THIS SOFTWARE IS PROVIDED BY Nathaniel G. Auvil AND CONTRIBUTORS * ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT * NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL * jCharts OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED * OF THE POSSIBILITY OF SUCH DAMAGE. ************************************************************************************************/ package org.jCharts.imageMap; import java.io.Serializable; /***************************************************************************************** * * ******************************************************************************************/ public final class PolyMapArea extends ImageMapArea implements Serializable { /*************************************************************************************** * * @param numberOfPoints * @param value * @param areaType ****************************************************************************************/ public PolyMapArea( int numberOfPoints, double value, String xAxisLabel, String legendLabel ) { super( numberOfPoints, value, xAxisLabel, legendLabel ); } /*************************************************************************************** * Adds the x, y coordinate at the specified index. Not added as a Point Object so we * can avoid uneeded Object creation/destruction overhead. * * @param index * @param x * @param y ****************************************************************************************/ public void addCoordinate( int index, float x, float y ) { super.x[ index ]= (int) x; super.y[ index ]= (int) y; } /*************************************************************************************** * * @return AreaShape ****************************************************************************************/ public AreaShape getAreaShape() { return AreaShape.POLYGON; } } jcharts-0.7.5/src/org/jCharts/imageMap/RectMapArea.java0000644000175000001440000000724507751071402021710 0ustar onkarusers/*********************************************************************************************** * File Info: $Id: RectMapArea.java,v 1.2 2002/10/14 20:52:05 nathaniel_auvil Exp $ * Copyright (C) 2001 * Author: Nathaniel G. Auvil * Contributor(s): * * Copyright 2002 (C) Nathaniel G. Auvil. All Rights Reserved. * * Redistribution and use of this software and associated documentation * ("Software"), with or without modification, are permitted provided * that the following conditions are met: * * 1. Redistributions of source code must retain copyright * statements and notices. Redistributions must also contain a * copy of this document. * * 2. Redistributions in binary form must reproduce the * above copyright notice, this list of conditions and the * following disclaimer in the documentation and/or other * materials provided with the distribution. * * 3. The name "jCharts" or "Nathaniel G. Auvil" must not be used to * endorse or promote products derived from this Software without * prior written permission of Nathaniel G. Auvil. For written * permission, please contact nathaniel_auvil@users.sourceforge.net * * 4. Products derived from this Software may not be called "jCharts" * nor may "jCharts" appear in their names without prior written * permission of Nathaniel G. Auvil. jCharts is a registered * trademark of Nathaniel G. Auvil. * * 5. Due credit should be given to the jCharts Project * (http://jcharts.sourceforge.net/). * * THIS SOFTWARE IS PROVIDED BY Nathaniel G. Auvil AND CONTRIBUTORS * ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT * NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL * jCharts OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED * OF THE POSSIBILITY OF SUCH DAMAGE. ************************************************************************************************/ package org.jCharts.imageMap; import java.awt.geom.Rectangle2D; import java.io.Serializable; /***************************************************************************************** * * ******************************************************************************************/ public final class RectMapArea extends ImageMapArea implements Serializable { /*************************************************************************************** * * @param rectangle * @param value * @param xAxisLabel * @param legendLabel ****************************************************************************************/ public RectMapArea( Rectangle2D.Float rectangle, double value, String xAxisLabel, String legendLabel ) { super( 2, value, xAxisLabel, legendLabel ); super.x[ 0 ]=(int) rectangle.x; super.y[ 0 ]=(int) rectangle.y; super.x[ 1 ]=(int) ( rectangle.x + rectangle.width ); super.y[ 1 ]=(int) ( rectangle.y + rectangle.height ); } /*************************************************************************************** * * @return AreaShape ****************************************************************************************/ public AreaShape getAreaShape() { return AreaShape.RECTANGLE; } } jcharts-0.7.5/src/org/jCharts/nonAxisChart/0000755000175000001440000000000007751071402017572 5ustar onkarusersjcharts-0.7.5/src/org/jCharts/nonAxisChart/PieChart2D.java0000644000175000001440000005431707751071402022334 0ustar onkarusers/*********************************************************************************************** * File Info: $Id: PieChart2D.java,v 1.11 2003/04/19 01:55:13 nathaniel_auvil Exp $ * Copyright (C) 2002 * Author: Nathaniel G. Auvil * Contributor(s): * * Copyright 2002 (C) Nathaniel G. Auvil. All Rights Reserved. * * Redistribution and use of this software and associated documentation ("Software"), with or * without modification, are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain copyright statements and notices. * Redistributions must also contain a copy of this document. * * 2. Redistributions in binary form must reproduce the above copyright notice, this list of * conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. * * 3. The name "jCharts" or "Nathaniel G. Auvil" must not be used to endorse or promote * products derived from this Software without prior written permission of Nathaniel G. * Auvil. For written permission, please contact nathaniel_auvil@users.sourceforge.net * * 4. Products derived from this Software may not be called "jCharts" nor may "jCharts" appear * in their names without prior written permission of Nathaniel G. Auvil. jCharts is a * registered trademark of Nathaniel G. Auvil. * * 5. Due credit should be given to the jCharts Project (http://jcharts.sourceforge.net/). * * THIS SOFTWARE IS PROVIDED BY Nathaniel G. Auvil AND CONTRIBUTORS ``AS IS'' AND ANY * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL * jCharts OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE ************************************************************************************************/ package org.jCharts.nonAxisChart; import org.jCharts.Chart; import org.jCharts.types.PieLabelType; import org.jCharts.chartData.interfaces.IPieChartDataSet; import org.jCharts.chartData.processors.PieChartDataProcessor; import org.jCharts.chartText.NumericTagGroup; import org.jCharts.chartText.TextTagGroup; import org.jCharts.imageMap.*; import org.jCharts.properties.*; import org.jCharts.test.HTMLChartTestable; import org.jCharts.test.HTMLGenerator; import java.awt.*; import java.awt.font.FontRenderContext; import java.awt.geom.Arc2D; import java.awt.geom.Line2D; /*********************************************************************************************** * * ************************************************************************************************/ final public class PieChart2D extends Chart implements HTMLChartTestable { private float pieX; private float pieY; private float diameter; private IPieChartDataSet iPieChartDataSet; private PieChartDataProcessor pieChartDataProcessor; private TextTagGroup textTagGroup; /************************************************************************************************ * Constructor * * @param iPieChartDataSet * @param legendProperties * @param chartProperties general chart properties * @param pixelWidth * @param pixelHeight ************************************************************************************************/ public PieChart2D( IPieChartDataSet iPieChartDataSet, LegendProperties legendProperties, ChartProperties chartProperties, int pixelWidth, int pixelHeight ) { super( legendProperties, chartProperties, pixelWidth, pixelHeight ); this.iPieChartDataSet = iPieChartDataSet; } /************************************************************************************************ * Draws the chart * ************************************************************************************************/ protected void renderChart() { PieChart2DProperties properties = (PieChart2DProperties) this.iPieChartDataSet.getChartTypeProperties(); this.pieChartDataProcessor = new PieChartDataProcessor( this.iPieChartDataSet ); this.pieChartDataProcessor.processData(); //---cache calcs used more than once float edgePaddingTimesTwo = super.getChartProperties().getEdgePadding() * 2; float halfImageWidth = super.getImageWidth() / 2; float halfImageHeight = super.getImageHeight() / 2; FontRenderContext fontRenderContext = super.getGraphics2D().getFontRenderContext(); //---render the TITLE. If no title, this will return zero. float chartTitleHeight = super.renderChartTitle( this.iPieChartDataSet.getChartTitle(), fontRenderContext ); //---if we want to display value labels on the chart need to determine the width this will take float widestLabel = 0; float widestLabelTimesTwo = 0; float tallestLabel = 0; float tallestLabelTimesTwo = 0; if( !properties.getPieLabelType().equals( PieLabelType.NO_LABELS ) ) { if( properties.getPieLabelType().equals( PieLabelType.VALUE_LABELS ) ) { this.textTagGroup = new NumericTagGroup( properties.getValueLabelFont(), fontRenderContext, properties.showValueLabelCurrency(), false, properties.showValueLabelGrouping(), properties.getValueLabelRoundingPowerOfTen() ); for( int i = 0; i < this.iPieChartDataSet.getNumberOfDataItems(); i++ ) { ((NumericTagGroup) this.textTagGroup).addLabel( this.iPieChartDataSet.getValue( i ) ); } } //---PieLabelType.LEGEND_LABELS else { this.textTagGroup = new TextTagGroup( properties.getValueLabelFont(), fontRenderContext ); for( int i = 0; i < this.iPieChartDataSet.getNumberOfLegendLabels(); i++ ) { this.textTagGroup.addLabel( this.iPieChartDataSet.getLegendLabel( i ) ); } } widestLabel = this.textTagGroup.getWidestLabel(); widestLabelTimesTwo = widestLabel * 2; tallestLabel = this.textTagGroup.getTallestLabel(); tallestLabelTimesTwo = tallestLabel * 2; } //---if there is a legend... if( this.getLegend() != null ) { float legendX = 0f; float legendY = 0f; //---calculate all the legend rendering coordinates and positions. this.getLegend().calculateDrawingValues( iPieChartDataSet ); //---adjust width and height based on the Legend size. if( (this.getLegend().getLegendProperties().getPlacement() == LegendAreaProperties.RIGHT) || (this.getLegend().getLegendProperties().getPlacement() == LegendAreaProperties.LEFT) ) { float widthNeeded = this.getLegend().getWidth() + this.getLegend().getLegendProperties().getChartPadding(); widthNeeded += edgePaddingTimesTwo; float heightAvailable = super.getImageHeight(); heightAvailable -= edgePaddingTimesTwo; heightAvailable -= chartTitleHeight; //---if we are going to show labels, include their width... if( this.textTagGroup != null ) { widthNeeded += widestLabelTimesTwo; //todo should have a padding property? widthNeeded += (properties.getTickLength() * 2); heightAvailable -= tallestLabelTimesTwo; } //---diameter of pie will be at least one pixel, even if the legend takes up the whole image. //---this will keep the renderer from blowing up. this.diameter = Math.max( super.getImageWidth() - widthNeeded, 1.0f ); //---make sure we do not make the pie diameter taller than the image this.diameter = Math.min( this.diameter, heightAvailable ); if( this.getLegend().getLegendProperties().getPlacement() == LegendAreaProperties.RIGHT ) { //---pie's diameter may not fill image width as may be image height constrained. //---center the pie chart this.pieX = halfImageWidth - ((this.getLegend().getWidth() + this.getLegend().getLegendProperties().getChartPadding() + this.diameter) / 2); //---position legend based on the pie position legendX = this.pieX + this.diameter + this.getLegend().getLegendProperties().getChartPadding(); legendX += widestLabel; legendX += properties.getTickLength(); } else { //---position legend based on the pie position legendX = halfImageWidth - ((this.getLegend().getWidth() + this.getLegend().getLegendProperties().getChartPadding() + this.diameter) / 2); //---pie's diameter may not fill image width as may be image height constrained. //---center the pie chart this.pieX = legendX + this.getLegend().getWidth() + this.getLegend().getLegendProperties().getChartPadding(); } //---center the legend vertically legendY = halfImageHeight - (this.getLegend().getHeight() / 2); legendY += chartTitleHeight / 2; //---center the pie vertically this.pieY = halfImageHeight - (this.diameter / 2); this.pieY += chartTitleHeight / 2; } else { float heightNeeded = this.getLegend().getHeight() + this.getLegend().getLegendProperties().getChartPadding(); heightNeeded += edgePaddingTimesTwo; //---add in the chart title height heightNeeded += chartTitleHeight; //---diameter of pie will be at least one pixel, even if the legend takes up the whole image. //---this will keep the renderer from blowing up. this.diameter = Math.max( super.getImageHeight() - heightNeeded, 1.0f ); //---make sure we do not make the pie diameter wider than the image this.diameter = Math.min( this.diameter, super.getImageWidth() - edgePaddingTimesTwo ); if( this.getLegend().getLegendProperties().getPlacement() == LegendAreaProperties.BOTTOM ) { //---pie's diameter may not fill image width as may be image height constrained. //---center the pie chart this.pieY = halfImageHeight - ((this.getLegend().getHeight() + this.getLegend().getLegendProperties().getChartPadding() + this.diameter) / 2); this.pieY += chartTitleHeight / 2; //---position legend based on the pie position legendY = this.pieY + this.diameter + this.getLegend().getLegendProperties().getChartPadding(); } else { //---pie's diameter may not fill image width as may be image height constrained. //---center the pie chart legendY = halfImageHeight - ((this.getLegend().getHeight() + this.getLegend().getLegendProperties().getChartPadding() + this.diameter) / 2); legendY += chartTitleHeight / 2; //---position legend based on the pie position this.pieY = legendY + this.getLegend().getHeight() + this.getLegend().getLegendProperties().getChartPadding(); } //---center the legend vertically legendX = halfImageWidth - (this.getLegend().getWidth() / 2); //---center the pie vertically this.pieX = halfImageWidth - (this.diameter / 2); } super.getLegend().setX( legendX ); super.getLegend().setY( legendY ); super.getLegend().render(); } //---else, the Legend is NULL else { float heightNeeded = super.getImageHeight() - edgePaddingTimesTwo - chartTitleHeight; float widthNeeded = super.getImageWidth() - edgePaddingTimesTwo; //---if we are going to show labels, include their width... if( this.textTagGroup != null ) { widthNeeded -= widestLabelTimesTwo; widthNeeded -= (properties.getTickLength() * 2); heightNeeded -= tallestLabelTimesTwo; heightNeeded -= (properties.getTickLength() * 2); } //---if there is no legend, fill the image with the pie this.diameter = Math.min( heightNeeded, widthNeeded ); float halfDiameter = this.diameter / 2; //---center the pie horizontally this.pieX = halfImageWidth - halfDiameter; //---center the pie vertically this.pieY = halfImageHeight - halfDiameter; this.pieY += chartTitleHeight / 2; } //---IMAGE MAP setup //---if we are saving all the coordinates for an ImageMap, create the ImageMap Object as we //--- know how many area elements there are. if( super.getGenerateImageMapFlag() ) { ImageMap imageMap = new ImageMap( iPieChartDataSet.getNumberOfDataItems() ); super.setImageMap( imageMap ); } PieChart2D.render( this ); } /************************************************************************************************ * Implement the method to render the Chart. * * @param pieChart2D ************************************************************************************************/ static void render( PieChart2D pieChart2D ) { Graphics2D g2d = pieChart2D.getGraphics2D(); PieChart2DProperties properties = (PieChart2DProperties) pieChart2D.iPieChartDataSet.getChartTypeProperties(); //---turn anti-aliasing on! g2d.setRenderingHint( RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON ); //---set the border Stroke g2d.setStroke( properties.getBorderStroke() ); //---the following only for Image Map----------------------------- //---IMAGE MAP //---number of subdivisions to break each slice into to 'fill' slice int subdivisions = 3; float halfDiameter = 0; float xPieMiddle = 0; float yPieMiddle = 0; float imageMapPoints[][] = null; if( pieChart2D.getImageMap() != null ) { halfDiameter = (float) (pieChart2D.diameter / 2.0); xPieMiddle = halfDiameter + pieChart2D.pieX; yPieMiddle = halfDiameter + pieChart2D.pieY; imageMapPoints = new float[ pieChart2D.iPieChartDataSet.getNumberOfDataItems() * (subdivisions + 1) ][ 2 ]; } //---get the starting degree float currentDegrees = properties.getZeroDegreeOffset(); double percentageOfPie = 0; //---if only one item in chart, just draw border around outside. //---if do a draw of the arc, will get a line in the pie as arc has a start and end. if( pieChart2D.iPieChartDataSet.getNumberOfDataItems() == 1 ) { Arc2D.Double arc = new Arc2D.Double( pieChart2D.pieX, pieChart2D.pieY, pieChart2D.diameter, pieChart2D.diameter, currentDegrees, 360, Arc2D.OPEN ); g2d.setPaint( pieChart2D.iPieChartDataSet.getPaint( 0 ) ); g2d.fill( arc ); g2d.setPaint( properties.getBorderPaint() ); g2d.draw( arc ); //---if only a single value use a circle map //---IMAGE MAP if( pieChart2D.getImageMap() != null ) { CircleMapArea circleMapArea = new CircleMapArea( xPieMiddle, yPieMiddle, pieChart2D.iPieChartDataSet.getValue( 0 ), null, pieChart2D.iPieChartDataSet.getLegendLabel( 0 ) ); circleMapArea.setRadius( (int) pieChart2D.diameter ); pieChart2D.getImageMap().addImageMapArea( circleMapArea ); } } else { Arc2D.Double arc = new Arc2D.Double( pieChart2D.pieX, pieChart2D.pieY, pieChart2D.diameter, pieChart2D.diameter, currentDegrees, 360, Arc2D.PIE ); //---IMAGE MAP int mapCounter = 0; for( int i = 0; i < pieChart2D.iPieChartDataSet.getNumberOfDataItems(); i++ ) { percentageOfPie = pieChart2D.pieChartDataProcessor.getPercentageOfPie( i ); arc.setAngleStart( currentDegrees ); arc.setAngleExtent( percentageOfPie ); //---set the color, and fill the pie piece. g2d.setPaint( pieChart2D.iPieChartDataSet.getPaint( i ) ); g2d.fill( arc ); g2d.setPaint( properties.getBorderPaint() ); g2d.draw( arc ); //---if we are going to display labels if( pieChart2D.textTagGroup != null ) { //---get the angle the center of slice double sliceCenterDegrees = (currentDegrees) + percentageOfPie / 2; if( sliceCenterDegrees > 360 ) { sliceCenterDegrees -= 360; } double sliceCenterRadians = Math.toRadians( sliceCenterDegrees ); //---compute the cos and sin of the label angle. double cosOfLabel = Math.cos( sliceCenterRadians ); double sinOfLabel = Math.sin( sliceCenterRadians ); halfDiameter = (float) (pieChart2D.diameter / 2.0); //---end point of the label border line. float borderXstart = (float) (cosOfLabel * halfDiameter); float borderYstart = (float) -(sinOfLabel * halfDiameter); //---end point of the label border line. float borderXend = (float) (cosOfLabel * (halfDiameter + properties.getTickLength())); float borderYend = (float) -(sinOfLabel * (halfDiameter + properties.getTickLength())); xPieMiddle = halfDiameter + pieChart2D.pieX; yPieMiddle = halfDiameter + pieChart2D.pieY; properties.getValueLabelFont().setupGraphics2D( g2d ); g2d.draw( new Line2D.Double( xPieMiddle + borderXstart, yPieMiddle + borderYstart, xPieMiddle + borderXend, yPieMiddle + borderYend ) ); //System.out.println( pieChart2D.textTagGroup.getTextTag( i ).getText() + " sliceCenterDegrees= " + sliceCenterDegrees ); float labelY = yPieMiddle + borderYend; if( sliceCenterDegrees > 60 && sliceCenterDegrees < 120 ) { labelY -= pieChart2D.textTagGroup.getTextTag( i ).getFontDescent(); } else if( sliceCenterDegrees > 240 && sliceCenterDegrees < 300 ) { labelY += pieChart2D.textTagGroup.getTextTag( i ).getFontAscent(); } if( sliceCenterDegrees > 90 && sliceCenterDegrees < 270 ) { g2d.drawString( pieChart2D.textTagGroup.getTextTag( i ).getText(), xPieMiddle + borderXend - pieChart2D.textTagGroup.getTextTag( i ).getWidth() - properties.getTickLength(), labelY ); } else { g2d.drawString( pieChart2D.textTagGroup.getTextTag( i ).getText(), xPieMiddle + borderXend + properties.getTickLength(), labelY ); } } //---if we are generating an image map... //---IMAGE MAP if( pieChart2D.getImageMap() != null ) { //---increment a separate amount to minimize rounding errors. double workDegrees = currentDegrees; //---get the angle the bodrder of slice. //double sliceBorderDegree = currentDegrees; //---compute the cos and sin of the bodrder angle. double cosOfBorder; double sinOfBorder; /* //---compute the cos and sin of the bodrder angle. double cosOfBorder= Math.cos( Math.toRadians( sliceBorderDegree ) ); double sinOfBorder= Math.sin( Math.toRadians( sliceBorderDegree ) ); //---end point of the slice border line. imageMapPoints[ i ][ 0 ]= xPieMiddle + (float) ( cosOfBorder * halfDiameter ) ; imageMapPoints[ i ][ 1 ]= yPieMiddle + (float) -( sinOfBorder * halfDiameter ); */ double splitDegree = percentageOfPie / subdivisions; for( int j = 0; j <= subdivisions; j++ ) { cosOfBorder = Math.cos( Math.toRadians( workDegrees ) ); sinOfBorder = Math.sin( Math.toRadians( workDegrees ) ); //---end point of the slice border line. imageMapPoints[ mapCounter ][ 0 ] = xPieMiddle + (float) (cosOfBorder * halfDiameter); imageMapPoints[ mapCounter ][ 1 ] = yPieMiddle + (float) -(sinOfBorder * halfDiameter); //DEBUG to make sure calculating points correctly //g2d.setPaint( Color.red ); //g2d.fillRect( (int) imageMapPoints[ mapCounter ][ 0 ], (int) imageMapPoints[ mapCounter ][ 1 ], 6, 6 ); mapCounter++; workDegrees += splitDegree; } } currentDegrees += percentageOfPie; } //---if we are generating an image map... //---IMAGE MAP if( pieChart2D.getImageMap() != null ) { //---each slice has 3 + subdivision slices... //int counter= pieChart2D.iPieChartDataSet.getNumberOfDataItems() * ( 3 + subdivisions ); int counter = 0; //---for each data item for( int i = 0; i < pieChart2D.iPieChartDataSet.getNumberOfDataItems(); i++ ) { int coordinateCounter = 0; //---there are three points plus some number of subdivisions... PolyMapArea polyMapArea = new PolyMapArea( 3 + subdivisions, pieChart2D.iPieChartDataSet.getValue( i ), null, pieChart2D.iPieChartDataSet.getLegendLabel( i ) ); polyMapArea.addCoordinate( coordinateCounter++, xPieMiddle, yPieMiddle ); //polyMapArea.addCoordinate( 1, imageMapPoints[ i ][ 0 ], imageMapPoints[ i ][ 1 ] ); //---include the first border point, plus the subdivisions for( int h = 0; h <= subdivisions; h++ ) { polyMapArea.addCoordinate( coordinateCounter++, imageMapPoints[ counter ][ 0 ], imageMapPoints[ counter ][ 1 ] ); counter++; } //---if this is the last slice, add the first calculated map point if( (i + 1) == pieChart2D.iPieChartDataSet.getNumberOfDataItems() ) { polyMapArea.addCoordinate( coordinateCounter, imageMapPoints[ 0 ][ 0 ], imageMapPoints[ 0 ][ 1 ] ); } //---else add the next calculated point else { //---increment counter which takes us to the first calculated point on the next slice //counter++; polyMapArea.addCoordinate( coordinateCounter, imageMapPoints[ counter ][ 0 ], imageMapPoints[ counter ][ 1 ] ); } pieChart2D.getImageMap().addImageMapArea( polyMapArea ); } } } } /********************************************************************************************** * Enables the testing routines to display the contents of this Object. Override Chart * implementation as PieCharts use AreaProperties directly rather than a child. * * @param htmlGenerator * @param imageFileName **********************************************************************************************/ public void toHTML( HTMLGenerator htmlGenerator, String imageFileName ) { if( this.getLegend() != null ) { htmlGenerator.chartTableRowStart(); this.getLegend().toHTML( htmlGenerator ); htmlGenerator.chartTableRowEnd(); } htmlGenerator.chartTableEnd(); } } jcharts-0.7.5/src/org/jCharts/properties/0000755000175000001440000000000007751071402017365 5ustar onkarusersjcharts-0.7.5/src/org/jCharts/properties/util/0000755000175000001440000000000007751071402020342 5ustar onkarusersjcharts-0.7.5/src/org/jCharts/properties/util/ChartFont.java0000644000175000001440000001156607751071402023106 0ustar onkarusers/*********************************************************************************************** * File Info: $Id: ChartFont.java,v 1.9 2003/03/09 22:42:12 nathaniel_auvil Exp $ * Copyright (C) 2002 * Author: Nathaniel G. Auvil * Contributor(s): * * Copyright 2002 (C) Nathaniel G. Auvil. All Rights Reserved. * * Redistribution and use of this software and associated documentation ("Software"), with or * without modification, are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain copyright statements and notices. * Redistributions must also contain a copy of this document. * * 2. Redistributions in binary form must reproduce the above copyright notice, this list of * conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. * * 3. The name "jCharts" or "Nathaniel G. Auvil" must not be used to endorse or promote * products derived from this Software without prior written permission of Nathaniel G. * Auvil. For written permission, please contact nathaniel_auvil@users.sourceforge.net * * 4. Products derived from this Software may not be called "jCharts" nor may "jCharts" appear * in their names without prior written permission of Nathaniel G. Auvil. jCharts is a * registered trademark of Nathaniel G. Auvil. * * 5. Due credit should be given to the jCharts Project (http://jcharts.sourceforge.net/). * * THIS SOFTWARE IS PROVIDED BY Nathaniel G. Auvil AND CONTRIBUTORS ``AS IS'' AND ANY * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL * jCharts OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE ************************************************************************************************/ package org.jCharts.properties.util; import java.awt.*; import java.awt.geom.AffineTransform; public class ChartFont extends ChartItem { public static final ChartFont DEFAULT_AXIS_TITLE = new ChartFont( new Font( "Serif", Font.BOLD, 12 ), Color.black ); public static final ChartFont DEFAULT_AXIS_VALUE = new ChartFont( new Font( "Serif", Font.PLAIN, 12 ), Color.black ); public static final ChartFont DEFAULT_AXIS_SCALE = new ChartFont( new Font( "TimesRoman", Font.PLAIN, 12 ), Color.black ); public static final ChartFont DEFAULT_PIE_VALUE = new ChartFont( new Font( "Serif", Font.PLAIN, 10 ), Color.black ); public static final ChartFont DEFAULT_CHART_TITLE= new ChartFont( new Font( "Serif", Font.BOLD, 12 ), Color.black ); public static final AffineTransform VERTICAL_ROTATION = AffineTransform.getRotateInstance( -Math.PI / 2 ); private Font font; //private boolean isAntiAliased= true; private AffineTransform affineTransform; /************************************************************************************ * * @param font * @param paint ************************************************************************************/ public ChartFont( Font font, Paint paint ) { super( paint ); this.font= font; } /********************************************************************************** * Sets the Paint and Stroke implementations on the Graphics2D Object * * @param graphics2D **********************************************************************************/ public void setupGraphics2D( Graphics2D graphics2D ) { super.setupGraphics2D( graphics2D ); graphics2D.setFont( this.font ); } /************************************************************************************** * * @return font **************************************************************************************/ public Font getFont() { return this.font; } /************************************************************************************** * * @return boolean ************************************************************************************** public boolean isAntiAliased() { return isAntiAliased; } /************************************************************************************** * * @return Font **************************************************************************************/ public Font deriveFont() { this.affineTransform= VERTICAL_ROTATION; return this.font.deriveFont( this.affineTransform ); } } jcharts-0.7.5/src/org/jCharts/properties/util/ChartItem.java0000644000175000001440000000610607751071402023070 0ustar onkarusers/*********************************************************************************************** * File Info: $Id: ChartItem.java,v 1.1 2002/11/16 19:03:24 nathaniel_auvil Exp $ * Copyright (C) 2002 * Author: Nathaniel G. Auvil * Contributor(s): * * Copyright 2002 (C) Nathaniel G. Auvil. All Rights Reserved. * * Redistribution and use of this software and associated documentation ("Software"), with or * without modification, are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain copyright statements and notices. * Redistributions must also contain a copy of this document. * * 2. Redistributions in binary form must reproduce the above copyright notice, this list of * conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. * * 3. The name "jCharts" or "Nathaniel G. Auvil" must not be used to endorse or promote * products derived from this Software without prior written permission of Nathaniel G. * Auvil. For written permission, please contact nathaniel_auvil@users.sourceforge.net * * 4. Products derived from this Software may not be called "jCharts" nor may "jCharts" appear * in their names without prior written permission of Nathaniel G. Auvil. jCharts is a * registered trademark of Nathaniel G. Auvil. * * 5. Due credit should be given to the jCharts Project (http://jcharts.sourceforge.net/). * * THIS SOFTWARE IS PROVIDED BY Nathaniel G. Auvil AND CONTRIBUTORS ``AS IS'' AND ANY * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL * jCharts OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE ************************************************************************************************/ package org.jCharts.properties.util; import java.awt.*; public abstract class ChartItem { private static final Paint DEFAULT_PAINT= Color.black; private Paint paint; public ChartItem() { this.paint= DEFAULT_PAINT; } public ChartItem( Paint paint ) { this.paint= paint; } public Paint getPaint() { return paint; } /********************************************************************************** * Sets the Paint and Stroke implementations on the Graphics2D Object * * @param graphics2D **********************************************************************************/ public void setupGraphics2D( Graphics2D graphics2D ) { graphics2D.setPaint( this.getPaint() ); } } jcharts-0.7.5/src/org/jCharts/properties/util/ChartStroke.java0000644000175000001440000001173507751071402023445 0ustar onkarusers/*********************************************************************************************** * File Info: $Id: ChartStroke.java,v 1.6 2003/03/08 23:19:33 nathaniel_auvil Exp $ * Copyright (C) 2002 * Author: Nathaniel G. Auvil * Contributor(s): * * Copyright 2002 (C) Nathaniel G. Auvil. All Rights Reserved. * * Redistribution and use of this software and associated documentation ("Software"), with or * without modification, are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain copyright statements and notices. * Redistributions must also contain a copy of this document. * * 2. Redistributions in binary form must reproduce the above copyright notice, this list of * conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. * * 3. The name "jCharts" or "Nathaniel G. Auvil" must not be used to endorse or promote * products derived from this Software without prior written permission of Nathaniel G. * Auvil. For written permission, please contact nathaniel_auvil@users.sourceforge.net * * 4. Products derived from this Software may not be called "jCharts" nor may "jCharts" appear * in their names without prior written permission of Nathaniel G. Auvil. jCharts is a * registered trademark of Nathaniel G. Auvil. * * 5. Due credit should be given to the jCharts Project (http://jcharts.sourceforge.net/). * * THIS SOFTWARE IS PROVIDED BY Nathaniel G. Auvil AND CONTRIBUTORS ``AS IS'' AND ANY * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL * jCharts OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE ************************************************************************************************/ package org.jCharts.properties.util; import java.awt.*; /********************************************************************************* * Immutable Class to simplify the use of Strokes in Charts * **********************************************************************************/ public class ChartStroke extends ChartItem { private static final Stroke DEFAULT_STROKE= new BasicStroke( 1.0f ); private static final Stroke DEFAULT_STROKE_1_5= new BasicStroke( 1.5f ); public static final ChartStroke DEFAULT_AXIS= new ChartStroke( DEFAULT_STROKE_1_5, Color.black ); public static final ChartStroke DEFAULT_GRIDLINES= new ChartStroke( DEFAULT_STROKE, Color.lightGray ); public static final ChartStroke DEFAULT_TICKS= new ChartStroke( DEFAULT_STROKE, Color.black ); public static final ChartStroke DEFAULT_ZERO_LINE= new ChartStroke( DEFAULT_STROKE, Color.darkGray ); public static final ChartStroke DEFAULT_BAR_OUTLINE= new ChartStroke( DEFAULT_STROKE, Color.black ); public static final ChartStroke DEFAULT_CHART_OUTLINE= new ChartStroke( DEFAULT_STROKE, Color.black ); public static final ChartStroke DEFAULT_LEGEND_OUTLINE= new ChartStroke( DEFAULT_STROKE, Color.black ); private Stroke stroke; /********************************************************************************* * * @param stroke * @param paint **********************************************************************************/ public ChartStroke( Stroke stroke, Paint paint ) { super( paint ); this.stroke=stroke; } /********************************************************************************** * Sets the Paint and Stroke implementations on the Graphics2D Object * * @param graphics2D **********************************************************************************/ public void setupGraphics2D( Graphics2D graphics2D ) { super.setupGraphics2D( graphics2D ); graphics2D.setStroke( this.stroke ); } /********************************************************************************* * * @param graphics2D * @param shape ********************************************************************************/ public void draw( Graphics2D graphics2D, Shape shape ) { this.setupGraphics2D( graphics2D ); graphics2D.draw( shape ); } /********************************************************************************* * * @param graphics2D * @param shape ********************************************************************************/ public void fill( Graphics2D graphics2D, Shape shape ) { this.setupGraphics2D( graphics2D ); graphics2D.fill( shape ); } } jcharts-0.7.5/src/org/jCharts/properties/AreaChartProperties.java0000644000175000001440000000674407751071402024152 0ustar onkarusers/*********************************************************************************************** * File Info: $Id: AreaChartProperties.java,v 1.4 2003/02/17 02:51:18 nathaniel_auvil Exp $ * Copyright (C) 2002 * Author: Nathaniel G. Auvil * Contributor(s): * * Copyright 2002 (C) Nathaniel G. Auvil. All Rights Reserved. * * Redistribution and use of this software and associated documentation ("Software"), with or * without modification, are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain copyright statements and notices. * Redistributions must also contain a copy of this document. * * 2. Redistributions in binary form must reproduce the above copyright notice, this list of * conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. * * 3. The name "jCharts" or "Nathaniel G. Auvil" must not be used to endorse or promote * products derived from this Software without prior written permission of Nathaniel G. * Auvil. For written permission, please contact nathaniel_auvil@users.sourceforge.net * * 4. Products derived from this Software may not be called "jCharts" nor may "jCharts" appear * in their names without prior written permission of Nathaniel G. Auvil. jCharts is a * registered trademark of Nathaniel G. Auvil. * * 5. Due credit should be given to the jCharts Project (http://jcharts.sourceforge.net/). * * THIS SOFTWARE IS PROVIDED BY Nathaniel G. Auvil AND CONTRIBUTORS ``AS IS'' AND ANY * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL * jCharts OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE ************************************************************************************************/ package org.jCharts.properties; import org.jCharts.chartData.interfaces.IAxisPlotDataSet; import org.jCharts.test.HTMLGenerator; public class AreaChartProperties extends AxisChartTypeProperties { /****************************************************************************************** * Validates the properties. * * @param iAxisPlotDataSet * @throws PropertyException *****************************************************************************************/ public void validate( IAxisPlotDataSet iAxisPlotDataSet ) throws PropertyException { } /********************************************************************************************* * Enables the testing routines to display the contents of this Object. * * @param htmlGenerator **********************************************************************************************/ public void toHTML( HTMLGenerator htmlGenerator ) { htmlGenerator.propertiesTableStart( "AreaChartProperties" ); //htmlGenerator.addTableRow( "Zero Degree Offset", Double.toString( this.getZeroDegreeOffset() ) ); htmlGenerator.propertiesTableEnd(); } } jcharts-0.7.5/src/org/jCharts/properties/AreaProperties.java0000644000175000001440000001175407751071402023165 0ustar onkarusers package org.jCharts.properties; /*********************************************************************************************** * File Info: $Id: AreaProperties.java,v 1.4 2003/03/08 23:19:33 nathaniel_auvil Exp $ * Copyright (C) 2002 * Author: Nathaniel G. Auvil * Contributor(s): * * Copyright 2002 (C) Nathaniel G. Auvil. All Rights Reserved. * * Redistribution and use of this software and associated documentation ("Software"), with or * without modification, are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain copyright statements and notices. * Redistributions must also contain a copy of this document. * * 2. Redistributions in binary form must reproduce the above copyright notice, this list of * conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. * * 3. The name "jCharts" or "Nathaniel G. Auvil" must not be used to endorse or promote * products derived from this Software without prior written permission of Nathaniel G. * Auvil. For written permission, please contact nathaniel_auvil@users.sourceforge.net * * 4. Products derived from this Software may not be called "jCharts" nor may "jCharts" appear * in their names without prior written permission of Nathaniel G. Auvil. jCharts is a * registered trademark of Nathaniel G. Auvil. * * 5. Due credit should be given to the jCharts Project (http://jcharts.sourceforge.net/). * * THIS SOFTWARE IS PROVIDED BY Nathaniel G. Auvil AND CONTRIBUTORS ``AS IS'' AND ANY * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL * jCharts OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE ************************************************************************************************/ import org.jCharts.test.HTMLGenerator; import org.jCharts.test.HTMLTestable; import org.jCharts.properties.util.ChartStroke; import java.awt.*; public class AreaProperties extends Properties implements HTMLTestable { //---padding on all edges of image private float edgePadding = 5; private ChartStroke borderStroke = null; /********************************************************************************************* * * **********************************************************************************************/ public AreaProperties() { super(); } /********************************************************************************************* * Returns the number of pixels to pad the edges of the image * * @return float **********************************************************************************************/ public float getEdgePadding() { return this.edgePadding; } /********************************************************************************************* * Sets the number of pixels to pad the edges of the image * * @param edgePadding **********************************************************************************************/ public void setEdgePadding( float edgePadding ) { this.edgePadding = edgePadding; } /********************************************************************************************* * Sets the border Stroke. If NULL is passed, there will be no border. * * @param chartStroke **********************************************************************************************/ public void setBorderStroke( ChartStroke chartStroke ) { this.borderStroke = chartStroke; } /********************************************************************************************* * Returns the border Stroke * * @return ChartStroke **********************************************************************************************/ public ChartStroke getBorderStroke() { return this.borderStroke; } /********************************************************************************************* * Enables the testing routines to display the contents of this Object. * * @param htmlGenerator **********************************************************************************************/ public void toHTML( HTMLGenerator htmlGenerator ) { super.toHTML( htmlGenerator ); htmlGenerator.addTableRow( "AreaProperties->Edge Padding", Float.toString( this.getEdgePadding() ) ); htmlGenerator.addTableRow( "AreaProperties->Border Stroke", this.borderStroke ); } } jcharts-0.7.5/src/org/jCharts/properties/AxisChartTypeProperties.java0000644000175000001440000001314407751071402025040 0ustar onkarusers/*********************************************************************************************** * File Info: $Id: AxisChartTypeProperties.java,v 1.2 2003/03/02 21:48:10 nathaniel_auvil Exp $ * Copyright (C) 2002 * Author: Nathaniel G. Auvil * Contributor(s): * * Copyright 2002 (C) Nathaniel G. Auvil. All Rights Reserved. * * Redistribution and use of this software and associated documentation ("Software"), with or * without modification, are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain copyright statements and notices. * Redistributions must also contain a copy of this document. * * 2. Redistributions in binary form must reproduce the above copyright notice, this list of * conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. * * 3. The name "jCharts" or "Nathaniel G. Auvil" must not be used to endorse or promote * products derived from this Software without prior written permission of Nathaniel G. * Auvil. For written permission, please contact nathaniel_auvil@users.sourceforge.net * * 4. Products derived from this Software may not be called "jCharts" nor may "jCharts" appear * in their names without prior written permission of Nathaniel G. Auvil. jCharts is a * registered trademark of Nathaniel G. Auvil. * * 5. Due credit should be given to the jCharts Project (http://jcharts.sourceforge.net/). * * THIS SOFTWARE IS PROVIDED BY Nathaniel G. Auvil AND CONTRIBUTORS ``AS IS'' AND ANY * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL * jCharts OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE ************************************************************************************************/ package org.jCharts.properties; import org.jCharts.test.HTMLTestable; import org.jCharts.chartData.interfaces.IAxisPlotDataSet; import org.jCharts.axisChart.customRenderers.axisValue.*; import java.util.ArrayList; /******************************************************************************************** * Common parent for all Chart type specific properties Objects. * * *******************************************************************************************/ public abstract class AxisChartTypeProperties extends ChartTypeProperties implements HTMLTestable { private ArrayList preRenderEventListeners; private ArrayList postRenderEventListeners; public abstract void validate( IAxisPlotDataSet iAxisPlotDataSet ) throws PropertyException; /************************************************************************************** * Allows you to get callbacks for custom implementations to render on the axis and to * control the renderering on the axis before a value is drawn. * * @param preRenderListener *************************************************************************************/ public void addPreRenderEventListener( PreAxisValueRenderListener preRenderListener ) { if( this.preRenderEventListeners == null ) { this.preRenderEventListeners = new ArrayList(); } this.preRenderEventListeners.add( preRenderListener ); } /************************************************************************************** * * @param axisValueRenderEvent *************************************************************************************/ public void firePreRender( AxisValueRenderEvent axisValueRenderEvent ) { if( this.preRenderEventListeners != null ) { PreAxisValueRenderListener preRenderListener; for( int i = 0; i < this.preRenderEventListeners.size(); i++ ) { preRenderListener = (PreAxisValueRenderListener) this.preRenderEventListeners.get( i ); preRenderListener.preRender( axisValueRenderEvent ); } } } /************************************************************************************** * Allows you to get callbacks for custom implementations to render on the axis and to * control the renderering on the axis after a value is drawn. * * @param postRenderListener *************************************************************************************/ public void addPostRenderEventListener( PostAxisValueRenderListener postRenderListener ) { if( this.postRenderEventListeners == null ) { this.postRenderEventListeners = new ArrayList(); } this.postRenderEventListeners.add( postRenderListener ); } /************************************************************************************** * * @param axisValueRenderEvent *************************************************************************************/ public void firePostRender( AxisValueRenderEvent axisValueRenderEvent ) { if( this.postRenderEventListeners != null ) { PostAxisValueRenderListener postRenderListener; for( int i = 0; i < this.postRenderEventListeners.size(); i++ ) { postRenderListener = (PostAxisValueRenderListener) this.postRenderEventListeners.get( i ); postRenderListener.postRender( axisValueRenderEvent ); } } } } jcharts-0.7.5/src/org/jCharts/properties/AxisProperties.java0000644000175000001440000001326607751071402023221 0ustar onkarusers/*********************************************************************************************** * File Info: $Id: AxisProperties.java,v 1.17 2003/03/02 21:48:10 nathaniel_auvil Exp $ * Copyright (C) 2002 * Author: Nathaniel G. Auvil * Contributor(s): * * Copyright 2002 (C) Nathaniel G. Auvil. All Rights Reserved. * * Redistribution and use of this software and associated documentation ("Software"), with or * without modification, are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain copyright statements and notices. * Redistributions must also contain a copy of this document. * * 2. Redistributions in binary form must reproduce the above copyright notice, this list of * conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. * * 3. The name "jCharts" or "Nathaniel G. Auvil" must not be used to endorse or promote * products derived from this Software without prior written permission of Nathaniel G. * Auvil. For written permission, please contact nathaniel_auvil@users.sourceforge.net * * 4. Products derived from this Software may not be called "jCharts" nor may "jCharts" appear * in their names without prior written permission of Nathaniel G. Auvil. jCharts is a * registered trademark of Nathaniel G. Auvil. * * 5. Due credit should be given to the jCharts Project (http://jcharts.sourceforge.net/). * * THIS SOFTWARE IS PROVIDED BY Nathaniel G. Auvil AND CONTRIBUTORS ``AS IS'' AND ANY * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL * jCharts OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE ************************************************************************************************/ package org.jCharts.properties; import org.jCharts.test.HTMLGenerator; import org.jCharts.test.HTMLTestable; import java.lang.reflect.Field; final public class AxisProperties extends Properties implements HTMLTestable { private AxisTypeProperties xAxisProperties; private AxisTypeProperties yAxisProperties; private boolean isPlotHorizontal= false; private boolean xAxisLabelsAreVertical= false; /*********************************************************************************************** * * @param xAxis * @param yAxis ************************************************************************************************/ public AxisProperties( LabelAxisProperties xAxis, LabelAxisProperties yAxis ) { this.xAxisProperties= xAxis; this.yAxisProperties= yAxis; } /*********************************************************************************************** * * @param isHorizontalPlot ************************************************************************************************/ public AxisProperties( boolean isHorizontalPlot ) { super(); this.isPlotHorizontal= isHorizontalPlot; if( isHorizontalPlot ) { this.xAxisProperties= new DataAxisProperties(); this.yAxisProperties= new LabelAxisProperties(); } else { this.xAxisProperties= new LabelAxisProperties(); this.yAxisProperties= new DataAxisProperties(); } } /*********************************************************************************************** * ************************************************************************************************/ public AxisProperties() { super(); this.isPlotHorizontal= false; this.xAxisProperties= new LabelAxisProperties(); this.yAxisProperties= new DataAxisProperties(); } public AxisTypeProperties getXAxisProperties() { return xAxisProperties; } public AxisTypeProperties getYAxisProperties() { return yAxisProperties; } public boolean isPlotHorizontal() { return isPlotHorizontal; } public boolean xAxisLabelsAreVertical() { return xAxisLabelsAreVertical; } public void setXAxisLabelsAreVertical( boolean xAxisLabelsAreVertical ) { this.xAxisLabelsAreVertical = xAxisLabelsAreVertical; } /********************************************************************************************* * Enables the testing routines to display the contents of this Object. * * @param htmlGenerator **********************************************************************************************/ public void toHTML( HTMLGenerator htmlGenerator ) { htmlGenerator.propertiesTableStart( this.getClass().getName() ); super.toHTML( htmlGenerator ); Field[] fields = this.getClass().getDeclaredFields(); for( int i = 0; i < fields.length; i++ ) { try { htmlGenerator.addField( fields[ i ].getName(), fields[ i ].get( this ) ); } catch( IllegalAccessException illegalAccessException ) { illegalAccessException.printStackTrace(); } } htmlGenerator.innerTableRowStart(); this.xAxisProperties.toHTML( htmlGenerator ); htmlGenerator.innerTableRowEnd(); htmlGenerator.innerTableRowStart(); this.yAxisProperties.toHTML( htmlGenerator ); htmlGenerator.innerTableRowEnd(); htmlGenerator.propertiesTableEnd(); } } jcharts-0.7.5/src/org/jCharts/properties/AxisTypeProperties.java0000644000175000001440000002040007751071402024047 0ustar onkarusers/*********************************************************************************************** * File Info: $Id: AxisTypeProperties.java,v 1.9 2003/03/05 23:36:30 nathaniel_auvil Exp $ * Copyright (C) 2002 * Author: Nathaniel G. Auvil * Contributor(s): John Thomson * * Copyright 2002 (C) Nathaniel G. Auvil. All Rights Reserved. * * Redistribution and use of this software and associated documentation ("Software"), with or * without modification, are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain copyright statements and notices. * Redistributions must also contain a copy of this document. * * 2. Redistributions in binary form must reproduce the above copyright notice, this list of * conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. * * 3. The name "jCharts" or "Nathaniel G. Auvil" must not be used to endorse or promote * products derived from this Software without prior written permission of Nathaniel G. * Auvil. For written permission, please contact nathaniel_auvil@users.sourceforge.net * * 4. Products derived from this Software may not be called "jCharts" nor may "jCharts" appear * in their names without prior written permission of Nathaniel G. Auvil. jCharts is a * registered trademark of Nathaniel G. Auvil. * * 5. Due credit should be given to the jCharts Project (http://jcharts.sourceforge.net/). * * THIS SOFTWARE IS PROVIDED BY Nathaniel G. Auvil AND CONTRIBUTORS ``AS IS'' AND ANY * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL * jCharts OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE ************************************************************************************************/ package org.jCharts.properties; import org.jCharts.properties.util.ChartFont; import org.jCharts.properties.util.ChartStroke; import org.jCharts.test.HTMLGenerator; import org.jCharts.test.HTMLTestable; import java.lang.reflect.Field; public class AxisTypeProperties extends Properties implements HTMLTestable { public static final int TICKS_NONE = 0; public static final int TICKS_ALL = 1; public static final int TICKS_ONLY_WITH_LABELS = 2; public static final int GRID_LINES_NONE = 0; public static final int GRID_LINES_ALL = 1; public static final int GRID_LINES_ONLY_WITH_LABELS = 2; private int showTicks = TICKS_ALL; private ChartStroke tickChartStroke= ChartStroke.DEFAULT_TICKS; private int showGridLines = GRID_LINES_NONE; private ChartStroke gridLineChartStroke= ChartStroke.DEFAULT_GRIDLINES; private ChartFont scaleChartFont = ChartFont.DEFAULT_AXIS_SCALE; private ChartFont axisTitleChartFont= ChartFont.DEFAULT_AXIS_TITLE; private ChartStroke axisStroke = ChartStroke.DEFAULT_AXIS; private float paddingBetweenAxisTitleAndLabels = 25.0f; private float axisTickMarkPixelLength = 3.0f; //---number of pixels between axis values and tick marks. private float paddingBetweenLabelsAndTicks = 3.0f; //---number of pixels between axis values and the axis if no ticks are shown. private float paddingBetweenAxisAndLabels = 3.0f; //---number of pixels between axis values. private float paddingBetweenAxisLabels = 5.0f; private boolean showEndBorder = true; private boolean showAxisLabels= true; private ChartFont titleChartFont= ChartFont.DEFAULT_AXIS_TITLE; /*********************************************************************************************** * ************************************************************************************************/ public AxisTypeProperties() { super(); } public ChartFont getTitleChartFont() { return titleChartFont; } public void setTitleChartFont( ChartFont titleChartFont ) { this.titleChartFont = titleChartFont; } public boolean showAxisLabels() { return showAxisLabels; } public void setShowAxisLabels( boolean showAxisLabels ) { this.showAxisLabels = showAxisLabels; } public int getShowTicks() { return showTicks; } public void setShowTicks( int showTicks ) { this.showTicks = showTicks; } public ChartStroke getTickChartStroke() { return this.tickChartStroke; } public void setTickChartStroke( ChartStroke tickChartStroke ) { this.tickChartStroke = tickChartStroke; } public int getShowGridLines() { return showGridLines; } public void setShowGridLines( int showGridLines ) { this.showGridLines = showGridLines; } public ChartStroke getGridLineChartStroke() { return this.gridLineChartStroke; } public void setGridLineChartStroke( ChartStroke gridLineChartStroke ) { this.gridLineChartStroke = gridLineChartStroke; } public float getPaddingBetweenAxisTitleAndLabels() { return paddingBetweenAxisTitleAndLabels; } public void setPaddingBetweenAxisTitleAndLabels( float paddingBetweenAxisTitleAndLabels ) { this.paddingBetweenAxisTitleAndLabels = paddingBetweenAxisTitleAndLabels; } public float getAxisTickMarkPixelLength() { return axisTickMarkPixelLength; } public void setAxisTickMarkPixelLength( float axisTickMarkPixelLength ) { this.axisTickMarkPixelLength = axisTickMarkPixelLength; } public float getPaddingBetweenLabelsAndTicks() { return paddingBetweenLabelsAndTicks; } public void setPaddingBetweenLabelsAndTicks( float paddingBetweenLabelsAndTicks ) { this.paddingBetweenLabelsAndTicks = paddingBetweenLabelsAndTicks; } public float getPaddingBetweenAxisAndLabels() { return paddingBetweenAxisAndLabels; } public void setPaddingBetweenAxisAndLabels( float paddingBetweenAxisAndLabels ) { this.paddingBetweenAxisAndLabels = paddingBetweenAxisAndLabels; } public ChartStroke getAxisStroke() { return axisStroke; } public void setAxisStroke( ChartStroke axisStroke ) { this.axisStroke = axisStroke; } public ChartFont getScaleChartFont() { return scaleChartFont; } public void setScaleChartFont( ChartFont scaleChartFont ) { this.scaleChartFont = scaleChartFont; } public ChartFont getAxisTitleChartFont() { return axisTitleChartFont; } public void setAxisTitleChartFont( ChartFont axisTitleChartFont ) { this.axisTitleChartFont = axisTitleChartFont; } public boolean getShowEndBorder() { return this.showEndBorder; } public void setShowEndBorder( boolean showEndBorder ) { this.showEndBorder = showEndBorder; } public float getPaddingBetweenAxisLabels() { return this.paddingBetweenAxisLabels; } public void setPaddingBetweenXAxisLabels( float paddingBetweenAxisLabels ) { this.paddingBetweenAxisLabels = paddingBetweenAxisLabels; } /********************************************************************************************* * Enables the testing routines to display the contents of this Object. * * @param htmlGenerator **********************************************************************************************/ public void toHTML( HTMLGenerator htmlGenerator ) { htmlGenerator.propertiesTableStart( AxisTypeProperties.class.getName() ); super.toHTML( htmlGenerator ); Field[] fields = this.getClass().getDeclaredFields(); for( int i = 0; i < fields.length; i++ ) { try { htmlGenerator.addField( fields[ i ].getName(), fields[ i ].get( this ) ); } catch( IllegalAccessException illegalAccessException ) { System.out.println( "can not access field: " + fields[i].getName() ); //illegalAccessException.printStackTrace(); } } htmlGenerator.propertiesTableEnd(); } } jcharts-0.7.5/src/org/jCharts/properties/BarChartProperties.java0000644000175000001440000001134507751071402023777 0ustar onkarusers/*********************************************************************************************** * File Info: $Id: BarChartProperties.java,v 1.9 2003/04/19 00:31:01 nathaniel_auvil Exp $ * Copyright (C) 2002 * Author: Nathaniel G. Auvil * Contributor(s): * * Copyright 2002 (C) Nathaniel G. Auvil. All Rights Reserved. * * Redistribution and use of this software and associated documentation ("Software"), with or * without modification, are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain copyright statements and notices. * Redistributions must also contain a copy of this document. * * 2. Redistributions in binary form must reproduce the above copyright notice, this list of * conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. * * 3. The name "jCharts" or "Nathaniel G. Auvil" must not be used to endorse or promote * products derived from this Software without prior written permission of Nathaniel G. * Auvil. For written permission, please contact nathaniel_auvil@users.sourceforge.net * * 4. Products derived from this Software may not be called "jCharts" nor may "jCharts" appear * in their names without prior written permission of Nathaniel G. Auvil. jCharts is a * registered trademark of Nathaniel G. Auvil. * * 5. Due credit should be given to the jCharts Project (http://jcharts.sourceforge.net/). * * THIS SOFTWARE IS PROVIDED BY Nathaniel G. Auvil AND CONTRIBUTORS ``AS IS'' AND ANY * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL * jCharts OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE ************************************************************************************************/ package org.jCharts.properties; import org.jCharts.chartData.interfaces.IAxisPlotDataSet; import org.jCharts.properties.util.ChartStroke; import org.jCharts.test.HTMLGenerator; public class BarChartProperties extends AxisChartTypeProperties { //---percentage of axis width bar should fill private float widthPercentage = 0.85f; private boolean showOutlines = true; private ChartStroke barOutlineStroke = ChartStroke.DEFAULT_BAR_OUTLINE; /********************************************************************************************** * Constructor * ***********************************************************************************************/ public BarChartProperties() { super(); } public void setShowOutlinesFlag( boolean showOutlines ) { this.showOutlines = showOutlines; } public boolean getShowOutlinesFlag() { return this.showOutlines; } public void setWidthPercentage( float widthPercentage ) { this.widthPercentage = widthPercentage; } public float getPercentage() { return this.widthPercentage; } public ChartStroke getBarOutlineStroke() { return barOutlineStroke; } public void setBarOutlineStroke( ChartStroke barOutlineStroke ) { this.barOutlineStroke = barOutlineStroke; } /********************************************************************************************* * Enables the testing routines to display the contents of this Object. * * @param htmlGenerator **********************************************************************************************/ public void toHTML( HTMLGenerator htmlGenerator ) { htmlGenerator.addTableRow( "Width Percentage", Float.toString( this.widthPercentage ) ); htmlGenerator.addTableRow( "Show Outlines", new Boolean( this.showOutlines ) ); htmlGenerator.addTableRow( "Bar Outline", this.barOutlineStroke ); } /****************************************************************************************** * Validates the properties. * * @param iAxisPlotDataSet * @throws PropertyException *****************************************************************************************/ public void validate( IAxisPlotDataSet iAxisPlotDataSet ) throws PropertyException { //AxisChart axisChart= (AxisChart) chart; //IAxisPlotDataSet iAxisPlotDataSet= axisChart.getIDataSeries().getIAxisPlotDataSet( ChartType.LINE ); } } jcharts-0.7.5/src/org/jCharts/properties/ChartProperties.java0000644000175000001440000001336107751071402023352 0ustar onkarusers/*********************************************************************************************** * File Info: $Id: ChartProperties.java,v 1.8 2003/03/09 14:42:59 nathaniel_auvil Exp $ * Copyright (C) 2002 * Author: Nathaniel G. Auvil * Contributor(s): * * Copyright 2002 (C) Nathaniel G. Auvil. All Rights Reserved. * * Redistribution and use of this software and associated documentation ("Software"), with or * without modification, are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain copyright statements and notices. * Redistributions must also contain a copy of this document. * * 2. Redistributions in binary form must reproduce the above copyright notice, this list of * conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. * * 3. The name "jCharts" or "Nathaniel G. Auvil" must not be used to endorse or promote * products derived from this Software without prior written permission of Nathaniel G. * Auvil. For written permission, please contact nathaniel_auvil@users.sourceforge.net * * 4. Products derived from this Software may not be called "jCharts" nor may "jCharts" appear * in their names without prior written permission of Nathaniel G. Auvil. jCharts is a * registered trademark of Nathaniel G. Auvil. * * 5. Due credit should be given to the jCharts Project (http://jcharts.sourceforge.net/). * * THIS SOFTWARE IS PROVIDED BY Nathaniel G. Auvil AND CONTRIBUTORS ``AS IS'' AND ANY * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL * jCharts OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE ************************************************************************************************/ package org.jCharts.properties; import org.jCharts.properties.util.ChartFont; import org.jCharts.test.HTMLGenerator; import org.jCharts.test.HTMLTestable; import java.lang.reflect.Field; public class ChartProperties extends AreaProperties implements HTMLTestable { public ChartFont titleChartFont = ChartFont.DEFAULT_CHART_TITLE; //---number of pixels between the chart title and the plotted chart private float titlePadding = 5f; //---flag allows you to toggle validations to spare extra CPU cycles after development is over. private boolean validate = true; /****************************************************************************************** * * @return ChartFont ******************************************************************************************/ public ChartFont getTitleFont() { return this.titleChartFont; } public void setTitleFont( ChartFont titleFont ) { this.titleChartFont = titleFont; } /****************************************************************************************** * Returns the number of pixels between the Chart Title and the axis plot area * * @return float ******************************************************************************************/ public float getTitlePadding() { return this.titlePadding; } public void setTitlePadding( float pixels ) { this.titlePadding = pixels; } /****************************************************************************************** * * @return boolean * @since 0.7.0 ******************************************************************************************/ public boolean validate() { return validate; } /****************************************************************************************** * Toggles the validation of data and properties for the charts. This should be false for * production systems as it will run slightly faster. Anything for speed, right? ;) * * @param validate * @since 0.7.0 ******************************************************************************************/ public void setValidate( boolean validate ) { this.validate = validate; } /********************************************************************************************* * Enables the testing routines to display the contents of this Object. * * @param htmlGenerator **********************************************************************************************/ public void toHTML( HTMLGenerator htmlGenerator ) { htmlGenerator.propertiesTableStart( this.getClass().getName() ); super.toHTML( htmlGenerator ); Field[] fields = this.getClass().getDeclaredFields(); for( int i = 0; i < fields.length; i++ ) { try { htmlGenerator.addField( fields[ i ].getName(), fields[ i ].get( this ) ); } catch( IllegalAccessException illegalAccessException ) { illegalAccessException.printStackTrace(); } } htmlGenerator.propertiesTableEnd(); /* super.toHTML( htmlGenerator ); htmlGenerator.addTableRow( "ChartProperties-Title Padding", Float.toString( this.getTitlePadding() ) ); htmlGenerator.addTableRow( "ChartProperties-Title Font", this.getTitleFont() ); htmlGenerator.addTableRow( "ChartProperties-Title Paint", this.getTitlePaint() ); htmlGenerator.addTableRow( "ChartProperties-Title Paint", this.getTitlePaint() ); */ } } jcharts-0.7.5/src/org/jCharts/properties/ChartTypeProperties.java0000644000175000001440000000571407751071402024217 0ustar onkarusers/*********************************************************************************************** * File Info: $Id: ChartTypeProperties.java,v 1.7 2003/03/05 23:36:30 nathaniel_auvil Exp $ * Copyright (C) 2002 * Author: Nathaniel G. Auvil * Contributor(s): * * Copyright 2002 (C) Nathaniel G. Auvil. All Rights Reserved. * * Redistribution and use of this software and associated documentation ("Software"), with or * without modification, are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain copyright statements and notices. * Redistributions must also contain a copy of this document. * * 2. Redistributions in binary form must reproduce the above copyright notice, this list of * conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. * * 3. The name "jCharts" or "Nathaniel G. Auvil" must not be used to endorse or promote * products derived from this Software without prior written permission of Nathaniel G. * Auvil. For written permission, please contact nathaniel_auvil@users.sourceforge.net * * 4. Products derived from this Software may not be called "jCharts" nor may "jCharts" appear * in their names without prior written permission of Nathaniel G. Auvil. jCharts is a * registered trademark of Nathaniel G. Auvil. * * 5. Due credit should be given to the jCharts Project (http://jcharts.sourceforge.net/). * * THIS SOFTWARE IS PROVIDED BY Nathaniel G. Auvil AND CONTRIBUTORS ``AS IS'' AND ANY * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL * jCharts OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE ************************************************************************************************/ package org.jCharts.properties; import org.jCharts.test.HTMLTestable; /******************************************************************************************** * Common parent for all Chart type specific properties Objects. * *******************************************************************************************/ public abstract class ChartTypeProperties implements HTMLTestable { /* private boolean isAntiAliased= true; public boolean isAntiAliased() { return isAntiAliased; } public void setAntiAliased( boolean antiAliased ) { isAntiAliased = antiAliased; } */ } jcharts-0.7.5/src/org/jCharts/properties/ClusteredBarChartProperties.java0000644000175000001440000000473207751071402025654 0ustar onkarusers/*********************************************************************************************** * File Info: $Id: ClusteredBarChartProperties.java,v 1.3 2002/10/22 01:21:18 nathaniel_auvil Exp $ * Copyright (C) 2002 * Author: Nathaniel G. Auvil * Contributor(s): * * Copyright 2002 (C) Nathaniel G. Auvil. All Rights Reserved. * * Redistribution and use of this software and associated documentation ("Software"), with or * without modification, are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain copyright statements and notices. * Redistributions must also contain a copy of this document. * * 2. Redistributions in binary form must reproduce the above copyright notice, this list of * conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. * * 3. The name "jCharts" or "Nathaniel G. Auvil" must not be used to endorse or promote * products derived from this Software without prior written permission of Nathaniel G. * Auvil. For written permission, please contact nathaniel_auvil@users.sourceforge.net * * 4. Products derived from this Software may not be called "jCharts" nor may "jCharts" appear * in their names without prior written permission of Nathaniel G. Auvil. jCharts is a * registered trademark of Nathaniel G. Auvil. * * 5. Due credit should be given to the jCharts Project (http://jcharts.sourceforge.net/). * * THIS SOFTWARE IS PROVIDED BY Nathaniel G. Auvil AND CONTRIBUTORS ``AS IS'' AND ANY * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL * jCharts OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE ************************************************************************************************/ package org.jCharts.properties; final public class ClusteredBarChartProperties extends BarChartProperties { } jcharts-0.7.5/src/org/jCharts/properties/DataAxisProperties.java0000644000175000001440000001631607751071402024012 0ustar onkarusers/*********************************************************************************************** * File Info: $Id: DataAxisProperties.java,v 1.5 2003/02/11 03:18:19 nathaniel_auvil Exp $ * Copyright (C) 2002 * Author: John Thomson, Nathaniel G. Auvil * Contributor(s): * * Copyright 2002 (C) Nathaniel G. Auvil. All Rights Reserved. * * Redistribution and use of this software and associated documentation ("Software"), with or * without modification, are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain copyright statements and notices. * Redistributions must also contain a copy of this document. * * 2. Redistributions in binary form must reproduce the above copyright notice, this list of * conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. * * 3. The name "jCharts" or "Nathaniel G. Auvil" must not be used to endorse or promote * products derived from this Software without prior written permission of Nathaniel G. * Auvil. For written permission, please contact nathaniel_auvil@users.sourceforge.net * * 4. Products derived from this Software may not be called "jCharts" nor may "jCharts" appear * in their names without prior written permission of Nathaniel G. Auvil. jCharts is a * registered trademark of Nathaniel G. Auvil. * * 5. Due credit should be given to the jCharts Project (http://jcharts.sourceforge.net/). * * THIS SOFTWARE IS PROVIDED BY Nathaniel G. Auvil AND CONTRIBUTORS ``AS IS'' AND ANY * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL * jCharts OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE ************************************************************************************************/ package org.jCharts.properties; import org.jCharts.test.HTMLGenerator; import org.jCharts.test.HTMLTestable; import org.jCharts.properties.util.ChartStroke; import org.jCharts.axisChart.axis.scale.ScaleCalculator; import java.lang.reflect.Field; public final class DataAxisProperties extends LabelAxisProperties implements HTMLTestable { //---round to nearest power of ten. 2==100, -3=.001 private int roundToNearest = 0; private boolean showZeroLine = true; private ChartStroke zeroLineChartStroke= ChartStroke.DEFAULT_ZERO_LINE; //---user defined scale private boolean userDefinedScale = false; private double userDefinedMinimumValue; private double userDefinedIncrement; //---number of items visible on the axis private int numItems = 5; private boolean useDollarSigns = false; private boolean useCommas = true; private boolean usePercentSigns = false; //---holds data relevant to values displayed on the axis. may be null private ScaleCalculator scaleCalculator; /*********************************************************************************************** * ************************************************************************************************/ public DataAxisProperties() { super(); } /**************************************************************************************** * * @param axisMinimum * @param axisIncrement * @throws PropertyException **************************************************************************************/ public void setUserDefinedScale( double axisMinimum, double axisIncrement ) throws PropertyException { if( axisIncrement <= 0 ) { throw new PropertyException( "The Axis Increment can not be a negative value or zero." ); } this.userDefinedScale = true; this.userDefinedMinimumValue = axisMinimum; this.userDefinedIncrement = axisIncrement; } public int getRoundToNearest() { return roundToNearest; } public void setRoundToNearest( int roundToNearest ) { this.roundToNearest = roundToNearest; } public boolean showZeroLine() { return showZeroLine; } public void setShowZeroLine( boolean showZeroLine ) { this.showZeroLine = showZeroLine; } public ChartStroke getZeroLineChartStroke() { return this.zeroLineChartStroke; } public void setZeroLineChartStroke( ChartStroke zeroLine ) { this.zeroLineChartStroke = zeroLine; } public boolean hasUserDefinedScale() { return userDefinedScale; } public double getUserDefinedMinimumValue() { return this.userDefinedMinimumValue; } public double getUserDefinedIncrement() { return this.userDefinedIncrement; } public int getNumItems() { return numItems; } public void setNumItems( int numItems ) { this.numItems = numItems; } public boolean useDollarSigns() { return useDollarSigns; } public void setUseDollarSigns( boolean useDollarSigns ) { this.useDollarSigns = useDollarSigns; } public boolean useCommas() { return useCommas; } public void setUseCommas( boolean useCommas ) { this.useCommas = useCommas; } public boolean usePercentSigns() { return usePercentSigns; } public void setUsePercentSigns( boolean usePercentSigns ) { this.usePercentSigns = usePercentSigns; } public ScaleCalculator getScaleCalculator() { return scaleCalculator; } /****************************************************************************************** * You do not have to explicitly set a ScaleCalculator implementation as jCharts will * create one, but if you do not like the way Scale ranges are created, you could * create your own implementation of ScaleCalculator and jCharts will use it! * * @param scaleCalculator ******************************************************************************************/ public void setScaleCalculator( ScaleCalculator scaleCalculator ) { this.scaleCalculator = scaleCalculator; } /********************************************************************************************* * Enables the testing routines to display the contents of this Object. * * @param htmlGenerator **********************************************************************************************/ public void toHTML( HTMLGenerator htmlGenerator ) { htmlGenerator.propertiesTableStart( DataAxisProperties.class.getName() ); //super.toHTML( htmlGenerator ); Field[] fields = this.getClass().getDeclaredFields(); for( int i = 0; i < fields.length; i++ ) { try { htmlGenerator.addField( fields[ i ].getName(), fields[ i ].get( this ) ); } catch( IllegalAccessException illegalAccessException ) { illegalAccessException.printStackTrace(); } } htmlGenerator.propertiesTableEnd(); } } jcharts-0.7.5/src/org/jCharts/properties/LabelAxisProperties.java0000644000175000001440000000736307751071402024162 0ustar onkarusers/*********************************************************************************************** * File Info: $Id: LabelAxisProperties.java,v 1.2 2003/01/30 01:59:08 nathaniel_auvil Exp $ * Copyright (C) 2002 * Author: Nathaniel G. Auvil * Contributor(s): John Thomson * * Copyright 2002 (C) Nathaniel G. Auvil. All Rights Reserved. * * Redistribution and use of this software and associated documentation ("Software"), with or * without modification, are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain copyright statements and notices. * Redistributions must also contain a copy of this document. * * 2. Redistributions in binary form must reproduce the above copyright notice, this list of * conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. * * 3. The name "jCharts" or "Nathaniel G. Auvil" must not be used to endorse or promote * products derived from this Software without prior written permission of Nathaniel G. * Auvil. For written permission, please contact nathaniel_auvil@users.sourceforge.net * * 4. Products derived from this Software may not be called "jCharts" nor may "jCharts" appear * in their names without prior written permission of Nathaniel G. Auvil. jCharts is a * registered trademark of Nathaniel G. Auvil. * * 5. Due credit should be given to the jCharts Project (http://jcharts.sourceforge.net/). * * THIS SOFTWARE IS PROVIDED BY Nathaniel G. Auvil AND CONTRIBUTORS ``AS IS'' AND ANY * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL * jCharts OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE ************************************************************************************************/ package org.jCharts.properties; import org.jCharts.test.HTMLGenerator; import org.jCharts.test.HTMLTestable; import org.jCharts.properties.util.ChartFont; import java.awt.*; import java.lang.reflect.Field; public class LabelAxisProperties extends AxisTypeProperties implements HTMLTestable { /*********************************************************************************************** * ************************************************************************************************/ public LabelAxisProperties() { super(); } /********************************************************************************************* * Enables the testing routines to display the contents of this Object. * * @param htmlGenerator ********************************************************************************************** public void toHTML( HTMLGenerator htmlGenerator ) { htmlGenerator.propertiesTableStart( this.getClass().getName() ); super.toHTML( htmlGenerator ); Field[] fields = this.getClass().getDeclaredFields(); for( int i = 0; i < fields.length; i++ ) { try { htmlGenerator.addField( fields[ i ].getName(), fields[ i ].get( this ) ); } catch( IllegalAccessException illegalAccessException ) { illegalAccessException.printStackTrace(); } } htmlGenerator.propertiesTableEnd(); } */ } jcharts-0.7.5/src/org/jCharts/properties/LegendAreaProperties.java0000644000175000001440000002215107751071402024275 0ustar onkarusers/*********************************************************************************************** * File Info: $Id: LegendAreaProperties.java,v 1.8 2003/02/13 04:15:11 nathaniel_auvil Exp $ * Copyright (C) 2002 * Author: Nathaniel G. Auvil * Contributor(s): Sandor Dornbush * * Copyright 2002 (C) Nathaniel G. Auvil. All Rights Reserved. * * Redistribution and use of this software and associated documentation ("Software"), with or * without modification, are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain copyright statements and notices. * Redistributions must also contain a copy of this document. * * 2. Redistributions in binary form must reproduce the above copyright notice, this list of * conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. * * 3. The name "jCharts" or "Nathaniel G. Auvil" must not be used to endorse or promote * products derived from this Software without prior written permission of Nathaniel G. * Auvil. For written permission, please contact nathaniel_auvil@users.sourceforge.net * * 4. Products derived from this Software may not be called "jCharts" nor may "jCharts" appear * in their names without prior written permission of Nathaniel G. Auvil. jCharts is a * registered trademark of Nathaniel G. Auvil. * * 5. Due credit should be given to the jCharts Project (http://jcharts.sourceforge.net/). * * THIS SOFTWARE IS PROVIDED BY Nathaniel G. Auvil AND CONTRIBUTORS ``AS IS'' AND ANY * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL * jCharts OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE ************************************************************************************************/ package org.jCharts.properties; import org.jCharts.test.HTMLGenerator; import org.jCharts.test.HTMLTestable; abstract public class LegendAreaProperties extends AreaProperties implements HTMLTestable { public static final int COLUMNS_AS_MANY_AS_NEEDED = 0; //---This will wrap the legend to fit the image size. public static final int COLUMNS_FIT_TO_IMAGE = -1; public static final int BOTTOM = 0; public static final int RIGHT = 1; public static final int LEFT = 2; public static final int TOP = 3; private int numColumns = COLUMNS_AS_MANY_AS_NEEDED; //---vertical padding between labels private int rowPadding = 5; //---horizontal padding between labels private int columnPadding = 10; //---padding between icon and Label private int iconPadding = 5; //---distance from edge of chart to Legend private int chartPadding = 5; //---where Legend should be drawn in relation to the chart. private int placement = BOTTOM; /********************************************************************************************* * Constructor for those desiring auto-calculation of the Legend width based on the number * of columns. All Labels are on a single row as default number of rows is: COLUMNS_AS_MANY_AS_NEEDED * **********************************************************************************************/ public LegendAreaProperties() { super(); } /********************************************************************************************* * Returns where the Legend should be drawn in relation to the Chart. * * @return int **********************************************************************************************/ public int getPlacement() { return this.placement; } /********************************************************************************************* * Sets where the Legend should be drawn in relation to the Chart. * * @param placementConstant **********************************************************************************************/ public void setPlacement( int placementConstant ) { this.placement = placementConstant; } /********************************************************************************************* * Returns the padding between chart plot and the Legend. * * @return int **********************************************************************************************/ public int getChartPadding() { return this.chartPadding; } /********************************************************************************************* * Sets the padding between chart plot and the Legend. * * @param chartPadding **********************************************************************************************/ public void setChartPadding( int chartPadding ) { this.chartPadding = chartPadding; } /********************************************************************************************* * Returns the padding between label columns. * * @return int **********************************************************************************************/ public int getColumnPadding() { return this.columnPadding; } /********************************************************************************************* * Returns the padding between labels in each row. * * @return int **********************************************************************************************/ public int getRowPadding() { return this.rowPadding; } /********************************************************************************************* * Sets the number of text columns the legend should display. * * @param numColumns **********************************************************************************************/ public void setNumColumns( int numColumns ) { this.numColumns = numColumns; } /********************************************************************************************* * Gets the number of text columns the legend should display. * * @return int **********************************************************************************************/ public int getNumColumns() { return this.numColumns; } /********************************************************************************************* * Returns the padding between the icon and the Label * * @return int **********************************************************************************************/ public int getIconPadding() { return this.iconPadding; } /********************************************************************************************* * Sets the padding between labels in each row, in pixels. * * @param rowPadding **********************************************************************************************/ public void setRowPadding( int rowPadding ) { this.rowPadding = rowPadding; } /********************************************************************************************* * Sets the padding between label columns, in pixels. * * @param columnPadding **********************************************************************************************/ public void setColumnPadding( int columnPadding ) { this.columnPadding = columnPadding; } /********************************************************************************************* * Sets the padding between the icon and the Label, in pixels. * * @param iconPadding **********************************************************************************************/ public void setIconPadding( int iconPadding ) { this.iconPadding = iconPadding; } /********************************************************************************************* * Enables the testing routines to display the contents of this Object. * * @param htmlGenerator **********************************************************************************************/ public void toHTML( HTMLGenerator htmlGenerator ) { super.toHTML( htmlGenerator ); htmlGenerator.addTableRow( "LegendAreaProperties->Num Columns", Integer.toString( this.getNumColumns() ) ); htmlGenerator.addTableRow( "LegendAreaProperties->Row Padding", Integer.toString( this.getRowPadding() ) ); htmlGenerator.addTableRow( "LegendAreaProperties->Icon Padding", Integer.toString( this.getIconPadding() ) ); htmlGenerator.addTableRow( "LegendAreaProperties->Chart Padding", Integer.toString( this.getChartPadding() ) ); htmlGenerator.addTableRow( "LegendAreaProperties->Column Padding", Integer.toString( this.getColumnPadding() ) ); htmlGenerator.addTableRow( "LegendAreaProperties->Placement", Integer.toString( this.getPlacement() ) ); } } jcharts-0.7.5/src/org/jCharts/properties/LegendProperties.java0000644000175000001440000001672707751071402023520 0ustar onkarusers/*********************************************************************************************** * File Info: $Id: LegendProperties.java,v 1.6 2003/03/08 23:19:33 nathaniel_auvil Exp $ * Copyright (C) 2002 * Author: Nathaniel G. Auvil * Contributor(s): Sandor Dornbush * * Copyright 2002 (C) Nathaniel G. Auvil. All Rights Reserved. * * Redistribution and use of this software and associated documentation ("Software"), with or * without modification, are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain copyright statements and notices. * Redistributions must also contain a copy of this document. * * 2. Redistributions in binary form must reproduce the above copyright notice, this list of * conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. * * 3. The name "jCharts" or "Nathaniel G. Auvil" must not be used to endorse or promote * products derived from this Software without prior written permission of Nathaniel G. * Auvil. For written permission, please contact nathaniel_auvil@users.sourceforge.net * * 4. Products derived from this Software may not be called "jCharts" nor may "jCharts" appear * in their names without prior written permission of Nathaniel G. Auvil. jCharts is a * registered trademark of Nathaniel G. Auvil. * * 5. Due credit should be given to the jCharts Project (http://jcharts.sourceforge.net/). * * THIS SOFTWARE IS PROVIDED BY Nathaniel G. Auvil AND CONTRIBUTORS ``AS IS'' AND ANY * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL * jCharts OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE ************************************************************************************************/ package org.jCharts.properties; import org.jCharts.test.HTMLGenerator; import org.jCharts.test.HTMLTestable; import org.jCharts.properties.util.ChartStroke; import java.awt.*; final public class LegendProperties extends LegendAreaProperties implements HTMLTestable { public static final Font DEFAULT_FONT = new Font( "Serif", Font.PLAIN, 12 ); public static final Paint DEFAULT_FONT_PAINT = Color.black; public static final Stroke DEFAULT_ICON_BORDER_STROKE = new BasicStroke( 1.0f ); public static final Paint DEFAULT_ICON_BORDER_PAINT = Color.black; private Font font = DEFAULT_FONT; private Paint fontPaint = DEFAULT_FONT_PAINT; private Paint iconBorderPaint = DEFAULT_ICON_BORDER_PAINT; private Stroke iconBorderStroke = DEFAULT_ICON_BORDER_STROKE; private Dimension size = null; /********************************************************************************************* * **********************************************************************************************/ public LegendProperties() { super(); //---Legend background should be transparent by default. super.setBackgroundPaint( null ); super.setBorderStroke( ChartStroke.DEFAULT_LEGEND_OUTLINE ); } /********************************************************************************************* * Sets the Font used by the Legend. * * @param legendFont **********************************************************************************************/ public void setFont( Font legendFont ) { this.font = legendFont; } /********************************************************************************************* * Returns the Font used by the Legend. * * @return Font **********************************************************************************************/ public Font getFont() { return this.font; } /********************************************************************************************* * Sets the Icon border color used by the Legend. If NULL is passed, there will be no border. * * @param iconBorderPaint **********************************************************************************************/ public void setIconBorderPaint( Paint iconBorderPaint ) { this.iconBorderPaint = iconBorderPaint; } /********************************************************************************************* * Returns the Icon border Color used by the Legend. * * @return Paint **********************************************************************************************/ public Paint getIconBorderPaint() { return this.iconBorderPaint; } /********************************************************************************************* * Sets the icon border Stroke. If NULL is passed, there will be no border. * * @param stroke **********************************************************************************************/ public void setIconBorderStroke( Stroke stroke ) { this.iconBorderStroke = stroke; } /********************************************************************************************* * Returns the icon border Stroke * * @return Stroke **********************************************************************************************/ public Stroke getIconBorderStroke() { return this.iconBorderStroke; } /********************************************************************************************* * Sets the Font color used by the Legend. * * @param fontPaint **********************************************************************************************/ public void setFontPaint( Paint fontPaint ) { this.fontPaint = fontPaint; } /********************************************************************************************* * Returns the Font Paint used by the Legend. * * @return Paint **********************************************************************************************/ public Paint getFontPaint() { return this.fontPaint; } /********************************************************************************************* * Enables the testing routines to display the contents of this Object. * * @param htmlGenerator **********************************************************************************************/ public void toHTML( HTMLGenerator htmlGenerator ) { htmlGenerator.propertiesTableStart( "LegendProperties" ); super.toHTML( htmlGenerator ); htmlGenerator.addTableRow( "Icon Border Paint", this.getIconBorderPaint() ); htmlGenerator.addTableRow( "Icon Border Stroke", this.getIconBorderStroke() ); htmlGenerator.addTableRow( "Font", this.getFont() ); htmlGenerator.addTableRow( "Font Paint", this.getFontPaint() ); htmlGenerator.propertiesTableEnd(); } /** Getter for property size. * @return Value of property size. * */ public java.awt.Dimension getSize() { return this.size; } /** Setter for property size. * @param size New value of property size. * */ public void setSize( java.awt.Dimension size ) { this.size = size; } } jcharts-0.7.5/src/org/jCharts/properties/LineChartProperties.java0000644000175000001440000001206507751071402024162 0ustar onkarusers/*********************************************************************************************** * File Info: $Id: LineChartProperties.java,v 1.5 2003/02/17 02:51:17 nathaniel_auvil Exp $ * Copyright (C) 2002 * Author: Nathaniel G. Auvil * Contributor(s): * * Copyright 2002 (C) Nathaniel G. Auvil. All Rights Reserved. * * Redistribution and use of this software and associated documentation ("Software"), with or * without modification, are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain copyright statements and notices. * Redistributions must also contain a copy of this document. * * 2. Redistributions in binary form must reproduce the above copyright notice, this list of * conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. * * 3. The name "jCharts" or "Nathaniel G. Auvil" must not be used to endorse or promote * products derived from this Software without prior written permission of Nathaniel G. * Auvil. For written permission, please contact nathaniel_auvil@users.sourceforge.net * * 4. Products derived from this Software may not be called "jCharts" nor may "jCharts" appear * in their names without prior written permission of Nathaniel G. Auvil. jCharts is a * registered trademark of Nathaniel G. Auvil. * * 5. Due credit should be given to the jCharts Project (http://jcharts.sourceforge.net/). * * THIS SOFTWARE IS PROVIDED BY Nathaniel G. Auvil AND CONTRIBUTORS ``AS IS'' AND ANY * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL * jCharts OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE ************************************************************************************************/ package org.jCharts.properties; import org.jCharts.test.HTMLGenerator; import org.jCharts.Chart; import org.jCharts.chartData.interfaces.IAxisPlotDataSet; import org.jCharts.types.ChartType; import org.jCharts.axisChart.AxisChart; import java.awt.*; final public class LineChartProperties extends AxisChartTypeProperties { public static final Stroke DEFAULT_LINE_STROKE=new BasicStroke( 1.5f ); private Stroke[] lineStrokes; private Shape[] shapes; /****************************************************************************************** * Constructor * * @param lineStrokes * @param shapes if any of the shapes are NULL, they will not be drawn. If the passed * Array is NULL, no shpaes will be drawn. There are some Shapes defined in * PointChartProperties Object. *****************************************************************************************/ public LineChartProperties( Stroke[] lineStrokes, Shape[] shapes ) { this.lineStrokes=lineStrokes; this.shapes=shapes; } public Stroke[] getLineStrokes() { return this.lineStrokes; } public Shape[] getShapes() { return this.shapes; } /********************************************************************************************* * Enables the testing routines to display the contents of this Object. * * @param htmlGenerator **********************************************************************************************/ public void toHTML( HTMLGenerator htmlGenerator ) { htmlGenerator.propertiesTableStart( "LineChartProperties" ); //htmlGenerator.addTableRow( "Zero Degree Offset", Double.toString( this.getZeroDegreeOffset() ) ); htmlGenerator.propertiesTableEnd(); } /****************************************************************************************** * Validates the properties. * * @throws PropertyException *****************************************************************************************/ public void validate( IAxisPlotDataSet iAxisPlotDataSet ) throws PropertyException { if( this.lineStrokes == null ) { throw new PropertyException( "You must define Stroke Objects for the LineChart in the LineChartProperties Object." ); } else { if( iAxisPlotDataSet.getNumberOfDataSets() != this.lineStrokes.length ) { throw new PropertyException( "You must define a Stroke Object for each Line in the LineChart." ); } if( this.shapes != null ) { if( this.shapes.length != this.lineStrokes.length ) { throw new PropertyException( "The number of Shapes defined in the LineChartProperties Object must equal the number of Lines." ); } } } } } jcharts-0.7.5/src/org/jCharts/properties/PieChart2DProperties.java0000644000175000001440000002076607751071402024205 0ustar onkarusers/*********************************************************************************************** * File Info: $Id: PieChart2DProperties.java,v 1.5 2003/03/11 02:53:19 nathaniel_auvil Exp $ * Copyright (C) 2002 * Author: Nathaniel G. Auvil * Contributor(s): * * Copyright 2002 (C) Nathaniel G. Auvil. All Rights Reserved. * * Redistribution and use of this software and associated documentation ("Software"), with or * without modification, are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain copyright statements and notices. * Redistributions must also contain a copy of this document. * * 2. Redistributions in binary form must reproduce the above copyright notice, this list of * conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. * * 3. The name "jCharts" or "Nathaniel G. Auvil" must not be used to endorse or promote * products derived from this Software without prior written permission of Nathaniel G. * Auvil. For written permission, please contact nathaniel_auvil@users.sourceforge.net * * 4. Products derived from this Software may not be called "jCharts" nor may "jCharts" appear * in their names without prior written permission of Nathaniel G. Auvil. jCharts is a * registered trademark of Nathaniel G. Auvil. * * 5. Due credit should be given to the jCharts Project (http://jcharts.sourceforge.net/). * * THIS SOFTWARE IS PROVIDED BY Nathaniel G. Auvil AND CONTRIBUTORS ``AS IS'' AND ANY * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL * jCharts OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE ************************************************************************************************/ package org.jCharts.properties; import org.jCharts.test.HTMLGenerator; import org.jCharts.test.HTMLTestable; import org.jCharts.Chart; import org.jCharts.types.PieLabelType; import org.jCharts.properties.util.ChartFont; import java.awt.*; final public class PieChart2DProperties extends ChartTypeProperties implements HTMLTestable { public static final Paint DEFAULT_BORDER_PAINT = Color.black; public static final Stroke DEFAULT_BORDER_STROKE = new BasicStroke( 1.5f, BasicStroke.CAP_SQUARE, BasicStroke.JOIN_ROUND ); private Paint borderPaint = DEFAULT_BORDER_PAINT; private Stroke borderStroke = DEFAULT_BORDER_STROKE; //---draw a twenty degrees by default. private float zeroDegreeOffset = 20.0f; private PieLabelType pieLabelType = PieLabelType.NO_LABELS; private boolean isCurrency = false; private boolean showGrouping = false; private int roundingPowerOfTen = 0; private ChartFont valueLabelFont = ChartFont.DEFAULT_PIE_VALUE; private float tickLength = 5; /********************************************************************************************* * **********************************************************************************************/ public PieChart2DProperties() { super(); } /********************************************************************************************* * The offset from zero degrees which the first slice of pie is drawn. Charts look better to * my eye when they do not start at zero degrees, but beauty is in the eye of the beholder. * * @param zeroDegreeOffset **********************************************************************************************/ public void setZeroDegreeOffset( float zeroDegreeOffset ) { this.zeroDegreeOffset = zeroDegreeOffset; } /********************************************************************************************* * * @return double **********************************************************************************************/ public float getZeroDegreeOffset() { return this.zeroDegreeOffset; } /********************************************************************************************* * * @return stroke **********************************************************************************************/ public Stroke getBorderStroke() { return this.borderStroke; } /********************************************************************************************* * * @param stroke **********************************************************************************************/ public void setBorderStroke( Stroke stroke ) { this.borderStroke = stroke; } /********************************************************************************************* * * @return Paint **********************************************************************************************/ public Paint getBorderPaint() { return this.borderPaint; } /********************************************************************************************* * * @param paint **********************************************************************************************/ public void setBorderPaint( Paint paint ) { this.borderPaint = paint; } /***************************************************************************** * * @return *****************************************************************************/ public PieLabelType getPieLabelType() { return pieLabelType; } /**************************************************************************** * Sets the type of label to draw on the PieChart. The default value is: * PieLabelType.NO_LABELS so no labels will be drawn on chart. * * @param pieLabelType ***************************************************************************/ public void setPieLabelType( PieLabelType pieLabelType ) { this.pieLabelType = pieLabelType; } public ChartFont getValueLabelFont() { return valueLabelFont; } /***************************************************************************** * Sets the ChartFont used to draw the chart value labels. * * @param valueLabelFont *****************************************************************************/ public void setValueLabelFont( ChartFont valueLabelFont ) { this.valueLabelFont = valueLabelFont; } public void setCurrency( boolean currency ) { isCurrency = currency; } public void setShowGrouping( boolean showGrouping ) { this.showGrouping = showGrouping; } public void setRoundingPowerOfTen( int roundingPowerOfTen ) { this.roundingPowerOfTen = roundingPowerOfTen; } public void setTickLength( float tickLength ) { this.tickLength = tickLength; } public float getTickLength() { return tickLength; } public boolean showValueLabelCurrency() { return isCurrency; } public boolean showValueLabelGrouping() { return showGrouping; } public int getValueLabelRoundingPowerOfTen() { return roundingPowerOfTen; } /********************************************************************************************* * Enables the testing routines to display the contents of this Object. * * @param htmlGenerator **********************************************************************************************/ public void toHTML( HTMLGenerator htmlGenerator ) { htmlGenerator.propertiesTableStart( "PieChart2DProperties" ); htmlGenerator.addTableRow( "Zero Degree Offset", Double.toString( this.getZeroDegreeOffset() ) ); htmlGenerator.addTableRow( "Border Paint", this.getBorderPaint() ); htmlGenerator.addTableRow( "Border Stroke", this.getBorderStroke() ); htmlGenerator.addTableRow( "Label Type", this.pieLabelType ); htmlGenerator.propertiesTableEnd(); } /****************************************************************************************** * Validates the properties. * * @param chart * @throws PropertyException *****************************************************************************************/ public void validate( Chart chart ) throws PropertyException { } } jcharts-0.7.5/src/org/jCharts/properties/PointChartProperties.java0000644000175000001440000001525407751071402024367 0ustar onkarusers/*********************************************************************************************** * File Info: $Id: PointChartProperties.java,v 1.4 2003/02/17 02:51:17 nathaniel_auvil Exp $ * Copyright (C) 2002 * Author: Nathaniel G. Auvil * Contributor(s): * * Copyright 2002 (C) Nathaniel G. Auvil. All Rights Reserved. * * Redistribution and use of this software and associated documentation ("Software"), with or * without modification, are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain copyright statements and notices. * Redistributions must also contain a copy of this document. * * 2. Redistributions in binary form must reproduce the above copyright notice, this list of * conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. * * 3. The name "jCharts" or "Nathaniel G. Auvil" must not be used to endorse or promote * products derived from this Software without prior written permission of Nathaniel G. * Auvil. For written permission, please contact nathaniel_auvil@users.sourceforge.net * * 4. Products derived from this Software may not be called "jCharts" nor may "jCharts" appear * in their names without prior written permission of Nathaniel G. Auvil. jCharts is a * registered trademark of Nathaniel G. Auvil. * * 5. Due credit should be given to the jCharts Project (http://jcharts.sourceforge.net/). * * THIS SOFTWARE IS PROVIDED BY Nathaniel G. Auvil AND CONTRIBUTORS ``AS IS'' AND ANY * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL * jCharts OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE ************************************************************************************************/ package org.jCharts.properties; import org.jCharts.chartData.interfaces.IAxisPlotDataSet; import org.jCharts.test.HTMLGenerator; import java.awt.*; import java.awt.geom.Ellipse2D; import java.awt.geom.Rectangle2D; final public class PointChartProperties extends AxisChartTypeProperties { public final static Stroke DEFAULT_POINT_BORDER_STROKE = new BasicStroke( 1.0f ); public final static Shape SHAPE_SQUARE = new Rectangle2D.Double( 0, 0, 10, 10 ); public final static Shape SHAPE_TRIANGLE = new Polygon( new int[]{0, 5, 10}, new int[]{10, 0, 10}, 3 ); public final static Shape SHAPE_CIRCLE = new Ellipse2D.Double( 0, 0, 10, 10 ); public final static Shape SHAPE_DIAMOND = new Polygon( new int[]{0, 5, 10, 5}, new int[]{5, 0, 5, 10}, 4 ); private Shape[] shapes; private boolean[] fillPointFlags; private Paint[] outlinePaints; /*************************************************************************************************** * Constructor * * @param shapes the Shapes to use for each DataSet drawn in this chart. There must * be an one to one mapping of Shape objects and DataSets in the chart. * @param fillPointFlags flags indicating whether to fill the point Shapes or to only outline them * using the Paint specified on the DataSet object. If this is set to TRUE, the 'outlinePaint' * attribute can be used to outline the Shape. * @param outlinePaints Sets the outline Paint to use for each Shape in the chart. This Paint is * only used if the 'setFillPointsFlag' is set to TRUE for the Shape. **************************************************************************************************/ public PointChartProperties( Shape[] shapes, boolean[] fillPointFlags, Paint[] outlinePaints ) { this.shapes = shapes; this.fillPointFlags = fillPointFlags; this.outlinePaints = outlinePaints; } /********************************************************************************************** * * ***********************************************************************************************/ public boolean getFillPointsFlag( int index ) { return this.fillPointFlags[ index ]; } /********************************************************************************************** * * * @param index * @return Paint ***********************************************************************************************/ public Paint getPointOutlinePaints( int index ) { return this.outlinePaints[ index ]; } /********************************************************************************************** * * @param index * @return Shape ***********************************************************************************************/ public Shape getShape( int index ) { return this.shapes[ index ]; } /********************************************************************************************* * Enables the testing routines to display the contents of this Object. * * @param htmlGenerator **********************************************************************************************/ public void toHTML( HTMLGenerator htmlGenerator ) { htmlGenerator.propertiesTableStart( "PointChartProperties" ); //htmlGenerator.addTableRow( "Zero Degree Offset", Double.toString( this.getZeroDegreeOffset() ) ); htmlGenerator.propertiesTableEnd(); } /****************************************************************************************** * Validates the properties. * * @param iAxisPlotDataSet * @throws PropertyException *****************************************************************************************/ public void validate( IAxisPlotDataSet iAxisPlotDataSet ) throws PropertyException { if( iAxisPlotDataSet.getNumberOfDataSets() != this.shapes.length ) { throw new PropertyException( " There must be a Shape implementation for each data set." ); } if( this.shapes.length != fillPointFlags.length ) { throw new PropertyException( " There is NOT an one to one mapping between 'fillPointsFlags' and Shapes" ); } if( this.shapes.length != outlinePaints.length ) { throw new PropertyException( " There is NOT an one to one mapping between 'outlinePaints' and Shapes" ); } } } jcharts-0.7.5/src/org/jCharts/properties/Properties.java0000644000175000001440000001001407751071402022360 0ustar onkarusers/*********************************************************************************************** * File Info: $Id: Properties.java,v 1.4 2002/10/22 01:54:14 nathaniel_auvil Exp $ * Copyright (C) 2002 * Author: Nathaniel G. Auvil * Contributor(s): * * Copyright 2002 (C) Nathaniel G. Auvil. All Rights Reserved. * * Redistribution and use of this software and associated documentation ("Software"), with or * without modification, are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain copyright statements and notices. * Redistributions must also contain a copy of this document. * * 2. Redistributions in binary form must reproduce the above copyright notice, this list of * conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. * * 3. The name "jCharts" or "Nathaniel G. Auvil" must not be used to endorse or promote * products derived from this Software without prior written permission of Nathaniel G. * Auvil. For written permission, please contact nathaniel_auvil@users.sourceforge.net * * 4. Products derived from this Software may not be called "jCharts" nor may "jCharts" appear * in their names without prior written permission of Nathaniel G. Auvil. jCharts is a * registered trademark of Nathaniel G. Auvil. * * 5. Due credit should be given to the jCharts Project (http://jcharts.sourceforge.net/). * * THIS SOFTWARE IS PROVIDED BY Nathaniel G. Auvil AND CONTRIBUTORS ``AS IS'' AND ANY * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL * jCharts OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE ************************************************************************************************/ package org.jCharts.properties; import org.jCharts.test.HTMLGenerator; import org.jCharts.test.HTMLTestable; import java.awt.*; import java.io.Serializable; abstract public class Properties implements Serializable, HTMLTestable { public static final Paint DEFAULT_BACKGROUND_PAINT = Color.white; private Paint backgroundPaint = DEFAULT_BACKGROUND_PAINT; /********************************************************************************************* * * **********************************************************************************************/ public Properties() { } /********************************************************************************************* * * @param backgroundPaint **********************************************************************************************/ public void setBackgroundPaint( Paint backgroundPaint ) { this.backgroundPaint = backgroundPaint; } /********************************************************************************************* * * @return Paint **********************************************************************************************/ public Paint getBackgroundPaint() { return this.backgroundPaint; } /********************************************************************************************* * Enables the testing routines to display the contents of this Object. * * @param htmlGenerator **********************************************************************************************/ public void toHTML( HTMLGenerator htmlGenerator ) { htmlGenerator.addTableRow( "Properties-Background Paint", this.getBackgroundPaint() ); } } jcharts-0.7.5/src/org/jCharts/properties/PropertyException.java0000644000175000001440000000477707751071402023752 0ustar onkarusers/*********************************************************************************************** * File Info: $Id: PropertyException.java,v 1.3 2002/10/22 01:55:16 nathaniel_auvil Exp $ * Copyright (C) 2002 * Author: Nathaniel G. Auvil * Contributor(s): * * Copyright 2002 (C) Nathaniel G. Auvil. All Rights Reserved. * * Redistribution and use of this software and associated documentation ("Software"), with or * without modification, are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain copyright statements and notices. * Redistributions must also contain a copy of this document. * * 2. Redistributions in binary form must reproduce the above copyright notice, this list of * conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. * * 3. The name "jCharts" or "Nathaniel G. Auvil" must not be used to endorse or promote * products derived from this Software without prior written permission of Nathaniel G. * Auvil. For written permission, please contact nathaniel_auvil@users.sourceforge.net * * 4. Products derived from this Software may not be called "jCharts" nor may "jCharts" appear * in their names without prior written permission of Nathaniel G. Auvil. jCharts is a * registered trademark of Nathaniel G. Auvil. * * 5. Due credit should be given to the jCharts Project (http://jcharts.sourceforge.net/). * * THIS SOFTWARE IS PROVIDED BY Nathaniel G. Auvil AND CONTRIBUTORS ``AS IS'' AND ANY * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL * jCharts OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE ************************************************************************************************/ package org.jCharts.properties; public class PropertyException extends Exception { public PropertyException( String message ) { super( message ); } } jcharts-0.7.5/src/org/jCharts/properties/ScatterPlotProperties.java0000644000175000001440000001176107751071402024557 0ustar onkarusers/*********************************************************************************************** * File Info: $Id: ScatterPlotProperties.java,v 1.2 2003/02/17 02:51:17 nathaniel_auvil Exp $ * Copyright (C) 2002 * Author: Nathaniel G. Auvil * Contributor(s): * * Copyright 2002 (C) Nathaniel G. Auvil. All Rights Reserved. * * Redistribution and use of this software and associated documentation ("Software"), with or * without modification, are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain copyright statements and notices. * Redistributions must also contain a copy of this document. * * 2. Redistributions in binary form must reproduce the above copyright notice, this list of * conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. * * 3. The name "jCharts" or "Nathaniel G. Auvil" must not be used to endorse or promote * products derived from this Software without prior written permission of Nathaniel G. * Auvil. For written permission, please contact nathaniel_auvil@users.sourceforge.net * * 4. Products derived from this Software may not be called "jCharts" nor may "jCharts" appear * in their names without prior written permission of Nathaniel G. Auvil. jCharts is a * registered trademark of Nathaniel G. Auvil. * * 5. Due credit should be given to the jCharts Project (http://jcharts.sourceforge.net/). * * THIS SOFTWARE IS PROVIDED BY Nathaniel G. Auvil AND CONTRIBUTORS ``AS IS'' AND ANY * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL * jCharts OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE ************************************************************************************************/ package org.jCharts.properties; import org.jCharts.chartData.interfaces.IAxisPlotDataSet; import org.jCharts.test.HTMLGenerator; import java.awt.*; final public class ScatterPlotProperties extends AxisChartTypeProperties { public static final Stroke DEFAULT_LINE_STROKE=new BasicStroke( 1.5f ); private Stroke[] lineStrokes; private Shape[] shapes; /****************************************************************************************** * Constructor * * @param lineStrokes * @param shapes if any of the shapes are NULL, they will not be drawn. If the passed * Array is NULL, no shpaes will be drawn. There are some Shapes defined in * PointChartProperties Object. *****************************************************************************************/ public ScatterPlotProperties( Stroke[] lineStrokes, Shape[] shapes ) { this.lineStrokes=lineStrokes; this.shapes=shapes; } public Stroke[] getLineStrokes() { return this.lineStrokes; } public Shape[] getShapes() { return this.shapes; } /********************************************************************************************* * Enables the testing routines to display the contents of this Object. * * @param htmlGenerator **********************************************************************************************/ public void toHTML( HTMLGenerator htmlGenerator ) { htmlGenerator.propertiesTableStart( "ScatterPlotProperties" ); //htmlGenerator.addTableRow( "Zero Degree Offset", Double.toString( this.getZeroDegreeOffset() ) ); htmlGenerator.propertiesTableEnd(); } /****************************************************************************************** * Validates the properties. * * @param iAxisPlotDataSet * @throws PropertyException *****************************************************************************************/ public void validate( IAxisPlotDataSet iAxisPlotDataSet ) throws PropertyException { if( this.lineStrokes == null ) { throw new PropertyException( "You must define Stroke Objects for the LineChart in the LineChartProperties Object." ); } else { if( iAxisPlotDataSet.getNumberOfDataSets() != this.lineStrokes.length ) { throw new PropertyException( "You must define a Stroke Object for each Line in the LineChart." ); } if( this.shapes != null ) { if( this.shapes.length != this.lineStrokes.length ) { throw new PropertyException( "The number of Shapes defined in the LineChartProperties Object must equal the number of Lines." ); } } } } } jcharts-0.7.5/src/org/jCharts/properties/StackedAreaChartProperties.java0000644000175000001440000000472307751071402025444 0ustar onkarusers/*********************************************************************************************** * File Info: $Id: StackedAreaChartProperties.java,v 1.3 2002/10/22 01:55:55 nathaniel_auvil Exp $ * Copyright (C) 2002 * Author: Nathaniel G. Auvil * Contributor(s): * * Copyright 2002 (C) Nathaniel G. Auvil. All Rights Reserved. * * Redistribution and use of this software and associated documentation ("Software"), with or * without modification, are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain copyright statements and notices. * Redistributions must also contain a copy of this document. * * 2. Redistributions in binary form must reproduce the above copyright notice, this list of * conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. * * 3. The name "jCharts" or "Nathaniel G. Auvil" must not be used to endorse or promote * products derived from this Software without prior written permission of Nathaniel G. * Auvil. For written permission, please contact nathaniel_auvil@users.sourceforge.net * * 4. Products derived from this Software may not be called "jCharts" nor may "jCharts" appear * in their names without prior written permission of Nathaniel G. Auvil. jCharts is a * registered trademark of Nathaniel G. Auvil. * * 5. Due credit should be given to the jCharts Project (http://jcharts.sourceforge.net/). * * THIS SOFTWARE IS PROVIDED BY Nathaniel G. Auvil AND CONTRIBUTORS ``AS IS'' AND ANY * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL * jCharts OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE ************************************************************************************************/ package org.jCharts.properties; public class StackedAreaChartProperties extends AreaChartProperties { } jcharts-0.7.5/src/org/jCharts/properties/StackedBarChartProperties.java0000644000175000001440000000502407751071402025273 0ustar onkarusers/*********************************************************************************************** * File: $Id: StackedBarChartProperties.java,v 1.2 2002/10/14 20:52:05 nathaniel_auvil Exp $ * Copyright (C) 2000 * Author: Nathaniel G. Auvil * Contributor(s): * * Copyright 2002 (C) Nathaniel G. Auvil. All Rights Reserved. * * Redistribution and use of this software and associated documentation * ("Software"), with or without modification, are permitted provided * that the following conditions are met: * * 1. Redistributions of source code must retain copyright * statements and notices. Redistributions must also contain a * copy of this document. * * 2. Redistributions in binary form must reproduce the * above copyright notice, this list of conditions and the * following disclaimer in the documentation and/or other * materials provided with the distribution. * * 3. The name "jCharts" or "Nathaniel G. Auvil" must not be used to * endorse or promote products derived from this Software without * prior written permission of Nathaniel G. Auvil. For written * permission, please contact nathaniel_auvil@users.sourceforge.net * * 4. Products derived from this Software may not be called "jCharts" * nor may "jCharts" appear in their names without prior written * permission of Nathaniel G. Auvil. jCharts is a registered * trademark of Nathaniel G. Auvil. * * 5. Due credit should be given to the jCharts Project * (http://jcharts.sourceforge.net/). * * THIS SOFTWARE IS PROVIDED BY Nathaniel G. Auvil AND CONTRIBUTORS * ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT * NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL * jCharts OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED * OF THE POSSIBILITY OF SUCH DAMAGE ************************************************************************************************/ package org.jCharts.properties; final public class StackedBarChartProperties extends BarChartProperties { } jcharts-0.7.5/src/org/jCharts/properties/StockChartProperties.java0000644000175000001440000002054307751071402024356 0ustar onkarusers/*********************************************************************************************** * File Info: $Id: StockChartProperties.java,v 1.4 2003/02/17 02:51:17 nathaniel_auvil Exp $ * Copyright (C) 2002 * Author: Nathaniel G. Auvil * Contributor(s): * * Copyright 2002 (C) Nathaniel G. Auvil. All Rights Reserved. * * Redistribution and use of this software and associated documentation ("Software"), with or * without modification, are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain copyright statements and notices. * Redistributions must also contain a copy of this document. * * 2. Redistributions in binary form must reproduce the above copyright notice, this list of * conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. * * 3. The name "jCharts" or "Nathaniel G. Auvil" must not be used to endorse or promote * products derived from this Software without prior written permission of Nathaniel G. * Auvil. For written permission, please contact nathaniel_auvil@users.sourceforge.net * * 4. Products derived from this Software may not be called "jCharts" nor may "jCharts" appear * in their names without prior written permission of Nathaniel G. Auvil. jCharts is a * registered trademark of Nathaniel G. Auvil. * * 5. Due credit should be given to the jCharts Project (http://jcharts.sourceforge.net/). * * THIS SOFTWARE IS PROVIDED BY Nathaniel G. Auvil AND CONTRIBUTORS ``AS IS'' AND ANY * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL * jCharts OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE ************************************************************************************************/ package org.jCharts.properties; import org.jCharts.test.HTMLGenerator; import org.jCharts.Chart; import org.jCharts.chartData.interfaces.IAxisPlotDataSet; import org.jCharts.axisChart.AxisChart; import java.awt.*; public final class StockChartProperties extends AxisChartTypeProperties { public static final Stroke DEFAULT_STROKE= new BasicStroke( 1.5f ); private Stroke hiLowStroke; private Stroke openStroke; private int openLength; private Stroke closeStroke; private int closeLength; /********************************************************************************************** * * ***********************************************************************************************/ public StockChartProperties() { this.hiLowStroke = DEFAULT_STROKE; this.openStroke = DEFAULT_STROKE; this.openLength = 5; this.closeStroke = DEFAULT_STROKE; this.closeLength = 5; } /********************************************************************************************** * * @param hiLowStroke * @param openStroke * @param openPixelLength * @param closeStroke * @param closePixelLength ***********************************************************************************************/ public StockChartProperties( Stroke hiLowStroke, Stroke openStroke, int openPixelLength, Stroke closeStroke, int closePixelLength ) { this.hiLowStroke = hiLowStroke; this.openStroke = openStroke; this.openLength = openPixelLength; this.closeStroke = closeStroke; this.closeLength = closePixelLength; } /********************************************************************************************** * * @return Stroke ***********************************************************************************************/ public Stroke getHiLowStroke() { return this.hiLowStroke; } /********************************************************************************************** * * @param stroke ***********************************************************************************************/ public void setHiLowStroke( Stroke stroke ) { this.hiLowStroke = stroke; } /********************************************************************************************** * * @return Stroke ***********************************************************************************************/ public Stroke getOpenStroke() { return this.openStroke; } /********************************************************************************************** * * @param stroke ***********************************************************************************************/ public void setOpenStroke( Stroke stroke ) { this.openStroke = stroke; } /********************************************************************************************** * * @return int ***********************************************************************************************/ public int getOpenPixelLength() { return this.openLength; } /********************************************************************************************** * * @param pixelLength ***********************************************************************************************/ public void setOpenPixelLength( int pixelLength ) { this.openLength = pixelLength; } /********************************************************************************************** * * @return Stroke ***********************************************************************************************/ public Stroke getCloseStroke() { return this.closeStroke; } /********************************************************************************************** * * @param stroke ***********************************************************************************************/ public void setCloseStroke( Stroke stroke ) { this.closeStroke = stroke; } /********************************************************************************************** * * @return int ***********************************************************************************************/ public int getClosePixelLength() { return this.closeLength; } /********************************************************************************************** * * @param pixelLength ***********************************************************************************************/ public void setClosePixelLength( int pixelLength ) { this.closeLength = pixelLength; } /****************************************************************************************** * Validates the properties. * * @param iAxisPlotDataSet * @throws PropertyException *****************************************************************************************/ public void validate( IAxisPlotDataSet iAxisPlotDataSet ) throws PropertyException { //AxisChart axisChart= (AxisChart) chart; //IAxisPlotDataSet iAxisPlotDataSet= axisChart.getIDataSeries().getIAxisPlotDataSet( ChartType.LINE ); } /********************************************************************************************* * Enables the testing routines to display the contents of this Object. * * @param htmlGenerator **********************************************************************************************/ public void toHTML( HTMLGenerator htmlGenerator ) { htmlGenerator.propertiesTableStart( "StockChartProperties" ); htmlGenerator.addTableRow( "HiLow Stroke", this.hiLowStroke ); htmlGenerator.addTableRow( "Open Stroke", this.openStroke ); htmlGenerator.addTableRow( "Open Length", Integer.toString( this.openLength ) ); htmlGenerator.addTableRow( "Close Stroke", this.closeStroke ); htmlGenerator.addTableRow( "Close Length", Integer.toString( this.closeLength ) ); htmlGenerator.propertiesTableEnd(); } } jcharts-0.7.5/src/org/jCharts/test/0000755000175000001440000000000007751071402016150 5ustar onkarusersjcharts-0.7.5/src/org/jCharts/test/AreaTestDriver.java0000644000175000001440000001426507751071402021707 0ustar onkarusers/*********************************************************************************************** * File Info: $Id: AreaTestDriver.java,v 1.6 2003/03/31 00:26:42 nathaniel_auvil Exp $ * Copyright (C) 2000 * Author: Nathaniel G. Auvil * Contributor(s): * * Copyright 2002 (C) Nathaniel G. Auvil. All Rights Reserved. * * Redistribution and use of this software and associated documentation * ("Software"), with or without modification, are permitted provided * that the following conditions are met: * * 1. Redistributions of source code must retain copyright * statements and notices. Redistributions must also contain a * copy of this document. * * 2. Redistributions in binary form must reproduce the * above copyright notice, this list of conditions and the * following disclaimer in the documentation and/or other * materials provided with the distribution. * * 3. The name "jCharts" or "Nathaniel G. Auvil" must not be used to * endorse or promote products derived from this Software without * prior written permission of Nathaniel G. Auvil. For written * permission, please contact nathaniel_auvil@users.sourceforge.net * * 4. Products derived from this Software may not be called "jCharts" * nor may "jCharts" appear in their names without prior written * permission of Nathaniel G. Auvil. jCharts is a registered * trademark of Nathaniel G. Auvil. * * 5. Due credit should be given to the jCharts Project * (http://jcharts.sourceforge.net/). * * THIS SOFTWARE IS PROVIDED BY Nathaniel G. Auvil AND CONTRIBUTORS * ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT * NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL * jCharts OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED * OF THE POSSIBILITY OF SUCH DAMAGE. ************************************************************************************************/ package org.jCharts.test; import org.jCharts.chartData.*; import org.jCharts.properties.*; import org.jCharts.types.ChartType; import org.jCharts.axisChart.AxisChart; import java.awt.*; /****************************************************************************************** * This file provides examples of how to create all the different chart types provided by * this package. * *******************************************************************************************/ class AreaTestDriver extends AxisChartTestBase { boolean supportsImageMap() { return false; } /****************************************************************************************** * Separate this so can use for combo chart test * ******************************************************************************************/ static ChartTypeProperties getChartTypeProperties( int numberOfDataSets ) { /* Stroke[] strokes= new Stroke[ numberOfDataSets ]; for( int j=0; j < numberOfDataSets; j++ ) { strokes[ j ]= LineChartProperties.DEFAULT_LINE_STROKE; } strokes[ 0 ]= new BasicStroke( 3.0f ); Shape[] shapes= new Shape[ numberOfDataSets ]; for( int j=0; j < numberOfDataSets; j++ ) { shapes[ j ]= PointChartProperties.SHAPE_DIAMOND; } shapes[ 0 ]= PointChartProperties.SHAPE_CIRCLE; */ return new AreaChartProperties(); } /****************************************************************************************** * * ******************************************************************************************/ DataSeries getDataSeries() throws ChartDataException { DataSeries dataSeries; AxisChartDataSet axisChartDataSet; int dataSize=(int) TestDataGenerator.getRandomNumber( 10, 50 ); int numberOfDataSets=(int) TestDataGenerator.getRandomNumber( 1, 3 ); dataSeries=super.createDataSeries( dataSize ); ChartType chartType=null; if( TestDataGenerator.getRandomNumber( 1.0d ) > 0.5 ) { chartType=ChartType.AREA; } else { chartType=ChartType.AREA_STACKED; } axisChartDataSet=super.createAxisChartDataSet( chartType, getChartTypeProperties( numberOfDataSets ), numberOfDataSets, dataSize, 0, 5000 ); dataSeries.addIAxisPlotDataSet( axisChartDataSet ); return dataSeries; } public static void main( String[] args ) throws ChartDataException, PropertyException { StackedAreaChartProperties stacked= new StackedAreaChartProperties(); AreaChartProperties areaChartProperties= new AreaChartProperties(); double[][] data= { { 10, 15, 30 }, {30, 30, 10}, {20, 25, 20} }; Paint[] paints= { new Color( 0, 255, 0, 100 ), new Color( 255, 0, 0, 100 ), new Color( 0, 0, 255, 100 ) }; String[] legendLabels= { "Legend Label", "Legend Label", "Legend Label" }; AxisChartDataSet axisChartDataSet = new AxisChartDataSet( data, legendLabels, paints, ChartType.AREA, areaChartProperties ); String[] axisLabels= { "1", "2", "3" }; DataSeries dataSeries = new DataSeries( axisLabels, "X-Axis Title", "Y-Axis Title", "Chart Title" ); dataSeries.addIAxisPlotDataSet( axisChartDataSet ); ChartProperties chartProperties= new ChartProperties(); AxisProperties axisProperties= new AxisProperties( false ); DataAxisProperties dataAxisProperties= (DataAxisProperties) axisProperties.getYAxisProperties(); dataAxisProperties.setNumItems( 4 ); dataAxisProperties.setRoundToNearest( 1 ); LegendProperties legendProperties= new LegendProperties(); AxisChart axisChart= new AxisChart( dataSeries, chartProperties, axisProperties, legendProperties, 500, 400 ); ChartTestDriver.exportImage( axisChart, "AreaChartTest.png" ); } } jcharts-0.7.5/src/org/jCharts/test/AxisChartTestBase.java0000644000175000001440000002072707751071402022344 0ustar onkarusers/*********************************************************************************************** * File Info: $Id: AxisChartTestBase.java,v 1.22 2003/03/31 00:26:42 nathaniel_auvil Exp $ * Copyright (C) 2000 * Author: Nathaniel G. Auvil * Contributor(s): * * Copyright 2002 (C) Nathaniel G. Auvil. All Rights Reserved. * * Redistribution and use of this software and associated documentation ("Software"), with or * without modification, are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain copyright statements and notices. * Redistributions must also contain a copy of this document. * * 2. Redistributions in binary form must reproduce the above copyright notice, this list of * conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. * * 3. The name "jCharts" or "Nathaniel G. Auvil" must not be used to endorse or promote * products derived from this Software without prior written permission of Nathaniel G. * Auvil. For written permission, please contact nathaniel_auvil@users.sourceforge.net * * 4. Products derived from this Software may not be called "jCharts" nor may "jCharts" appear * in their names without prior written permission of Nathaniel G. Auvil. jCharts is a * registered trademark of Nathaniel G. Auvil. * * 5. Due credit should be given to the jCharts Project (http://jcharts.sourceforge.net/). * * THIS SOFTWARE IS PROVIDED BY Nathaniel G. Auvil AND CONTRIBUTORS ``AS IS'' AND ANY * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL * jCharts OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE ************************************************************************************************/ package org.jCharts.test; import org.jCharts.axisChart.AxisChart; import org.jCharts.chartData.*; import org.jCharts.properties.*; import org.jCharts.types.ChartType; import org.jCharts.imageMap.ImageMap; import java.awt.*; /****************************************************************************************** * * *******************************************************************************************/ abstract class AxisChartTestBase { public AxisChartTestBase() { System.out.println( "Running: " + this.getClass().getName() ); } abstract DataSeries getDataSeries() throws ChartDataException; abstract boolean supportsImageMap(); /****************************************************************************************** * Test for LineChart * ******************************************************************************************/ static void axisChartTest( String name, AxisChartTestBase axisChartTestBase ) throws ChartDataException, PropertyException { LegendProperties legendProperties; ChartProperties chartProperties; AxisProperties axisProperties; AxisChart axisChart; int numTestsToRun = 10; String fileName; HTMLGenerator htmlGenerator = new HTMLGenerator( ChartTestDriver.OUTPUT_PATH + name + "Test.html" ); for( int i = 0; i < numTestsToRun; i++ ) { DataSeries dataSeries= axisChartTestBase.getDataSeries(); boolean horizontalPlot= false; //( TestDataGenerator.getRandomNumber( 1 ) > 0.5d ); boolean createImageMap= ( TestDataGenerator.getRandomNumber( 1 ) > 0.5d ); axisProperties = new AxisProperties( horizontalPlot ); axisProperties.setXAxisLabelsAreVertical( ( TestDataGenerator.getRandomNumber( 1 ) > 0.5d ) ); TestDataGenerator.randomizeAxisProperties( axisProperties ); //axisProperties.setYAxisNumItems( 6 ); DataAxisProperties dataAxisProperties; LabelAxisProperties labelAxisProperties; if( horizontalPlot ) { dataAxisProperties = ( DataAxisProperties ) axisProperties.getXAxisProperties(); labelAxisProperties = ( LabelAxisProperties ) axisProperties.getYAxisProperties(); } else { dataAxisProperties = ( DataAxisProperties ) axisProperties.getYAxisProperties(); labelAxisProperties = ( LabelAxisProperties ) axisProperties.getXAxisProperties(); } dataAxisProperties.setRoundToNearest( 1 ); dataAxisProperties.setShowAxisLabels( ( TestDataGenerator.getRandomNumber( 1 ) > 0.5d ) ); //---if the labels are NULL, force to zero. if( dataSeries.getNumberOfAxisLabels() == 0 ) { labelAxisProperties.setShowAxisLabels( false ); } else { labelAxisProperties.setShowAxisLabels( ( TestDataGenerator.getRandomNumber( 1 ) > 0.5d ) ); } int width = ( int ) TestDataGenerator.getRandomNumber( 500, 1000 ); int height = ( int ) TestDataGenerator.getRandomNumber( 300, 800 ); legendProperties = new LegendProperties(); TestDataGenerator.randomizeLegend( legendProperties ); //legendProperties.setPlacement( LegendAreaProperties.RIGHT ); chartProperties = new ChartProperties(); //chartProperties.setBorderStroke( new BasicStroke( 1f ) ); axisChart = new AxisChart( dataSeries, chartProperties, axisProperties, legendProperties, width, height ); fileName = ChartTestDriver.OUTPUT_PATH + name + i + ChartTestDriver.EXTENSION; ImageMap imageMap; if( createImageMap && axisChartTestBase.supportsImageMap() ) { axisChart.renderWithImageMap(); imageMap= axisChart.getImageMap(); } else { imageMap= null; } try { ChartTestDriver.exportImage( axisChart, fileName ); } catch( NullPointerException nullPointerException ) { nullPointerException.printStackTrace(); System.out.println(); } axisChart.toHTML( htmlGenerator, fileName, imageMap ); htmlGenerator.addLineBreak(); } htmlGenerator.saveFile(); } /***************************************************************************************************** * * *****************************************************************************************************/ final DataSeries createDataSeries( int numberOfValuesToCreate ) { String[] xAxisLabels= null; if( ( TestDataGenerator.getRandomNumber( 1 ) > 0.5d ) ) { xAxisLabels = TestDataGenerator.getRandomStrings( numberOfValuesToCreate, ( int ) TestDataGenerator.getRandomNumber( 10 ), false ); } String xAxisTitle = TestDataGenerator.getRandomString( 15, true ); String yAxisTitle = TestDataGenerator.getRandomString( 15, true ); return new DataSeries( xAxisLabels, xAxisTitle, yAxisTitle, "This is a test title that is so freaking long is is going to wrap around the image for sure. lfksjg;ljs; dflgkjdfgsdgdg dsgdsgsdfg dsfgsdfgsdfgs dfgdsfgd" ); } /***************************************************************************************** * Generates a random MultiDataSet * * @param numberOfDataSets * @param numberOfValuesToCreate the number of doubles to generate * @param minValue * @param maxValue * @return AxisChartDataSet ******************************************************************************************/ AxisChartDataSet createAxisChartDataSet( ChartType chartType, ChartTypeProperties chartTypeProperties, int numberOfDataSets, int numberOfValuesToCreate, int minValue, int maxValue ) throws ChartDataException { double[][] data = TestDataGenerator.getRandomNumbers( numberOfDataSets, numberOfValuesToCreate, minValue, maxValue ); String[] legendLabels = TestDataGenerator.getRandomStrings( numberOfDataSets, 10, false ); Paint[] paints = TestDataGenerator.getRandomPaints( numberOfDataSets ); /* //data[ 0 ][ 0 ]= Double.NaN; data[ 0 ][ 1 ]= Double.NaN; data[ 0 ][ 4 ]= Double.NaN; data[ 0 ][ 6 ]= Double.NaN; //data[ 0 ][ data[ 0 ].length - 1 ]= Double.NaN; data[ 0 ][ data[ 0 ].length - 2 ]= Double.NaN; */ return new AxisChartDataSet( data, legendLabels, paints, chartType, chartTypeProperties ); } } jcharts-0.7.5/src/org/jCharts/test/BarTestDriver.java0000644000175000001440000002611007751071402021533 0ustar onkarusers/*********************************************************************************************** * File Info: $Id: BarTestDriver.java,v 1.20 2003/11/02 13:22:31 nathaniel_auvil Exp $ * Copyright (C) 2000 * Author: Nathaniel G. Auvil * Contributor(s): * * Copyright 2002 (C) Nathaniel G. Auvil. All Rights Reserved. * * Redistribution and use of this software and associated documentation * ("Software"), with or without modification, are permitted provided * that the following conditions are met: * * 1. Redistributions of source code must retain copyright * statements and notices. Redistributions must also contain a * copy of this document. * * 2. Redistributions in binary form must reproduce the * above copyright notice, this list of conditions and the * following disclaimer in the documentation and/or other * materials provided with the distribution. * * 3. The name "jCharts" or "Nathaniel G. Auvil" must not be used to * endorse or promote products derived from this Software without * prior written permission of Nathaniel G. Auvil. For written * permission, please contact nathaniel_auvil@users.sourceforge.net * * 4. Products derived from this Software may not be called "jCharts" * nor may "jCharts" appear in their names without prior written * permission of Nathaniel G. Auvil. jCharts is a registered * trademark of Nathaniel G. Auvil. * * 5. Due credit should be given to the jCharts Project * (http://jcharts.sourceforge.net/). * * THIS SOFTWARE IS PROVIDED BY Nathaniel G. Auvil AND CONTRIBUTORS * ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT * NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL * jCharts OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED * OF THE POSSIBILITY OF SUCH DAMAGE. ************************************************************************************************/ package org.jCharts.test; import org.jCharts.axisChart.AxisChart; import org.jCharts.axisChart.customRenderers.axisValue.renderers.*; import org.jCharts.chartData.*; import org.jCharts.chartData.interfaces.IAxisDataSeries; import org.jCharts.properties.*; import org.jCharts.properties.util.ChartStroke; import org.jCharts.types.ChartType; import java.awt.*; import java.util.Locale; import java.util.Collection; import java.util.Iterator; import java.text.MessageFormat; /****************************************************************************************** * This file provides examples of how to create all the different chart types provided by * this package. * *******************************************************************************************/ public final class BarTestDriver extends AxisChartTestBase { boolean supportsImageMap() { return true; } /****************************************************************************************** * Separate this so can use for combo chart test * ******************************************************************************************/ static ChartTypeProperties getChartTypeProperties( int numberOfDataSets ) { BarChartProperties barChartProperties = new BarChartProperties(); barChartProperties.setWidthPercentage( 1f ); return barChartProperties; } /****************************************************************************************** * * ******************************************************************************************/ DataSeries getDataSeries() throws ChartDataException { int dataSize = (int) TestDataGenerator.getRandomNumber( 2, 5 ); int numberOfDataSets = 1; //(int) TestDataGenerator.getRandomNumber( 1, 3 ); AxisChartDataSet axisChartDataSet; DataSeries dataSeries = super.createDataSeries( dataSize ); axisChartDataSet = super.createAxisChartDataSet( ChartType.BAR, getChartTypeProperties( numberOfDataSets ), numberOfDataSets, dataSize, -2000, 2000 ); dataSeries.addIAxisPlotDataSet( axisChartDataSet ); return dataSeries; } /***************************************************************************************** * * @param args * @throws PropertyException * @throws ChartDataException *****************************************************************************************/ public static void main( String[] args ) throws PropertyException, ChartDataException { BarChartProperties barChartProperties = new BarChartProperties(); //BackgroundRenderer backgroundRenderer = new BackgroundRenderer( new Color( 20, 20, 20, 50 ) ); //barChartProperties.addPreRenderEventListener( backgroundRenderer ); /* ValueLabelRenderer valueLabelRenderer = new ValueLabelRenderer( false, true, -1 ); valueLabelRenderer.setValueLabelPosition( ValueLabelPosition.ON_TOP ); valueLabelRenderer.useVerticalLabels( false ); barChartProperties.addPostRenderEventListener( valueLabelRenderer ); */ /* double[][] data = {{280, 16, -150, 160, 90, 60, 150, 11, -23, 50, 89}}; Paint[] paints = {Color.green}; String[] legendLabels = {"Test Legend Label"}; AxisChartDataSet axisChartDataSet = new AxisChartDataSet( data, legendLabels, paints, ChartType.BAR, barChartProperties ); String[] axisLabels = {"1900", "195555510", "1920", "1935555555555550", "1940", "19555555550", "5555551960", "19755555550", "19855550", "19905555", "20005555"}; //String[] axisLabels = {"1900", "1910", "1920", "1930", "1940", "1950", "1960", "1970", "1980", "1990", "2000" }; IAxisDataSeries dataSeries = new DataSeries( axisLabels, "Wonka Bars", "Years", "Oompa Loompa Productivity" ); dataSeries.addIAxisPlotDataSet( axisChartDataSet ); ChartProperties chartProperties = new ChartProperties(); AxisProperties axisProperties = new AxisProperties( true ); axisProperties.getYAxisProperties().setShowGridLines( AxisTypeProperties.GRID_LINES_ALL ); axisProperties.getYAxisProperties().setGridLineChartStroke( new ChartStroke( new BasicStroke( 1.5f ), Color.red ) ); //axisProperties.setXAxisLabelsAreVertical( true ); DataAxisProperties yAxis = (DataAxisProperties) axisProperties.getXAxisProperties(); yAxis.setRoundToNearest( 1 ); yAxis.setUserDefinedScale( -300, 200 ); LegendProperties legendProperties = null; //new LegendProperties(); AxisChart axisChart = new AxisChart( dataSeries, chartProperties, axisProperties, legendProperties, 500, 400 ); ChartTestDriver.exportImage( axisChart, "BarChartTest.png" ); */ bug2(); } public static void bug() throws ChartDataException, PropertyException { String[] xAxisLabels = {"I", "II", "III", "IV", "V", "VI", "VII", "VIII", "IX", "X", "XI", "XII"}; //out = response.getOutputStream(); //java.util.ResourceBundle txts = java.util.ResourceBundle.getBundle( "charts", new Locale( language ) ); //String year = getParameter( request, "Year" ); //if( year == null ) year = "2002"; //Collection v = user.getNumbersByYear( kid, new Long( year ) ); //Iterator it = v.iterator(); double[][] data = new double[1][12]; for( int i = 0; i < 12; i++ ) { double d = 51; data[0][i] = d; } String xAxisTitle = "CHART1_XAXIS"; String yAxisTitle = "CHART1_YAXIS"; //Object[] arg = {year}; String title = "CHART1_TITLE hhhhhhhhhhhhhhhhhhhhh hhhhhhhhh hhhhhhhhhhh hhhhhhhhhhh hhhhhhhh hhhhhhhh hhhh hhhhh hhhh hhhh hhhh hhhhh hhhhhhhh"; DataSeries dataSeries = new DataSeries( xAxisLabels, xAxisTitle, yAxisTitle, title ); String[] legendLabels = {"CHART1_LEGEND"}; Paint[] paints = {new GradientPaint( 0, 0, new Color( 255, 213, 83, 150 ), 0, 350, new Color( 243, 116, 0, 200 ) ) }; BarChartProperties barChartProperties = new BarChartProperties(); ValueLabelRenderer valueLabelRenderer = new ValueLabelRenderer( false, false, false, -1 ); valueLabelRenderer.setValueLabelPosition( ValueLabelPosition.ON_TOP ); valueLabelRenderer.useVerticalLabels( false ); barChartProperties.addPostRenderEventListener( valueLabelRenderer ); AxisChartDataSet axisChartDataSet = new AxisChartDataSet( data, legendLabels, paints, ChartType.BAR, barChartProperties ); dataSeries.addIAxisPlotDataSet( axisChartDataSet ); ChartProperties chartProperties = new ChartProperties(); LabelAxisProperties xAxisProperties = new LabelAxisProperties(); //xAxisProperties.setAxisTitleChartFont( ft_axis ); //xAxisProperties.setScaleChartFont( ft_labels ); DataAxisProperties yAxisProperties = new DataAxisProperties(); //yAxisProperties.setAxisTitleChartFont( ft_axis ); //yAxisProperties.setScaleChartFont( ft_labels ); yAxisProperties.setRoundToNearest( 0 ); AxisProperties axisProperties = new AxisProperties( xAxisProperties, yAxisProperties ); LegendProperties legendProperties = new LegendProperties(); //chartProperties.setTitleFont( ft_title ); //legendProperties.setFont( ft_base_ ); axisProperties.setBackgroundPaint( new GradientPaint( 0, 0, new Color( 255, 255, 255 ), 0, 300, new Color( 167, 213, 255 ) ) ); AxisChart axisChart = new AxisChart( dataSeries, chartProperties, axisProperties, null, //legendProperties, 548, 350 ); // wymiary wykresu ChartTestDriver.exportImage( axisChart, "Bug_BarChartTest.png" ); } private static void bug2() { BarChartProperties barChartProperties = null; LegendProperties legendProperties = null; AxisProperties axisProperties = null; ChartProperties chartProperties =null;// = new ChartProperties(); int width = 550; int height = 360; try { String[] xAxisLabels = {"1995", "1996", "1997", "1998", "1999", "2000","2001", "2002", "2003", "2004"}; String xAxisTitle = "Years"; String yAxisTitle = "Problems"; String title = "Micro$oft At Work"; IAxisDataSeries dataSeries = new DataSeries( xAxisLabels, xAxisTitle,yAxisTitle, title ); double[][] data = new double[][]{{1500, 6880, 4510, 2600, 1200, 1580,8000, 4555, 4000, 6120}}; String[] legendLabels = {"Bugs"}; Paint[] paints = new Paint[]{Color.blue.darker()}; dataSeries.addIAxisPlotDataSet( new AxisChartDataSet( data,legendLabels, paints, ChartType.BAR, barChartProperties ) ); AxisChart axisChart = new AxisChart( dataSeries, chartProperties, axisProperties, legendProperties, width, height ); ChartTestDriver.exportImage( axisChart, "Bug222_BarChartTest.png" ); } catch( ChartDataException chartDataException ) { chartDataException.printStackTrace(); } catch( PropertyException propertyException ) { propertyException.printStackTrace(); } } } jcharts-0.7.5/src/org/jCharts/test/ChartTestDriver.java0000644000175000001440000001610207751071402022070 0ustar onkarusers/*********************************************************************************************** * File Info: $Id: ChartTestDriver.java,v 1.21 2003/11/02 13:22:31 nathaniel_auvil Exp $ * Copyright (C) 2000 * Author: Nathaniel G. Auvil * Contributor(s): * * Copyright 2002 (C) Nathaniel G. Auvil. All Rights Reserved. * * Redistribution and use of this software and associated documentation ("Software"), with or * without modification, are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain copyright statements and notices. * Redistributions must also contain a copy of this document. * * 2. Redistributions in binary form must reproduce the above copyright notice, this list of * conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. * * 3. The name "jCharts" or "Nathaniel G. Auvil" must not be used to endorse or promote * products derived from this Software without prior written permission of Nathaniel G. * Auvil. For written permission, please contact nathaniel_auvil@users.sourceforge.net * * 4. Products derived from this Software may not be called "jCharts" nor may "jCharts" appear * in their names without prior written permission of Nathaniel G. Auvil. jCharts is a * registered trademark of Nathaniel G. Auvil. * * 5. Due credit should be given to the jCharts Project (http://jcharts.sourceforge.net/). * * THIS SOFTWARE IS PROVIDED BY Nathaniel G. Auvil AND CONTRIBUTORS ``AS IS'' AND ANY * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL * jCharts OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE ************************************************************************************************/ package org.jCharts.test; import org.jCharts.Chart; import org.jCharts.properties.PropertyException; import org.jCharts.chartData.ChartDataException; import org.jCharts.encoders.*; import java.io.*; /****************************************************************************************** * This file provides examples of how to create all the different chart types provided by * this package. * *******************************************************************************************/ public final class ChartTestDriver { private final static String SVG = ".svg"; private final static String PNG = ".png"; private final static String JPEG = ".jpg"; private final static String JPEG_LEGACY = ".jpeg"; final static String OUTPUT_PATH = ""; final static String EXTENSION = PNG; /***************************************************************************************** * Main method so can run as command line. * * @param args command line arguements. *****************************************************************************************/ public static void main( String[] args ) throws ChartDataException, PropertyException { StopWatch stopWatch = new StopWatch(); stopWatch.start(); /* AxisChartTestBase.axisChartTest( "stockChart", new StockTestDriver() ); AxisChartTestBase.axisChartTest( "areaChart", new AreaTestDriver() ); AxisChartTestBase.axisChartTest( "barChart", new BarTestDriver() ); AxisChartTestBase.axisChartTest( "stackedBarChart", new StackedBarTestDriver() ); AxisChartTestBase.axisChartTest( "clusteredBarChart", new ClusteredBarTestDriver() ); AxisChartTestBase.axisChartTest( "comboChart", new ComboTestDriver() ); PieTestDriver.test(); AxisChartTestBase.axisChartTest( "pointChart", new PointTestDriver() ); */ AxisChartTestBase.axisChartTest( "lineChart", new LineTestDriver() ); ScatterChartTestBase.axisChartTest( "scatterChart", new ScatterPlotTestDriver() ); //ChartTestDriver.testAxisScale(); stopWatch.stop(); System.out.println( stopWatch ); } private static void testAxisScale() { double yMax = -15; double yMin = -130; // In the following line, note that Math.log is actually Natural Logarithm. // log base a of b = ln b / ln a => log base 10 of x = ln 10 / ln x double yDelta = Math.pow( 10.0, Math.round( Math.log( yMax - yMin ) / Math.log( 10 ) ) ); double yStart = yMin - (yMin % yDelta); double yEnd = yMax - (yMax % yDelta) + yDelta; System.out.println( "yDelta= " + yDelta + " yStart= " + yStart + " yEnd= " + yEnd ); // Count the number of segments this gives us. Shoot for 20 segments or so. int segments = ( int ) ((yEnd - yStart) / yDelta); if( segments <= 2 ) { // we need 10 times this many yDelta = yDelta / 10.0; } else if( segments <= 5 ) { // we need 4 times this many yDelta = yDelta / 4.0; } else if( segments <= 10 ) { yDelta = yDelta / 2.0; } // Recalc start and end to match with new delta. yStart = yMin - (yMin % yDelta); yEnd = yMax - (yMax % yDelta) + yDelta; segments = ( int ) ((yEnd - yStart) / yDelta); /* axisProperties = new AxisProperties(yStart, yDelta); axisProperties.setYAxisNumItems(segments); */ } /****************************************************************************************** * Utility method to write the image to file so I do not have to deal with file i/o * every time I write a test. * * @param chart verything that is renderable extends this class. * @param fileName what to name the file * @throws ChartDataException * @throws PropertyException ******************************************************************************************/ static void exportImage( Chart chart, String fileName ) throws ChartDataException, PropertyException { try { FileOutputStream fileOutputStream = new FileOutputStream( fileName ); if( EXTENSION.equals( SVG ) ) { SVGEncoder.encode( chart, fileOutputStream ); } else if( EXTENSION.equals( PNG ) ) { PNGEncoder.encode( chart, fileOutputStream ); } else if( EXTENSION.equals( JPEG ) ) { JPEGEncoder.encode( chart, 1.0f, fileOutputStream ); } else if( EXTENSION.equals( JPEG_LEGACY ) ) { JPEGEncoder13.encode( chart, 1.0f, fileOutputStream ); } else { System.out.println( "unknown file type to encode: " + EXTENSION ); } fileOutputStream.flush(); fileOutputStream.close(); } catch( FileNotFoundException fileNotFoundException ) { fileNotFoundException.printStackTrace(); } catch( IOException ioException ) { ioException.printStackTrace(); } } } jcharts-0.7.5/src/org/jCharts/test/ClusteredBarTestDriver.java0000644000175000001440000001462407751071402023415 0ustar onkarusers/*********************************************************************************************** * File Info: $Id: ClusteredBarTestDriver.java,v 1.12 2003/04/19 01:40:06 nathaniel_auvil Exp $ * Copyright (C) 2000 * Author: Nathaniel G. Auvil * Contributor(s): * * Copyright 2002 (C) Nathaniel G. Auvil. All Rights Reserved. * * Redistribution and use of this software and associated documentation * ("Software"), with or without modification, are permitted provided * that the following conditions are met: * * 1. Redistributions of source code must retain copyright * statements and notices. Redistributions must also contain a * copy of this document. * * 2. Redistributions in binary form must reproduce the * above copyright notice, this list of conditions and the * following disclaimer in the documentation and/or other * materials provided with the distribution. * * 3. The name "jCharts" or "Nathaniel G. Auvil" must not be used to * endorse or promote products derived from this Software without * prior written permission of Nathaniel G. Auvil. For written * permission, please contact nathaniel_auvil@users.sourceforge.net * * 4. Products derived from this Software may not be called "jCharts" * nor may "jCharts" appear in their names without prior written * permission of Nathaniel G. Auvil. jCharts is a registered * trademark of Nathaniel G. Auvil. * * 5. Due credit should be given to the jCharts Project * (http://jcharts.sourceforge.net/). * * THIS SOFTWARE IS PROVIDED BY Nathaniel G. Auvil AND CONTRIBUTORS * ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT * NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL * jCharts OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED * OF THE POSSIBILITY OF SUCH DAMAGE. ************************************************************************************************/ package org.jCharts.test; import org.jCharts.chartData.*; import org.jCharts.chartData.interfaces.IAxisDataSeries; import org.jCharts.properties.*; import org.jCharts.properties.util.ChartStroke; import org.jCharts.types.ChartType; import org.jCharts.axisChart.customRenderers.axisValue.renderers.*; import org.jCharts.axisChart.AxisChart; import java.awt.*; /****************************************************************************************** * This file provides examples of how to create all the different chart types provided by * this package. * *******************************************************************************************/ class ClusteredBarTestDriver extends AxisChartTestBase { boolean supportsImageMap() { return true; } /****************************************************************************************** * * ******************************************************************************************/ DataSeries getDataSeries() throws ChartDataException { ClusteredBarChartProperties clusteredBarChartProperties; DataSeries dataSeries; AxisChartDataSet axisChartDataSet; int dataSize = ( int ) TestDataGenerator.getRandomNumber( 1, 10 ); int numberOfDataSets = ( int ) TestDataGenerator.getRandomNumber( 1, 4 ); dataSeries = super.createDataSeries( dataSize ); clusteredBarChartProperties = new ClusteredBarChartProperties(); axisChartDataSet = super.createAxisChartDataSet( ChartType.BAR_CLUSTERED, clusteredBarChartProperties, numberOfDataSets, dataSize, -5000, 5000 ); dataSeries.addIAxisPlotDataSet( axisChartDataSet ); return dataSeries; } /***************************************************************************************** * * @param args * @throws org.jCharts.properties.PropertyException * @throws ChartDataException *****************************************************************************************/ public static void main( String[] args ) throws PropertyException, ChartDataException { ClusteredBarChartProperties clusteredBarChartProperties = new ClusteredBarChartProperties(); //BackgroundRenderer backgroundRenderer = new BackgroundRenderer( new Color( 20, 20, 20, 50 ) ); //clusteredBarChartProperties.addPreRenderEventListener( backgroundRenderer ); ValueLabelRenderer valueLabelRenderer = new ValueLabelRenderer( false, true, true, -1 ); valueLabelRenderer.setValueLabelPosition( ValueLabelPosition.ON_TOP ); valueLabelRenderer.useVerticalLabels( false ); clusteredBarChartProperties.addPostRenderEventListener( valueLabelRenderer ); double[][] data = {{280, 16, -150, 90}, {80, 216, -10, 30} }; Paint[] paints = {Color.yellow, Color.blue }; String[] legendLabels = {"Test Legend Label", "other data"}; AxisChartDataSet axisChartDataSet = new AxisChartDataSet( data, legendLabels, paints, ChartType.BAR_CLUSTERED, clusteredBarChartProperties ); String[] axisLabels = {"1900", "1950", "2000", "2050"}; IAxisDataSeries dataSeries = new DataSeries( axisLabels, "Cookies", "Years", null ); dataSeries.addIAxisPlotDataSet( axisChartDataSet ); ChartProperties chartProperties = new ChartProperties(); AxisProperties axisProperties = new AxisProperties( true ); axisProperties.getYAxisProperties().setShowGridLines( AxisTypeProperties.GRID_LINES_NONE ); axisProperties.getYAxisProperties().setAxisStroke( new ChartStroke( new BasicStroke( 1.5f ), Color.red ) ); DataAxisProperties xAxis = (DataAxisProperties) axisProperties.getXAxisProperties(); xAxis.setRoundToNearest( 1 ); //xAxis.setUserDefinedScale( -300, 200 ); LegendProperties legendProperties = null; //new LegendProperties(); AxisChart axisChart = new AxisChart( dataSeries, chartProperties, axisProperties, legendProperties, 500, 400 ); ChartTestDriver.exportImage( axisChart, "ClusteredBarChartTest.png" ); } } jcharts-0.7.5/src/org/jCharts/test/ComboTestDriver.java0000644000175000001440000001127107751071402022070 0ustar onkarusers/*********************************************************************************************** * File Info: $Id: ComboTestDriver.java,v 1.5 2003/03/31 00:26:42 nathaniel_auvil Exp $ * Copyright (C) 2000 * Author: Nathaniel G. Auvil * Contributor(s): * * Copyright 2002 (C) Nathaniel G. Auvil. All Rights Reserved. * * Redistribution and use of this software and associated documentation * ("Software"), with or without modification, are permitted provided * that the following conditions are met: * * 1. Redistributions of source code must retain copyright * statements and notices. Redistributions must also contain a * copy of this document. * * 2. Redistributions in binary form must reproduce the * above copyright notice, this list of conditions and the * following disclaimer in the documentation and/or other * materials provided with the distribution. * * 3. The name "jCharts" or "Nathaniel G. Auvil" must not be used to * endorse or promote products derived from this Software without * prior written permission of Nathaniel G. Auvil. For written * permission, please contact nathaniel_auvil@users.sourceforge.net * * 4. Products derived from this Software may not be called "jCharts" * nor may "jCharts" appear in their names without prior written * permission of Nathaniel G. Auvil. jCharts is a registered * trademark of Nathaniel G. Auvil. * * 5. Due credit should be given to the jCharts Project * (http://jcharts.sourceforge.net/). * * THIS SOFTWARE IS PROVIDED BY Nathaniel G. Auvil AND CONTRIBUTORS * ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT * NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL * jCharts OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED * OF THE POSSIBILITY OF SUCH DAMAGE. ************************************************************************************************/ package org.jCharts.test; import org.jCharts.chartData.*; import org.jCharts.types.ChartType; import org.jCharts.properties.StockChartProperties; import java.awt.*; /****************************************************************************************** * This file provides examples of how to create all the different chart types provided by * this package. * *******************************************************************************************/ public final class ComboTestDriver extends AxisChartTestBase { boolean supportsImageMap() { return false; } /****************************************************************************************** * Test for LineChart * ******************************************************************************************/ DataSeries getDataSeries() throws ChartDataException { int dataSize= 10; //(int) TestDataGenerator.getRandomNumber( 2, 15 ); int numberOfDataSets=1; //(int) TestDataGenerator.getRandomNumber( 1, 3 ); AxisChartDataSet axisChartDataSet; DataSeries dataSeries=super.createDataSeries( dataSize ); double[] highs=TestDataGenerator.getRandomNumbers( dataSize, 500, 1000 ); double[] lows=TestDataGenerator.getRandomNumbers( dataSize, 100, 300 ); double[] opens=TestDataGenerator.getRandomNumbers( dataSize, 350, 450 ); double[] closes=TestDataGenerator.getRandomNumbers( dataSize, 350, 450 ); StockChartProperties stockChartProperties=new StockChartProperties(); StockChartDataSet stockChartDataSet=new StockChartDataSet( highs, "High", lows, "Low", Color.black, stockChartProperties ); stockChartDataSet.setOpenValues( opens, "Open", Color.red ); stockChartDataSet.setCloseValues( closes, "Close", Color.green ); String[] legendLabels=TestDataGenerator.getRandomStrings( numberOfDataSets, 10, false ); Paint[] paints=TestDataGenerator.getRandomPaints( numberOfDataSets ); dataSeries.addIAxisPlotDataSet( stockChartDataSet ); axisChartDataSet=super.createAxisChartDataSet( ChartType.LINE, LineTestDriver.getChartTypeProperties( 2 ), 2, dataSize, 0, 5000 ); dataSeries.addIAxisPlotDataSet( axisChartDataSet ); return dataSeries; } } jcharts-0.7.5/src/org/jCharts/test/HTMLChartTestable.java0000644000175000001440000000642107751071402022230 0ustar onkarusers/*********************************************************************************************** * File: HTMLChartTestable.java * Last Modified: $Id: HTMLChartTestable.java,v 1.3 2003/02/09 22:59:12 nathaniel_auvil Exp $ * Copyright (C) 2000 * Author: Nathaniel G. Auvil * Contributor(s): * * Copyright 2002 (C) Nathaniel G. Auvil. All Rights Reserved. * * Redistribution and use of this software and associated documentation * ("Software"), with or without modification, are permitted provided * that the following conditions are met: * * 1. Redistributions of source code must retain copyright * statements and notices. Redistributions must also contain a * copy of this document. * * 2. Redistributions in binary form must reproduce the * above copyright notice, this list of conditions and the * following disclaimer in the documentation and/or other * materials provided with the distribution. * * 3. The name "jCharts" or "Nathaniel G. Auvil" must not be used to * endorse or promote products derived from this Software without * prior written permission of Nathaniel G. Auvil. For written * permission, please contact nathaniel_auvil@users.sourceforge.net * * 4. Products derived from this Software may not be called "jCharts" * nor may "jCharts" appear in their names without prior written * permission of Nathaniel G. Auvil. jCharts is a registered * trademark of Nathaniel G. Auvil. * * 5. Due credit should be given to the jCharts Project * (http://jcharts.sourceforge.net/). * * THIS SOFTWARE IS PROVIDED BY Nathaniel G. Auvil AND CONTRIBUTORS * ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT * NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL * jCharts OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED * OF THE POSSIBILITY OF SUCH DAMAGE. ************************************************************************************************/ package org.jCharts.test; import org.jCharts.imageMap.ImageMap; /********************************************************************************************* * Interface class for Chart Objects that can be displayed in a jCharts test. * **********************************************************************************************/ public interface HTMLChartTestable { /***************************************************************************************** * * @param htmlGenerator * @param imageFileName the name of the output test image * @param imageMap if this is NULL we are not creating image map data in html ******************************************************************************************/ public void toHTML( HTMLGenerator htmlGenerator, String imageFileName, ImageMap imageMap ); }jcharts-0.7.5/src/org/jCharts/test/HTMLGenerator.java0000644000175000001440000003370007751071402021431 0ustar onkarusers/*********************************************************************************************** * File: HTMLGenerator.java * Last Modified: $Id: HTMLGenerator.java,v 1.5 2003/02/09 22:59:12 nathaniel_auvil Exp $ * Copyright (C) 2000 * Author: Nathaniel G. Auvil * Contributor(s): * * Copyright 2002 (C) Nathaniel G. Auvil. All Rights Reserved. * * Redistribution and use of this software and associated documentation * ("Software"), with or without modification, are permitted provided * that the following conditions are met: * * 1. Redistributions of source code must retain copyright * statements and notices. Redistributions must also contain a * copy of this document. * * 2. Redistributions in binary form must reproduce the * above copyright notice, this list of conditions and the * following disclaimer in the documentation and/or other * materials provided with the distribution. * * 3. The name "jCharts" or "Nathaniel G. Auvil" must not be used to * endorse or promote products derived from this Software without * prior written permission of Nathaniel G. Auvil. For written * permission, please contact nathaniel_auvil@users.sourceforge.net * * 4. Products derived from this Software may not be called "jCharts" * nor may "jCharts" appear in their names without prior written * permission of Nathaniel G. Auvil. jCharts is a registered * trademark of Nathaniel G. Auvil. * * 5. Due credit should be given to the jCharts Project * (http://jcharts.sourceforge.net/). * * THIS SOFTWARE IS PROVIDED BY Nathaniel G. Auvil AND CONTRIBUTORS * ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT * NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL * jCharts OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED * OF THE POSSIBILITY OF SUCH DAMAGE. ************************************************************************************************/ package org.jCharts.test; import org.jCharts.imageMap.ImageMapArea; import org.jCharts.imageMap.ImageMap; import java.io.FileWriter; import java.util.Iterator; /********************************************************************************************* * Utility class for viewing a series of tests. * **********************************************************************************************/ final public class HTMLGenerator { private String fileName; private StringBuffer stringBuffer; /***************************************************************************************** * * @param fileName the name of the file to write to. ******************************************************************************************/ public HTMLGenerator( String fileName ) { this.fileName = fileName; this.stringBuffer = new StringBuffer( 1024 ); this.stringBuffer.append( "" ); } /***************************************************************************************** * Adds passed field to table. Use reflection to get the fields. * * @param name * @param object ******************************************************************************************/ public void addField( String name, Object object ) { if( object instanceof boolean[] ) { this.addTableRow( name, HTMLGenerator.arrayToString( ( boolean[] ) object ) ); } else if( object instanceof int[] ) { this.addTableRow( name, HTMLGenerator.arrayToString( ( int[] ) object ) ); } else if( object instanceof double[] ) { this.addTableRow( name, HTMLGenerator.arrayToString( ( double[] ) object ) ); } else if( object instanceof float[] ) { this.addTableRow( name, HTMLGenerator.arrayToString( ( float[] ) object ) ); } else if( object instanceof Object[] ) { this.addTableRow( name, HTMLGenerator.arrayToString( ( Object[] ) object ) ); } else { this.addTableRow( name, object ); } } /***************************************************************************************** * Adds a String * ******************************************************************************************/ public void addString( Object object ) { this.stringBuffer.append( ( object != null ) ? object.toString() : "NULL" ); } /***************************************************************************************** * Adds a String * ******************************************************************************************/ public void addString( String label, Object object ) { this.addString( "" ); this.stringBuffer.append( label ); this.addString( "" ); this.stringBuffer.append( object.toString() ); } /***************************************************************************************** * Adds an Array * * @param object ******************************************************************************************/ public static String arrayToString( Object[] object ) { if( object == null ) { return null; } StringBuffer stringBuffer = new StringBuffer( 200 ); for( int i = 0; i < object.length; i++ ) { stringBuffer.append( object[ i ].toString() ); if( i < object.length - 1 ) { stringBuffer.append( ", " ); } } return stringBuffer.toString(); } /***************************************************************************************** * Adds an Array * * @param array ******************************************************************************************/ public static String arrayToString( boolean[] array ) { StringBuffer stringBuffer = new StringBuffer( 100 ); for( int i = 0; i < array.length; i++ ) { stringBuffer.append( new Boolean( array[ i ] ).toString() ); if( i < array.length - 1 ) { stringBuffer.append( ", " ); } } return stringBuffer.toString(); } /***************************************************************************************** * Adds an Array * * @param values ******************************************************************************************/ public static String arrayToString( double[] values ) { StringBuffer stringBuffer = new StringBuffer( 200 ); for( int i = 0; i < values.length; i++ ) { stringBuffer.append( Double.toString( values[ i ] ) ); if( i < values.length - 1 ) { stringBuffer.append( ", " ); } } return stringBuffer.toString(); } /***************************************************************************************** * Adds an Array * * @param values ******************************************************************************************/ public static String arrayToString( double[][] values ) { StringBuffer stringBuffer = new StringBuffer( 400 ); for( int i = 0; i < values.length; i++ ) { stringBuffer.append( " { " ); for( int j = 0; j < values[ 0 ].length; j++ ) { stringBuffer.append( values[ i ][ j ] ); if( j < values[ 0 ].length - 1 ) { stringBuffer.append( ", " ); } } stringBuffer.append( " }
    " ); } return stringBuffer.toString(); } /***************************************************************************************** * Adds an Array * * @param values ******************************************************************************************/ public static String arrayToString( float[] values ) { StringBuffer stringBuffer = new StringBuffer( 200 ); for( int i = 0; i < values.length; i++ ) { stringBuffer.append( Float.toString( values[ i ] ) ); if( i < values.length - 1 ) { stringBuffer.append( ", " ); } } return stringBuffer.toString(); } /***************************************************************************************** * Adds an Array * * @param values ******************************************************************************************/ public static String arrayToString( int[] values ) { StringBuffer stringBuffer = new StringBuffer( 200 ); for( int i = 0; i < values.length; i++ ) { stringBuffer.append( Integer.toString( values[ i ] ) ); if( i < values.length - 1 ) { stringBuffer.append( ", " ); } } return stringBuffer.toString(); } /***************************************************************************************** * Adds an image * ******************************************************************************************/ public void addImage( String fileName, ImageMap imageMap ) { this.stringBuffer.append( "" ); if( imageMap != null ) { this.addImageMapData( imageMap, fileName ); } } private void addImageMapData( ImageMap imageMap, String fileName ) { this.stringBuffer.append( "" ); Iterator iterator = imageMap.getIterator(); while( iterator.hasNext() ) { ImageMapArea imageMapArea = ( ImageMapArea ) iterator.next(); StringBuffer html = new StringBuffer( 50 ); html.append( "href=\"javascript:alert( 'value= " ); html.append( imageMapArea.getValue() ); html.append( ", legend label= " ); html.append( imageMapArea.getLengendLabel() ); html.append( ", axis label= " ); html.append( imageMapArea.getXAxisLabel() ); html.append( "');\"" ); this.stringBuffer.append( imageMapArea.toHTML( html.toString() ) ); } this.stringBuffer.append( "" ); } /***************************************************************************************** * Add line break * ******************************************************************************************/ public void addLineBreak() { this.stringBuffer.append( "
    " ); } /***************************************************************************************** * Writes the file. * ******************************************************************************************/ public void saveFile() { this.stringBuffer.append( "" ); try { FileWriter fileWriter = new FileWriter( this.fileName ); fileWriter.write( this.stringBuffer.toString() ); fileWriter.flush(); fileWriter.close(); } catch( Throwable throwable ) { throwable.printStackTrace(); } } /***************************************************************************************** * * @param label * @param value ******************************************************************************************/ public void addTableRow( String label, Object value ) { this.addString( "" ); this.addString( label ); this.addString( "" ); this.addString( value ); this.addString( "" ); } /***************************************************************************************** * * @param propertiesName ******************************************************************************************/ public void propertiesTableStart( String propertiesName ) { this.addString( "" ); this.addString( "" ); } public void propertiesTableEnd() { this.addString( "
    " + propertiesName + "
    " ); } public void propertiesTableRowStart() { this.addString( "" ); } public void propertiesTableRowEnd() { this.addString( "" ); } /***************************************************************************************** * * @param chartName * @param imageFileName * @param imageMap if this is NULL we are not creating image map data in html ******************************************************************************************/ public void chartTableStart( String chartName, String imageFileName, ImageMap imageMap ) { this.addString( "" ); this.addString( "" ); this.addString( "" ); } public void chartTableEnd() { this.addString( "
    " + chartName + "
    " ); this.addImage( imageFileName, imageMap ); this.addString( "
    " ); } public void chartTableRowStart() { this.addString( "" ); } public void chartTableRowEnd() { this.addString( "" ); } /***************************************************************************************** * ******************************************************************************************/ public void legendTableStart() { this.addString( "" ); this.addString( "" ); } public void legendTableEnd() { this.addString( "
    Legend
    " ); } public void innerTableRowStart() { this.addString( "" ); } public void innerTableRowEnd() { this.addString( "" ); } }jcharts-0.7.5/src/org/jCharts/test/HTMLTestable.java0000644000175000001440000000615407751071402021251 0ustar onkarusers/*********************************************************************************************** * File: HTMLTestable.java * Last Modified: $Id: HTMLTestable.java,v 1.2 2002/10/14 20:52:05 nathaniel_auvil Exp $ * Copyright (C) 2000 * Author: Nathaniel G. Auvil * Contributor(s): * * Copyright 2002 (C) Nathaniel G. Auvil. All Rights Reserved. * * Redistribution and use of this software and associated documentation * ("Software"), with or without modification, are permitted provided * that the following conditions are met: * * 1. Redistributions of source code must retain copyright * statements and notices. Redistributions must also contain a * copy of this document. * * 2. Redistributions in binary form must reproduce the * above copyright notice, this list of conditions and the * following disclaimer in the documentation and/or other * materials provided with the distribution. * * 3. The name "jCharts" or "Nathaniel G. Auvil" must not be used to * endorse or promote products derived from this Software without * prior written permission of Nathaniel G. Auvil. For written * permission, please contact nathaniel_auvil@users.sourceforge.net * * 4. Products derived from this Software may not be called "jCharts" * nor may "jCharts" appear in their names without prior written * permission of Nathaniel G. Auvil. jCharts is a registered * trademark of Nathaniel G. Auvil. * * 5. Due credit should be given to the jCharts Project * (http://jcharts.sourceforge.net/). * * THIS SOFTWARE IS PROVIDED BY Nathaniel G. Auvil AND CONTRIBUTORS * ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT * NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL * jCharts OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED * OF THE POSSIBILITY OF SUCH DAMAGE. ************************************************************************************************/ package org.jCharts.test; /********************************************************************************************* * Interface class for Objects that can be displayed in a jCharts test. * **********************************************************************************************/ public interface HTMLTestable { /********************************************************************************************* * Enables the testing routines to display the contents of this Object. * * @param htmlGenerator **********************************************************************************************/ public void toHTML( HTMLGenerator htmlGenerator ); }jcharts-0.7.5/src/org/jCharts/test/LineTestDriver.java0000644000175000001440000001614707751071402021727 0ustar onkarusers/*********************************************************************************************** * File Info: $Id: LineTestDriver.java,v 1.12 2003/03/31 00:26:42 nathaniel_auvil Exp $ * Copyright (C) 2000 * Author: Nathaniel G. Auvil * Contributor(s): * * Copyright 2002 (C) Nathaniel G. Auvil. All Rights Reserved. * * Redistribution and use of this software and associated documentation * ("Software"), with or without modification, are permitted provided * that the following conditions are met: * * 1. Redistributions of source code must retain copyright * statements and notices. Redistributions must also contain a * copy of this document. * * 2. Redistributions in binary form must reproduce the * above copyright notice, this list of conditions and the * following disclaimer in the documentation and/or other * materials provided with the distribution. * * 3. The name "jCharts" or "Nathaniel G. Auvil" must not be used to * endorse or promote products derived from this Software without * prior written permission of Nathaniel G. Auvil. For written * permission, please contact nathaniel_auvil@users.sourceforge.net * * 4. Products derived from this Software may not be called "jCharts" * nor may "jCharts" appear in their names without prior written * permission of Nathaniel G. Auvil. jCharts is a registered * trademark of Nathaniel G. Auvil. * * 5. Due credit should be given to the jCharts Project * (http://jcharts.sourceforge.net/). * * THIS SOFTWARE IS PROVIDED BY Nathaniel G. Auvil AND CONTRIBUTORS * ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT * NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL * jCharts OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED * OF THE POSSIBILITY OF SUCH DAMAGE. ************************************************************************************************/ package org.jCharts.test; import org.jCharts.axisChart.AxisChart; import org.jCharts.chartData.*; import org.jCharts.properties.*; import org.jCharts.types.ChartType; import java.awt.*; /****************************************************************************************** * This file provides examples of how to create all the different chart types provided by * this package. * *******************************************************************************************/ class LineTestDriver extends AxisChartTestBase { boolean supportsImageMap() { return true; } /****************************************************************************************** * Separate this so can use for combo chart test * * @param numberOfDataSets ******************************************************************************************/ static ChartTypeProperties getChartTypeProperties( int numberOfDataSets ) { Stroke[] strokes = new Stroke[ numberOfDataSets ]; for( int j = 0; j < numberOfDataSets; j++ ) { strokes[ j ] = LineChartProperties.DEFAULT_LINE_STROKE; } strokes[ 0 ] = new BasicStroke( 3.0f ); Shape[] shapes = new Shape[ numberOfDataSets ]; for( int j = 0; j < numberOfDataSets; j++ ) { shapes[ j ] = PointChartProperties.SHAPE_DIAMOND; } shapes[ 0 ] = PointChartProperties.SHAPE_CIRCLE; return new LineChartProperties( strokes, shapes ); } /****************************************************************************************** * * ******************************************************************************************/ DataSeries getDataSeries() throws ChartDataException { DataSeries dataSeries; AxisChartDataSet axisChartDataSet; int dataSize = (int) TestDataGenerator.getRandomNumber( 3, 3 ); int numberOfDataSets = ( int ) TestDataGenerator.getRandomNumber( 1, 1 ); dataSeries = super.createDataSeries( dataSize ); axisChartDataSet = super.createAxisChartDataSet( ChartType.LINE, getChartTypeProperties( numberOfDataSets ), numberOfDataSets, dataSize, 10, 5000 ); dataSeries.addIAxisPlotDataSet( axisChartDataSet ); return dataSeries; } /****************************************************************************************** * * ****************************************************************************************** DataSeries getDataSeries() throws ChartDataException { String[] xAxisLabels={"1", "2", "3", "4", "5"}; DataSeries dataSeries=new DataSeries( xAxisLabels, "numbers", "numbers", "Bug #559177" ); AxisChartDataSet axisChartDataSet; double[][] data={{1, 2, 3, 4, 5}, {7, 8, Double.NaN, Double.NaN, Double.NaN}, {Double.NaN, Double.NaN, Double.NaN, Double.NaN, 2}}; String[] legendLabels={"set 1", "set 2", "set 3"}; Paint[] paints={Color.blue, Color.red, Color.green}; axisChartDataSet=new AxisChartDataSet( data, legendLabels, paints, ChartType.LINE, this.getChartTypeProperties( 3 ) ); dataSeries.addIAxisPlotDataSet( axisChartDataSet ); return dataSeries; } */ public static void main( String[] args ) throws ChartDataException, PropertyException { LineChartProperties lineChartProperties= (LineChartProperties) getChartTypeProperties( 1 ); double[][] data= { { 280, 16, 150, 90 } }; Paint[] paints= { Color.blue }; String[] legendLabels= { "Test Legend Label" }; AxisChartDataSet axisChartDataSet = new AxisChartDataSet( data, legendLabels, paints, ChartType.LINE, lineChartProperties ); String[] axisLabels= null; //{ "1900", "1950", "2000", "2050" }; DataSeries dataSeries = new DataSeries( axisLabels, "X-Axis Title", "Y-Axis Title", "Chart Title" ); dataSeries.addIAxisPlotDataSet( axisChartDataSet ); ChartProperties chartProperties= new ChartProperties(); AxisProperties axisProperties= new AxisProperties( false ); axisProperties.getYAxisProperties().setShowAxisLabels( false ); axisProperties.getXAxisProperties().setShowAxisLabels( false ); DataAxisProperties yAxis= (DataAxisProperties) axisProperties.getYAxisProperties(); yAxis.setUserDefinedScale( -10, 50 ); yAxis.setNumItems( 4 ); yAxis.setRoundToNearest( 1 ); LegendProperties legendProperties= new LegendProperties(); AxisChart axisChart= new AxisChart( dataSeries, chartProperties, axisProperties, legendProperties, 500, 400 ); ChartTestDriver.exportImage( axisChart, "LineChartTest.png" ); } } jcharts-0.7.5/src/org/jCharts/test/PieTestDriver.java0000644000175000001440000001706507751071402021555 0ustar onkarusers/*********************************************************************************************** * File Info: $Id: PieTestDriver.java,v 1.9 2003/03/31 00:26:42 nathaniel_auvil Exp $ * Copyright (C) 2002 * Author: Nathaniel G. Auvil * Contributor(s): * * Copyright 2002 (C) Nathaniel G. Auvil. All Rights Reserved. * * Redistribution and use of this software and associated documentation ("Software"), with or * without modification, are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain copyright statements and notices. * Redistributions must also contain a copy of this document. * * 2. Redistributions in binary form must reproduce the above copyright notice, this list of * conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. * * 3. The name "jCharts" or "Nathaniel G. Auvil" must not be used to endorse or promote * products derived from this Software without prior written permission of Nathaniel G. * Auvil. For written permission, please contact nathaniel_auvil@users.sourceforge.net * * 4. Products derived from this Software may not be called "jCharts" nor may "jCharts" appear * in their names without prior written permission of Nathaniel G. Auvil. jCharts is a * registered trademark of Nathaniel G. Auvil. * * 5. Due credit should be given to the jCharts Project (http://jcharts.sourceforge.net/). * * THIS SOFTWARE IS PROVIDED BY Nathaniel G. Auvil AND CONTRIBUTORS ``AS IS'' AND ANY * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL * jCharts OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE ************************************************************************************************/ package org.jCharts.test; import org.jCharts.chartData.ChartDataException; import org.jCharts.chartData.PieChartDataSet; import org.jCharts.nonAxisChart.PieChart2D; import org.jCharts.properties.*; import org.jCharts.properties.util.ChartStroke; import org.jCharts.imageMap.ImageMap; import org.jCharts.types.PieLabelType; import java.awt.*; /****************************************************************************************** * This file provides examples of how to create all the different chart types provided by * this package. * *******************************************************************************************/ abstract class PieTestDriver { /****************************************************************************************** * Test for PieChart2D * * @throws ChartDataException ******************************************************************************************/ static void test() throws ChartDataException, PropertyException { PieChart2D pieChart2D; PieChartDataSet pieChartDataSet; LegendProperties legendProperties; ChartProperties chartProperties; int dataSize; int width; int height; int numTestsToRun = 15; String fileName; HTMLGenerator htmlGenerator = new HTMLGenerator( ChartTestDriver.OUTPUT_PATH + "pieChart2dTest.html" ); for( int i = 0; i < numTestsToRun; i++ ) { boolean createImageMap = true; //( TestDataGenerator.getRandomNumber( 1 ) > 0.5d ); dataSize = (int) TestDataGenerator.getRandomNumber( 1, 10 ); pieChartDataSet = PieTestDriver.getPieChartDataSet( dataSize, 1, 7 ); width = (int) TestDataGenerator.getRandomNumber( 100, 600 ); height = (int) TestDataGenerator.getRandomNumber( 100, 600 ); legendProperties = new LegendProperties(); TestDataGenerator.randomizeLegend( legendProperties ); //legendProperties.setBorderStroke( new BasicStroke( 2.0f ) ); chartProperties = new ChartProperties(); //areaProperties.setEdgePadding( (int) TestDataGenerator.getRandomNumber( 0, 50 ) ); chartProperties.setBackgroundPaint( TestDataGenerator.getRandomPaint() ); //chartProperties.setBorderStroke( new BasicStroke( 1f ) ); pieChart2D = new PieChart2D( pieChartDataSet, legendProperties, chartProperties, width, height ); fileName = ChartTestDriver.OUTPUT_PATH + "pieChart2d" + i + ChartTestDriver.EXTENSION; ImageMap imageMap; if( createImageMap ) { pieChart2D.renderWithImageMap(); imageMap = pieChart2D.getImageMap(); } else { imageMap = null; } ChartTestDriver.exportImage( pieChart2D, fileName ); htmlGenerator.chartTableStart( "PieChart2D", fileName, imageMap ); htmlGenerator.propertiesTableRowStart(); pieChartDataSet.toHTML( htmlGenerator ); htmlGenerator.propertiesTableRowStart(); pieChart2D.toHTML( htmlGenerator, fileName ); htmlGenerator.addLineBreak(); } htmlGenerator.saveFile(); } /***************************************************************************************** * Generates a random NonAxisChartDataSet * * @param numToCreate the number of doubles to generate * @param minValue * @param maxValue * @return PieChartDataSet ******************************************************************************************/ private static PieChartDataSet getPieChartDataSet( int numToCreate, int minValue, int maxValue ) throws ChartDataException { PieChart2DProperties properties = new PieChart2DProperties(); //properties.setZeroDegreeOffset( (float) TestDataGenerator.getRandomNumber( 0, 500 ) ); properties.setBorderPaint( TestDataGenerator.getRandomPaint() ); String[] labels = TestDataGenerator.getRandomStrings( numToCreate, (int) TestDataGenerator.getRandomNumber( 3, 20 ), false ); Paint[] paints = TestDataGenerator.getRandomPaints( numToCreate ); return new PieChartDataSet( "This is a test title", TestDataGenerator.getRandomNumbers( numToCreate, minValue, maxValue ), labels, paints, properties ); } public static void main( String[] args ) throws ChartDataException, PropertyException { double[] data = {73.6d, 5.00d, 1.50d, 3.60d}; String[] labels = {"Equities", "Bonds", "Money Market", "Alternative Investments"}; Paint[] paints = {Color.lightGray, Color.green, Color.blue, Color.red}; PieChart2DProperties pieChart2DProperties = new PieChart2DProperties(); pieChart2DProperties.setPieLabelType( PieLabelType.VALUE_LABELS ); pieChart2DProperties.setZeroDegreeOffset( 110 ); LegendProperties legendProperties = new LegendProperties(); legendProperties.setPlacement( LegendAreaProperties.RIGHT ); legendProperties.setNumColumns( 1 ); //legendProperties.setBorderStroke( null ); PieChartDataSet pieChartDataSet = new PieChartDataSet( "Investment Categories", data, labels, paints, pieChart2DProperties ); ChartProperties chartProperties = new ChartProperties(); chartProperties.setBorderStroke( ChartStroke.DEFAULT_CHART_OUTLINE ); PieChart2D pieChart = new PieChart2D( pieChartDataSet, legendProperties, chartProperties, 520, 520 ); //PieChart2D pieChart = new PieChart2D( pieChartDataSet, null, chartProperties, 520, 520 ); ChartTestDriver.exportImage( pieChart, "pie.png" ); } } jcharts-0.7.5/src/org/jCharts/test/PointTestDriver.java0000644000175000001440000001647007751071402022130 0ustar onkarusers/*********************************************************************************************** * File Info: $Id: PointTestDriver.java,v 1.6 2003/03/31 00:26:42 nathaniel_auvil Exp $ * Copyright (C) 2000 * Author: Nathaniel G. Auvil * Contributor(s): * * Copyright 2002 (C) Nathaniel G. Auvil. All Rights Reserved. * * Redistribution and use of this software and associated documentation * ("Software"), with or without modification, are permitted provided * that the following conditions are met: * * 1. Redistributions of source code must retain copyright * statements and notices. Redistributions must also contain a * copy of this document. * * 2. Redistributions in binary form must reproduce the * above copyright notice, this list of conditions and the * following disclaimer in the documentation and/or other * materials provided with the distribution. * * 3. The name "jCharts" or "Nathaniel G. Auvil" must not be used to * endorse or promote products derived from this Software without * prior written permission of Nathaniel G. Auvil. For written * permission, please contact nathaniel_auvil@users.sourceforge.net * * 4. Products derived from this Software may not be called "jCharts" * nor may "jCharts" appear in their names without prior written * permission of Nathaniel G. Auvil. jCharts is a registered * trademark of Nathaniel G. Auvil. * * 5. Due credit should be given to the jCharts Project * (http://jcharts.sourceforge.net/). * * THIS SOFTWARE IS PROVIDED BY Nathaniel G. Auvil AND CONTRIBUTORS * ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT * NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL * jCharts OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED * OF THE POSSIBILITY OF SUCH DAMAGE. ************************************************************************************************/ package org.jCharts.test; import org.jCharts.chartData.*; import org.jCharts.chartData.interfaces.IAxisDataSeries; import org.jCharts.properties.*; import org.jCharts.types.ChartType; import org.jCharts.axisChart.AxisChart; import java.awt.*; /****************************************************************************************** * This file provides examples of how to create all the different chart types provided by * this package. * *******************************************************************************************/ class PointTestDriver extends AxisChartTestBase { boolean supportsImageMap() { return true; } /****************************************************************************************** * Separate this so can use for combo chart test * ******************************************************************************************/ static ChartTypeProperties getChartTypeProperties( int numberOfDataSets ) { //Shape rectangle= new Rectangle2D.Double( 0, 0, 8, 8 ); Shape[] shapes={PointChartProperties.SHAPE_DIAMOND, PointChartProperties.SHAPE_TRIANGLE}; boolean[] fillPointFlags={true, true}; Paint[] outlinePaints={Color.black, Color.blue}; return new PointChartProperties( shapes, fillPointFlags, outlinePaints ); } /********************************************************************************************************* * * *********************************************************************************************************/ DataSeries getDataSeries() throws ChartDataException { int dataSize=(int) TestDataGenerator.getRandomNumber( 13, 15 ); int numberOfDataSets=2; //(int) TestDataGenerator.getRandomNumber( 1, 3 ); DataSeries dataSeries=super.createDataSeries( dataSize ); AxisChartDataSet axisChartDataSet=super.createAxisChartDataSet( ChartType.POINT, getChartTypeProperties( numberOfDataSets ), numberOfDataSets, dataSize, 0, 5000 ); dataSeries.addIAxisPlotDataSet( axisChartDataSet ); return dataSeries; } /***************************************************************************************** * * @param args * @throws org.jCharts.properties.PropertyException * @throws ChartDataException *****************************************************************************************/ public static void main( String[] args ) throws PropertyException, ChartDataException { Shape[] shapes={PointChartProperties.SHAPE_DIAMOND, PointChartProperties.SHAPE_TRIANGLE}; boolean[] fillPointFlags={true, true}; Paint[] outlinePaints={Color.black, Color.blue}; PointChartProperties pointChartProperties= new PointChartProperties( shapes, fillPointFlags, outlinePaints ); //BackgroundRenderer backgroundRenderer = new BackgroundRenderer( new Color( 20, 20, 20, 50 ) ); //clusteredBarChartProperties.addPreRenderEventListener( backgroundRenderer ); /* ValueLabelRenderer valueLabelRenderer = new ValueLabelRenderer( false, true, -1 ); valueLabelRenderer.setValueLabelPosition( ValueLabelPosition.ON_TOP ); valueLabelRenderer.useVerticalLabels( false ); clusteredBarChartProperties.addPostRenderEventListener( valueLabelRenderer ); */ double[][] data = {{280, 16, 150, 90, 60, 200, 150, 60 }, {80, 216, 10, 30, 15, 90, 150, 87 } }; Paint[] paints = {Color.yellow, Color.blue }; String[] legendLabels = {"Test Legend Label", "second set"}; AxisChartDataSet axisChartDataSet = new AxisChartDataSet( data, legendLabels, paints, ChartType.POINT, pointChartProperties ); String[] axisLabels = {"1900", "1950", "2000", "2050", "3000", "3050", "4000", "4050" }; IAxisDataSeries dataSeries = new DataSeries( axisLabels, "Cookies", "Years", null ); dataSeries.addIAxisPlotDataSet( axisChartDataSet ); ChartProperties chartProperties = new ChartProperties(); AxisProperties axisProperties = new AxisProperties( false ); //axisProperties.getXAxisProperties().setShowAxisLabels( false ); //axisProperties.getYAxisProperties().setShowAxisLabels( false ); //axisProperties.getYAxisProperties().setShowTicks( AxisTypeProperties.TICKS_NONE ); //axisProperties.getYAxisProperties().setShowGridLines( AxisTypeProperties.GRID_LINES_NONE ); //axisProperties.getYAxisProperties().setAxisStroke( new ChartStroke( new BasicStroke( 1.5f ), Color.red ) ); /* DataAxisProperties xAxis = (DataAxisProperties) axisProperties.getXAxisProperties(); xAxis.setRoundToNearest( 1 ); xAxis.setUserDefinedScale( -300, 200 ); */ LegendProperties legendProperties = new LegendProperties(); AxisChart axisChart = new AxisChart( dataSeries, chartProperties, axisProperties, legendProperties, 500, 400 ); axisChart.renderWithImageMap(); ChartTestDriver.exportImage( axisChart, "pointChartTest.png" ); } } jcharts-0.7.5/src/org/jCharts/test/ScatterChartTestBase.java0000644000175000001440000002013507751071402023036 0ustar onkarusers/*********************************************************************************************** * File Info: $Id: ScatterChartTestBase.java,v 1.1 2003/11/02 13:22:13 nathaniel_auvil Exp $ * Copyright (C) 2000 * Author: Nathaniel G. Auvil * Contributor(s): * * Copyright 2002 (C) Nathaniel G. Auvil. All Rights Reserved. * * Redistribution and use of this software and associated documentation ("Software"), with or * without modification, are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain copyright statements and notices. * Redistributions must also contain a copy of this document. * * 2. Redistributions in binary form must reproduce the above copyright notice, this list of * conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. * * 3. The name "jCharts" or "Nathaniel G. Auvil" must not be used to endorse or promote * products derived from this Software without prior written permission of Nathaniel G. * Auvil. For written permission, please contact nathaniel_auvil@users.sourceforge.net * * 4. Products derived from this Software may not be called "jCharts" nor may "jCharts" appear * in their names without prior written permission of Nathaniel G. Auvil. jCharts is a * registered trademark of Nathaniel G. Auvil. * * 5. Due credit should be given to the jCharts Project (http://jcharts.sourceforge.net/). * * THIS SOFTWARE IS PROVIDED BY Nathaniel G. Auvil AND CONTRIBUTORS ``AS IS'' AND ANY * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL * jCharts OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE ************************************************************************************************/ package org.jCharts.test; import org.jCharts.axisChart.AxisChart; import org.jCharts.axisChart.ScatterPlotAxisChart; import org.jCharts.chartData.*; import org.jCharts.properties.*; import org.jCharts.types.ChartType; import org.jCharts.imageMap.ImageMap; import java.awt.*; /****************************************************************************************** * * *******************************************************************************************/ abstract class ScatterChartTestBase { public ScatterChartTestBase() { System.out.println( "Running: " + this.getClass().getName() ); } abstract ScatterPlotDataSeries getDataSeries() throws ChartDataException; abstract boolean supportsImageMap(); /****************************************************************************************** * Test for LineChart * ******************************************************************************************/ static void axisChartTest( String name, ScatterChartTestBase axisChartTestBase ) throws ChartDataException, PropertyException { LegendProperties legendProperties; ChartProperties chartProperties; AxisProperties axisProperties; AxisChart axisChart; int numTestsToRun = 10; String fileName; HTMLGenerator htmlGenerator = new HTMLGenerator( ChartTestDriver.OUTPUT_PATH + name + "Test.html" ); for( int i = 0; i < numTestsToRun; i++ ) { ScatterPlotDataSeries dataSeries = axisChartTestBase.getDataSeries(); boolean horizontalPlot = false; //( TestDataGenerator.getRandomNumber( 1 ) > 0.5d ); boolean createImageMap = true;// ( TestDataGenerator.getRandomNumber( 1 ) > 0.5d ); axisProperties = new AxisProperties( new DataAxisProperties(), new DataAxisProperties() ); axisProperties.setXAxisLabelsAreVertical( ( TestDataGenerator.getRandomNumber( 1 ) > 0.5d ) ); TestDataGenerator.randomizeAxisProperties( axisProperties ); //axisProperties.setYAxisNumItems( 6 ); DataAxisProperties dataAxisProperties; if( horizontalPlot ) { dataAxisProperties = (DataAxisProperties) axisProperties.getXAxisProperties(); } else { dataAxisProperties = (DataAxisProperties) axisProperties.getYAxisProperties(); } dataAxisProperties.setRoundToNearest( 1 ); dataAxisProperties.setShowAxisLabels( ( TestDataGenerator.getRandomNumber( 1 ) > 0.5d ) ); int width = (int) TestDataGenerator.getRandomNumber( 500, 1000 ); int height = (int) TestDataGenerator.getRandomNumber( 300, 800 ); legendProperties = new LegendProperties(); //TestDataGenerator.randomizeLegend( legendProperties ); //legendProperties.setPlacement( LegendAreaProperties.RIGHT ); chartProperties = new ChartProperties(); //chartProperties.setBorderStroke( new BasicStroke( 1f ) ); axisChart = new ScatterPlotAxisChart( dataSeries, chartProperties, axisProperties, legendProperties, width, height ); fileName = ChartTestDriver.OUTPUT_PATH + name + i + ChartTestDriver.EXTENSION; ImageMap imageMap; if( createImageMap && axisChartTestBase.supportsImageMap() ) { axisChart.renderWithImageMap(); imageMap = axisChart.getImageMap(); } else { imageMap = null; } try { ChartTestDriver.exportImage( axisChart, fileName ); } catch( NullPointerException nullPointerException ) { nullPointerException.printStackTrace(); System.out.println(); } axisChart.toHTML( htmlGenerator, fileName, imageMap ); htmlGenerator.addLineBreak(); } htmlGenerator.saveFile(); } /***************************************************************************************************** * * *****************************************************************************************************/ final DataSeries createDataSeries( int numberOfValuesToCreate ) { String[] xAxisLabels = null; if( ( TestDataGenerator.getRandomNumber( 1 ) > 0.5d ) ) { xAxisLabels = TestDataGenerator.getRandomStrings( numberOfValuesToCreate, (int) TestDataGenerator.getRandomNumber( 10 ), false ); } String xAxisTitle = TestDataGenerator.getRandomString( 15, true ); String yAxisTitle = TestDataGenerator.getRandomString( 15, true ); return new DataSeries( xAxisLabels, xAxisTitle, yAxisTitle, "This is a test title that is so freaking long is is going to wrap around the image for sure. lfksjg;ljs; dflgkjdfgsdgdg dsgdsgsdfg dsfgsdfgsdfgs dfgdsfgd" ); } /***************************************************************************************** * Generates a random MultiDataSet * * @param numberOfDataSets * @param numberOfValuesToCreate the number of doubles to generate * @param minValue * @param maxValue * @return AxisChartDataSet ******************************************************************************************/ AxisChartDataSet createAxisChartDataSet( ChartType chartType, ChartTypeProperties chartTypeProperties, int numberOfDataSets, int numberOfValuesToCreate, int minValue, int maxValue ) throws ChartDataException { double[][] data = TestDataGenerator.getRandomNumbers( numberOfDataSets, numberOfValuesToCreate, minValue, maxValue ); String[] legendLabels = TestDataGenerator.getRandomStrings( numberOfDataSets, 10, false ); Paint[] paints = TestDataGenerator.getRandomPaints( numberOfDataSets ); /* //data[ 0 ][ 0 ]= Double.NaN; data[ 0 ][ 1 ]= Double.NaN; data[ 0 ][ 4 ]= Double.NaN; data[ 0 ][ 6 ]= Double.NaN; //data[ 0 ][ data[ 0 ].length - 1 ]= Double.NaN; data[ 0 ][ data[ 0 ].length - 2 ]= Double.NaN; */ return new AxisChartDataSet( data, legendLabels, paints, chartType, chartTypeProperties ); } } jcharts-0.7.5/src/org/jCharts/test/ScatterPlotTestDriver.java0000644000175000001440000002170307751071402023276 0ustar onkarusers/*********************************************************************************************** * File Info: $Id: ScatterPlotTestDriver.java,v 1.6 2003/11/02 13:22:31 nathaniel_auvil Exp $ * Copyright (C) 2002 * Author: Nathaniel G. Auvil * Contributor(s): * * Copyright 2002 (C) Nathaniel G. Auvil. All Rights Reserved. * * Redistribution and use of this software and associated documentation ("Software"), with or * without modification, are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain copyright statements and notices. * Redistributions must also contain a copy of this document. * * 2. Redistributions in binary form must reproduce the above copyright notice, this list of * conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. * * 3. The name "jCharts" or "Nathaniel G. Auvil" must not be used to endorse or promote * products derived from this Software without prior written permission of Nathaniel G. * Auvil. For written permission, please contact nathaniel_auvil@users.sourceforge.net * * 4. Products derived from this Software may not be called "jCharts" nor may "jCharts" appear * in their names without prior written permission of Nathaniel G. Auvil. jCharts is a * registered trademark of Nathaniel G. Auvil. * * 5. Due credit should be given to the jCharts Project (http://jcharts.sourceforge.net/). * * THIS SOFTWARE IS PROVIDED BY Nathaniel G. Auvil AND CONTRIBUTORS ``AS IS'' AND ANY * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL * jCharts OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE ************************************************************************************************/ package org.jCharts.test; import org.jCharts.axisChart.AxisChart; import org.jCharts.axisChart.ScatterPlotAxisChart; import org.jCharts.chartData.*; import org.jCharts.properties.*; import org.jCharts.types.ChartType; import java.awt.*; import java.awt.geom.Point2D; /****************************************************************************************** * This file provides examples of how to create all the different chart types provided by * this package. * *******************************************************************************************/ public class ScatterPlotTestDriver extends ScatterChartTestBase { boolean supportsImageMap() { return true; } /****************************************************************************************** * Separate this so can use for combo chart test * * @param numberOfDataSets ******************************************************************************************/ private ScatterPlotProperties getScatterPlotProperties( int numberOfDataSets ) { Stroke[] strokes = new Stroke[ numberOfDataSets ]; for( int j = 0; j < numberOfDataSets; j++ ) { strokes[ j ] = LineChartProperties.DEFAULT_LINE_STROKE; } strokes[ 0 ] = new BasicStroke( 3.0f ); Shape[] shapes = new Shape[ numberOfDataSets ]; for( int j = 0; j < numberOfDataSets; j++ ) { shapes[ j ] = PointChartProperties.SHAPE_DIAMOND; } shapes[ 0 ] = PointChartProperties.SHAPE_CIRCLE; return new ScatterPlotProperties( strokes, shapes ); } /***************************************************************************************** * Generates a random MultiDataSet * * @param numberOfDataSets * @param numberOfValuesToCreate the number of doubles to generate * @param xMinValue * @param xMaxValue * @param yMinValue * @param yMaxValue * @return AxisChartDataSet ******************************************************************************************/ private ScatterPlotDataSet createScatterPlotDataSet( int numberOfDataSets, int numberOfValuesToCreate, int xMinValue, int xMaxValue, int yMinValue, int yMaxValue ) throws ChartDataException { //Point2D.Double[] points= TestDataGenerator.getRandomPoints( numberOfValuesToCreate, xMinValue, xMaxValue, yMinValue, yMaxValue ); Point2D.Double[] points= new Point2D.Double[ numberOfValuesToCreate ]; for( int x = 0; x < numberOfValuesToCreate; x++ ) { //--- y = x^2 points[ x ]= new Point2D.Double(); points[ x ].setLocation( x, Math.pow( x, 2 ) ); } String[] legendLabels = TestDataGenerator.getRandomStrings( numberOfDataSets, 12, false ); Paint[] paints = TestDataGenerator.getRandomPaints( numberOfDataSets ); Paint paint = TestDataGenerator.getRandomPaint(); ScatterPlotDataSet scatterPlotDataSet= new ScatterPlotDataSet( this.getScatterPlotProperties( 1 ) ); scatterPlotDataSet.addDataPoints( points, paint, legendLabels[ 0 ] ); return scatterPlotDataSet; } /****************************************************************************************** * * ******************************************************************************************/ ScatterPlotDataSeries getDataSeries() throws ChartDataException { ScatterPlotDataSeries dataSeries= null; int dataSize = (int) TestDataGenerator.getRandomNumber( 3, 10 ); int numberOfDataSets = (int) TestDataGenerator.getRandomNumber( 1, 1 ); ScatterPlotDataSet scatterPlotDataSet= this.createScatterPlotDataSet( numberOfDataSets, dataSize, 50, 50, 0, 0 ); String[] xAxisLabels = TestDataGenerator.getRandomStrings( dataSize, ( int ) TestDataGenerator.getRandomNumber( 10 ), false ); String xAxisTitle = TestDataGenerator.getRandomString( 15, true ); String yAxisTitle = TestDataGenerator.getRandomString( 15, true ); dataSeries = new ScatterPlotDataSeries( scatterPlotDataSet, xAxisTitle, yAxisTitle, "This is a test title that is so freaking long is is going to wrap around the image for sure. lfksjg;ljs; dflgkjdfgsdgdg dsgdsgsdfg dsfgsdfgsdfgs dfgdsfgd" ); dataSeries.addIAxisPlotDataSet( scatterPlotDataSet ); return dataSeries; } /****************************************************************************************** * * ****************************************************************************************** DataSeries getDataSeries() throws ChartDataException { String[] xAxisLabels={"1", "2", "3", "4", "5"}; DataSeries dataSeries=new DataSeries( xAxisLabels, "numbers", "numbers", "Bug #559177" ); AxisChartDataSet axisChartDataSet; double[][] data={{1, 2, 3, 4, 5}, {7, 8, Double.NaN, Double.NaN, Double.NaN}, {Double.NaN, Double.NaN, Double.NaN, Double.NaN, 2}}; String[] legendLabels={"set 1", "set 2", "set 3"}; Paint[] paints={Color.blue, Color.red, Color.green}; axisChartDataSet=new AxisChartDataSet( data, legendLabels, paints, ChartType.LINE, this.getChartTypeProperties( 3 ) ); dataSeries.addIAxisPlotDataSet( axisChartDataSet ); return dataSeries; } */ public static void main( String[] args ) throws ChartDataException, PropertyException { ScatterPlotTestDriver s= new ScatterPlotTestDriver(); ScatterPlotDataSet scatterPlotDataSet= s.createScatterPlotDataSet( 1, 5, -1000, 3000, 200, 500 ); ScatterPlotDataSeries scatterPlotDataSeries = new ScatterPlotDataSeries( scatterPlotDataSet, "X-Axis Title", "Y-Axis Title", "Chart Title" ); DataAxisProperties xAxisProperties= new DataAxisProperties(); xAxisProperties.setUserDefinedScale( -5, 3 ); xAxisProperties.setNumItems( 10 ); xAxisProperties.setRoundToNearest( 0 ); DataAxisProperties yAxisProperties= new DataAxisProperties(); yAxisProperties.setUserDefinedScale( -30, 50 ); yAxisProperties.setNumItems( 10 ); yAxisProperties.setRoundToNearest( 1 ); AxisProperties axisProperties = new AxisProperties( xAxisProperties, yAxisProperties ); ChartProperties chartProperties = new ChartProperties(); LegendProperties legendProperties = new LegendProperties(); ScatterPlotAxisChart scatterPlotAxisChart = new ScatterPlotAxisChart( scatterPlotDataSeries, chartProperties, axisProperties, legendProperties, 500, 400 ); ChartTestDriver.exportImage( scatterPlotAxisChart, "ScatterPlotTest.png" ); } } jcharts-0.7.5/src/org/jCharts/test/StackedAreaTestDriver.java0000644000175000001440000001124607751071402023202 0ustar onkarusers/*********************************************************************************************** * File Info: $Id: StackedAreaTestDriver.java,v 1.5 2003/03/31 00:26:42 nathaniel_auvil Exp $ * Copyright (C) 2000 * Author: Nathaniel G. Auvil * Contributor(s): * * Copyright 2002 (C) Nathaniel G. Auvil. All Rights Reserved. * * Redistribution and use of this software and associated documentation * ("Software"), with or without modification, are permitted provided * that the following conditions are met: * * 1. Redistributions of source code must retain copyright * statements and notices. Redistributions must also contain a * copy of this document. * * 2. Redistributions in binary form must reproduce the * above copyright notice, this list of conditions and the * following disclaimer in the documentation and/or other * materials provided with the distribution. * * 3. The name "jCharts" or "Nathaniel G. Auvil" must not be used to * endorse or promote products derived from this Software without * prior written permission of Nathaniel G. Auvil. For written * permission, please contact nathaniel_auvil@users.sourceforge.net * * 4. Products derived from this Software may not be called "jCharts" * nor may "jCharts" appear in their names without prior written * permission of Nathaniel G. Auvil. jCharts is a registered * trademark of Nathaniel G. Auvil. * * 5. Due credit should be given to the jCharts Project * (http://jcharts.sourceforge.net/). * * THIS SOFTWARE IS PROVIDED BY Nathaniel G. Auvil AND CONTRIBUTORS * ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT * NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL * jCharts OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED * OF THE POSSIBILITY OF SUCH DAMAGE. ************************************************************************************************/ package org.jCharts.test; import org.jCharts.chartData.*; import org.jCharts.properties.ChartTypeProperties; import org.jCharts.properties.StackedAreaChartProperties; import org.jCharts.types.ChartType; /****************************************************************************************** * This file provides examples of how to create all the different chart types provided by * this package. * *******************************************************************************************/ class StackedAreaTestDriver extends AxisChartTestBase { boolean supportsImageMap() { return false; } /****************************************************************************************** * Separate this so can use for combo chart test * ******************************************************************************************/ static ChartTypeProperties getChartTypeProperties( int numberOfDataSets ) { /* Stroke[] strokes= new Stroke[ numberOfDataSets ]; for( int j=0; j < numberOfDataSets; j++ ) { strokes[ j ]= LineChartProperties.DEFAULT_LINE_STROKE; } strokes[ 0 ]= new BasicStroke( 3.0f ); Shape[] shapes= new Shape[ numberOfDataSets ]; for( int j=0; j < numberOfDataSets; j++ ) { shapes[ j ]= PointChartProperties.SHAPE_DIAMOND; } shapes[ 0 ]= PointChartProperties.SHAPE_CIRCLE; */ return new StackedAreaChartProperties(); } /****************************************************************************************** * * ******************************************************************************************/ DataSeries getDataSeries() throws ChartDataException { DataSeries dataSeries; AxisChartDataSet axisChartDataSet; int dataSize=(int) TestDataGenerator.getRandomNumber( 10, 50 ); int numberOfDataSets=(int) TestDataGenerator.getRandomNumber( 1, 3 ); dataSeries=super.createDataSeries( dataSize ); axisChartDataSet=super.createAxisChartDataSet( ChartType.AREA_STACKED, getChartTypeProperties( numberOfDataSets ), numberOfDataSets, dataSize, 0, 5000 ); dataSeries.addIAxisPlotDataSet( axisChartDataSet ); return dataSeries; } } jcharts-0.7.5/src/org/jCharts/test/StackedBarTestDriver.java0000644000175000001440000001546207751071402023042 0ustar onkarusers/*********************************************************************************************** * File Info: $Id: StackedBarTestDriver.java,v 1.11 2003/11/02 13:22:31 nathaniel_auvil Exp $ * Copyright (C) 2000 * Author: Nathaniel G. Auvil * Contributor(s): * * Copyright 2002 (C) Nathaniel G. Auvil. All Rights Reserved. * * Redistribution and use of this software and associated documentation ("Software"), with or * without modification, are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain copyright statements and notices. * Redistributions must also contain a copy of this document. * * 2. Redistributions in binary form must reproduce the above copyright notice, this list of * conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. * * 3. The name "jCharts" or "Nathaniel G. Auvil" must not be used to endorse or promote * products derived from this Software without prior written permission of Nathaniel G. * Auvil. For written permission, please contact nathaniel_auvil@users.sourceforge.net * * 4. Products derived from this Software may not be called "jCharts" nor may "jCharts" appear * in their names without prior written permission of Nathaniel G. Auvil. jCharts is a * registered trademark of Nathaniel G. Auvil. * * 5. Due credit should be given to the jCharts Project (http://jcharts.sourceforge.net/). * * THIS SOFTWARE IS PROVIDED BY Nathaniel G. Auvil AND CONTRIBUTORS ``AS IS'' AND ANY * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL * jCharts OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE ************************************************************************************************/ package org.jCharts.test; import org.jCharts.chartData.*; import org.jCharts.chartData.interfaces.IAxisDataSeries; import org.jCharts.properties.*; import org.jCharts.properties.util.ChartStroke; import org.jCharts.types.ChartType; import org.jCharts.axisChart.customRenderers.axisValue.renderers.ValueLabelRenderer; import org.jCharts.axisChart.customRenderers.axisValue.renderers.ValueLabelPosition; import org.jCharts.axisChart.AxisChart; import java.awt.*; /****************************************************************************************** * This file provides examples of how to create all the different chart types provided by * this package. * *******************************************************************************************/ public class StackedBarTestDriver extends AxisChartTestBase { boolean supportsImageMap() { return true; } /****************************************************************************************** * * ******************************************************************************************/ DataSeries getDataSeries() throws ChartDataException { StackedBarChartProperties stackedBarChartProperties; DataSeries dataSeries; AxisChartDataSet axisChartDataSet; int dataSize=(int) TestDataGenerator.getRandomNumber( 1, 30 ); int numberOfDataSets=(int) TestDataGenerator.getRandomNumber( 1, 5 ); dataSeries=super.createDataSeries( dataSize ); stackedBarChartProperties=new StackedBarChartProperties(); axisChartDataSet=super.createAxisChartDataSet( ChartType.BAR_STACKED, stackedBarChartProperties, numberOfDataSets, dataSize, 0, 5000 ); dataSeries.addIAxisPlotDataSet( axisChartDataSet ); return dataSeries; } /***************************************************************************************** * * @param args * @throws org.jCharts.properties.PropertyException * @throws ChartDataException *****************************************************************************************/ public static void main( String[] args ) throws PropertyException, ChartDataException { StackedBarChartProperties stackedBarChartProperties = new StackedBarChartProperties(); //BackgroundRenderer backgroundRenderer = new BackgroundRenderer( new Color( 20, 20, 20, 50 ) ); //clusteredBarChartProperties.addPreRenderEventListener( backgroundRenderer ); /* ValueLabelRenderer valueLabelRenderer = new ValueLabelRenderer( false, true, -1 ); valueLabelRenderer.setValueLabelPosition( ValueLabelPosition.ON_TOP ); valueLabelRenderer.useVerticalLabels( false ); clusteredBarChartProperties.addPostRenderEventListener( valueLabelRenderer ); */ double[][] data = {{280, 16, 150, 90, 60, 200, 150, 60 }, {80, 216, 10, 30, 15, 90, 150, 87 } }; Paint[] paints = {Color.yellow, Color.blue }; String[] legendLabels = {"Test Legend Label", "second set"}; AxisChartDataSet axisChartDataSet = new AxisChartDataSet( data, legendLabels, paints, ChartType.BAR_STACKED, stackedBarChartProperties ); String[] axisLabels = {"1900", "1950", "2000", "2050", "3000", "3050", "4000", "4050" }; IAxisDataSeries dataSeries = new DataSeries( axisLabels, "Cookies", "Years", "Effort Over Time" ); dataSeries.addIAxisPlotDataSet( axisChartDataSet ); ChartProperties chartProperties = new ChartProperties(); AxisProperties axisProperties = new AxisProperties( false ); axisProperties.getXAxisProperties().getAxisTitleChartFont(); // axisProperties.getXAxisProperties().setShowAxisLabels( false ); // axisProperties.getYAxisProperties().setShowAxisLabels( false ); // axisProperties.getYAxisProperties().setShowTicks( AxisTypeProperties.TICKS_NONE ); //axisProperties.getYAxisProperties().setShowGridLines( AxisTypeProperties.GRID_LINES_NONE ); //axisProperties.getYAxisProperties().setAxisStroke( new ChartStroke( new BasicStroke( 1.5f ), Color.red ) ); /* DataAxisProperties xAxis = (DataAxisProperties) axisProperties.getXAxisProperties(); xAxis.setRoundToNearest( 1 ); xAxis.setUserDefinedScale( -300, 200 ); */ LegendProperties legendProperties = new LegendProperties(); AxisChart axisChart = new AxisChart( dataSeries, chartProperties, axisProperties, legendProperties, 500, 400 ); axisChart.renderWithImageMap(); ChartTestDriver.exportImage( axisChart, "StackedBarChartTest.png" ); } } jcharts-0.7.5/src/org/jCharts/test/StockTestDriver.java0000644000175000001440000001145007751071402022113 0ustar onkarusers/*********************************************************************************************** * File Info: $Id: StockTestDriver.java,v 1.4 2003/03/31 00:26:42 nathaniel_auvil Exp $ * Copyright (C) 2000 * Author: Nathaniel G. Auvil * Contributor(s): * * Copyright 2002 (C) Nathaniel G. Auvil. All Rights Reserved. * * Redistribution and use of this software and associated documentation * ("Software"), with or without modification, are permitted provided * that the following conditions are met: * * 1. Redistributions of source code must retain copyright * statements and notices. Redistributions must also contain a * copy of this document. * * 2. Redistributions in binary form must reproduce the * above copyright notice, this list of conditions and the * following disclaimer in the documentation and/or other * materials provided with the distribution. * * 3. The name "jCharts" or "Nathaniel G. Auvil" must not be used to * endorse or promote products derived from this Software without * prior written permission of Nathaniel G. Auvil. For written * permission, please contact nathaniel_auvil@users.sourceforge.net * * 4. Products derived from this Software may not be called "jCharts" * nor may "jCharts" appear in their names without prior written * permission of Nathaniel G. Auvil. jCharts is a registered * trademark of Nathaniel G. Auvil. * * 5. Due credit should be given to the jCharts Project * (http://jcharts.sourceforge.net/). * * THIS SOFTWARE IS PROVIDED BY Nathaniel G. Auvil AND CONTRIBUTORS * ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT * NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL * jCharts OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED * OF THE POSSIBILITY OF SUCH DAMAGE. ************************************************************************************************/ package org.jCharts.test; import org.jCharts.chartData.*; import org.jCharts.properties.ChartTypeProperties; import org.jCharts.properties.StockChartProperties; import java.awt.*; /****************************************************************************************** * This file provides examples of how to create all the different chart types provided by * this package. * *******************************************************************************************/ public final class StockTestDriver extends AxisChartTestBase { boolean supportsImageMap() { return true; } /****************************************************************************************** * Separate this so can use for combo chart test * ******************************************************************************************/ static ChartTypeProperties getChartTypeProperties( int numberOfDataSets ) { StockChartProperties stockChartProperties=new StockChartProperties(); return stockChartProperties; } /****************************************************************************************** * Test for LineChart * * @throws ChartDataException ******************************************************************************************/ DataSeries getDataSeries() throws ChartDataException { int dataSize=(int) TestDataGenerator.getRandomNumber( 2, 25 ); int numberOfDataSets=1; DataSeries dataSeries=super.createDataSeries( dataSize ); StockChartDataSet stockChartDataSet; double[] highs=TestDataGenerator.getRandomNumbers( dataSize, 500, 1000 ); double[] lows=TestDataGenerator.getRandomNumbers( dataSize, 100, 300 ); double[] opens=TestDataGenerator.getRandomNumbers( dataSize, 350, 450 ); double[] closes=TestDataGenerator.getRandomNumbers( dataSize, 350, 450 ); StockChartProperties stockChartProperties=new StockChartProperties(); stockChartDataSet=new StockChartDataSet( highs, "High", lows, "Low", Color.black, stockChartProperties ); stockChartDataSet.setOpenValues( opens, "Open", Color.red ); stockChartDataSet.setCloseValues( closes, "Close", Color.green ); String[] legendLabels=TestDataGenerator.getRandomStrings( numberOfDataSets, 10, false ); Paint[] paints=TestDataGenerator.getRandomPaints( numberOfDataSets ); dataSeries.addIAxisPlotDataSet( stockChartDataSet ); return dataSeries; } } jcharts-0.7.5/src/org/jCharts/test/StopWatch.java0000644000175000001440000000577107751071402020741 0ustar onkarusers /*********************************************************************************************** * File Info: $Id: StopWatch.java,v 1.1 2002/11/22 03:26:17 nathaniel_auvil Exp $ * Copyright (C) 2000 * Author: Nathaniel G. Auvil * Contributor(s): * * Copyright 2002 (C) Nathaniel G. Auvil. All Rights Reserved. * * Redistribution and use of this software and associated documentation ("Software"), with or * without modification, are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain copyright statements and notices. * Redistributions must also contain a copy of this document. * * 2. Redistributions in binary form must reproduce the above copyright notice, this list of * conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. * * 3. The name "jCharts" or "Nathaniel G. Auvil" must not be used to endorse or promote * products derived from this Software without prior written permission of Nathaniel G. * Auvil. For written permission, please contact nathaniel_auvil@users.sourceforge.net * * 4. Products derived from this Software may not be called "jCharts" nor may "jCharts" appear * in their names without prior written permission of Nathaniel G. Auvil. jCharts is a * registered trademark of Nathaniel G. Auvil. * * 5. Due credit should be given to the jCharts Project (http://jcharts.sourceforge.net/). * * THIS SOFTWARE IS PROVIDED BY Nathaniel G. Auvil AND CONTRIBUTORS ``AS IS'' AND ANY * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL * jCharts OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE ************************************************************************************************/ package org.jCharts.test; public class StopWatch { private long start; private long stop; public StopWatch() { } public void start() { this.start= System.currentTimeMillis(); } public void stop() { this.stop= System.currentTimeMillis(); } public String toString() { long difference= this.stop - this.start; long seconds= ( difference / 1000 ) % 60; long minutes= difference / 1000 / 60 % 60; long hours= difference / 1000 / 60 / 60; StringBuffer s= new StringBuffer( 100 ); s.append( "Total Execution Time: " + hours + "h " + minutes + "m " + seconds + "s." ); return s.toString(); } } jcharts-0.7.5/src/org/jCharts/test/SwingTest.java0000644000175000001440000001166707751071402020755 0ustar onkarusers/*********************************************************************************************** * File Info: $Id: SwingTest.java,v 1.5 2003/03/04 01:10:09 nathaniel_auvil Exp $ * Copyright (C) 2002 * Author: Nathaniel G. Auvil * Contributor(s): * * Copyright 2002 (C) Nathaniel G. Auvil. All Rights Reserved. * * Redistribution and use of this software and associated documentation ("Software"), with or * without modification, are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain copyright statements and notices. * Redistributions must also contain a copy of this document. * * 2. Redistributions in binary form must reproduce the above copyright notice, this list of * conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. * * 3. The name "jCharts" or "Nathaniel G. Auvil" must not be used to endorse or promote * products derived from this Software without prior written permission of Nathaniel G. * Auvil. For written permission, please contact nathaniel_auvil@users.sourceforge.net * * 4. Products derived from this Software may not be called "jCharts" nor may "jCharts" appear * in their names without prior written permission of Nathaniel G. Auvil. jCharts is a * registered trademark of Nathaniel G. Auvil. * * 5. Due credit should be given to the jCharts Project (http://jcharts.sourceforge.net/). * * THIS SOFTWARE IS PROVIDED BY Nathaniel G. Auvil AND CONTRIBUTORS ``AS IS'' AND ANY * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL * jCharts OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE ************************************************************************************************/ package org.jCharts.test; import org.jCharts.chartData.ChartDataException; import org.jCharts.chartData.PieChartDataSet; import org.jCharts.nonAxisChart.PieChart2D; import org.jCharts.properties.*; import javax.swing.*; import java.awt.*; import java.awt.event.WindowEvent; public class SwingTest extends JFrame { private JPanel panel; /******************************************************************************* * ********************************************************************************/ public SwingTest() throws ChartDataException, PropertyException { initComponents(); } /******************************************************************************* * ********************************************************************************/ private void initComponents() throws ChartDataException, PropertyException { this.setSize( 500, 500 ); this.panel=new JPanel( true ); this.panel.setSize( 500, 500 ); this.getContentPane().add( this.panel ); this.setVisible( true ); String[] labels={"BMW", "Audi", "Lexus"}; String title="Cars that Own"; Paint[] paints={Color.blue, Color.gray, Color.red}; double[] data={50d, 30d, 20d}; PieChart2DProperties pieChart2DProperties=new PieChart2DProperties(); PieChartDataSet pieChartDataSet=new PieChartDataSet( title, data, labels, paints, pieChart2DProperties ); PieChart2D pieChart2D=new PieChart2D( pieChartDataSet, new LegendProperties(), new ChartProperties(), 450, 450 ); //BufferedImage bufferedImage=new BufferedImage( 450, 450, BufferedImage.TYPE_INT_RGB ); //pieChart2D.setGraphics2D( bufferedImage.createGraphics() ); pieChart2D.setGraphics2D( (Graphics2D) this.panel.getGraphics() ); pieChart2D.render(); //this.panel.getGraphics().drawImage( bufferedImage, 0, 0, this ); addWindowListener( new java.awt.event.WindowAdapter() { public void windowClosing( WindowEvent windowEvent ) { exitForm( windowEvent ); } } ); } /********************************************************************************* * Exit the Application * * @param windowEvent ***********************************************************************************/ private void exitForm( WindowEvent windowEvent ) { System.exit( 0 ); } /********************************************************************************* * * ***********************************************************************************/ public static void main( String args[] ) throws ChartDataException, PropertyException { new SwingTest(); } } jcharts-0.7.5/src/org/jCharts/test/TestDataGenerator.java0000644000175000001440000003423507751071402022402 0ustar onkarusers/*********************************************************************************************** * File Info: $Id: TestDataGenerator.java,v 1.12 2003/03/08 23:19:34 nathaniel_auvil Exp $ * Copyright (C) 2000 * Author: Nathaniel G. Auvil * Contributor(s): * * Copyright 2002 (C) Nathaniel G. Auvil. All Rights Reserved. * * Redistribution and use of this software and associated documentation * ("Software"), with or without modification, are permitted provided * that the following conditions are met: * * 1. Redistributions of source code must retain copyright * statements and notices. Redistributions must also contain a * copy of this document. * * 2. Redistributions in binary form must reproduce the * above copyright notice, this list of conditions and the * following disclaimer in the documentation and/or other * materials provided with the distribution. * * 3. The name "jCharts" or "Nathaniel G. Auvil" must not be used to * endorse or promote products derived from this Software without * prior written permission of Nathaniel G. Auvil. For written * permission, please contact nathaniel_auvil@users.sourceforge.net * * 4. Products derived from this Software may not be called "jCharts" * nor may "jCharts" appear in their names without prior written * permission of Nathaniel G. Auvil. jCharts is a registered * trademark of Nathaniel G. Auvil. * * 5. Due credit should be given to the jCharts Project * (http://jcharts.sourceforge.net/). * * THIS SOFTWARE IS PROVIDED BY Nathaniel G. Auvil AND CONTRIBUTORS * ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT * NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL * jCharts OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED * OF THE POSSIBILITY OF SUCH DAMAGE. ************************************************************************************************/ package org.jCharts.test; import org.jCharts.properties.*; import org.jCharts.properties.util.ChartStroke; import org.jCharts.chartData.ScatterPlotDataSet; import java.awt.*; final public class TestDataGenerator { private final static Font[] ALL_FONTS=GraphicsEnvironment.getLocalGraphicsEnvironment().getAllFonts(); /***************************************************************************************** * Random font generator based on the available Fonts on this machine. * * @param minSize * @param maxSize * @return Font ******************************************************************************************/ public static Font getRandomFont( double minSize, double maxSize ) { Font font=ALL_FONTS[ (int) TestDataGenerator.getRandomNumber( ALL_FONTS.length ) ]; font=font.deriveFont( (float) TestDataGenerator.getRandomNumber( minSize, maxSize ) ); return font; } /***************************************************************************************** * Random number generator. * * @param maxValue * @return double ******************************************************************************************/ public static double getRandomNumber( double maxValue ) { return Math.random() * maxValue; } /***************************************************************************************** * Random number generator in specified range. * * @param minValue * @param maxValue * @return double ******************************************************************************************/ protected static double getRandomNumber( double minValue, double maxValue ) { return ( minValue + ( Math.random() * ( maxValue - minValue ) ) ); } /***************************************************************************************** * Random numbers generator in specified range. * * @param numToGenerate the number of doubles to generate * @param minValue * @param maxValue * @return double[] ******************************************************************************************/ public static double[] getRandomNumbers( int numToGenerate, double minValue, double maxValue ) { double[] data=new double[ numToGenerate ]; for( int i=0; i < numToGenerate; i++ ) { data[ i ]=getRandomNumber( minValue, maxValue ); } return data; } /***************************************************************************************** * Random numbers generator in specified range. * * @param numberOfDataSets to generate * @param numToGenerate the number of doubles to generate * @param minValue * @param maxValue * @return double[] ******************************************************************************************/ public static double[][] getRandomNumbers( int numberOfDataSets, int numToGenerate, double minValue, double maxValue ) { double[][] data=new double[ numberOfDataSets ][ numToGenerate ]; for( int j=0; j < numberOfDataSets; j++ ) { for( int i=0; i < numToGenerate; i++ ) { data[ j ][ i ]=getRandomNumber( minValue, maxValue ); } } return data; } /***************************************************************************************** * Random numbers generator in specified range. * * @param numToGenerate the number of doubles to generate * @param xMinValue * @param xMaxValue * @param yMinValue * @param yMaxValue * @return Point.Double[] ******************************************************************************************/ public static Point.Double[] getRandomPoints( int numToGenerate, double xMinValue, double xMaxValue, double yMinValue, double yMaxValue ) { Point.Double[] points= new Point.Double[ numToGenerate ]; for( int j=0; j < numToGenerate; j++ ) { points[ j ]= ScatterPlotDataSet.createPoint2DDouble(); points[ j ].setLocation( getRandomNumber( xMinValue, xMaxValue ), getRandomNumber( yMinValue, yMaxValue ) ); } return points; } /***************************************************************************************** * Random Paint generator. * * @return Paint ******************************************************************************************/ protected static Paint getRandomPaint() { if( getRandomNumber( 1 ) > 0.5 ) { return getRandomColor(); } else { float width=(float) TestDataGenerator.getRandomNumber( 10, 800 ); float height=(float) TestDataGenerator.getRandomNumber( 10, 600 ); float x=(float) TestDataGenerator.getRandomNumber( 0, 800 ); float y=(float) TestDataGenerator.getRandomNumber( 0, 600 ); return new GradientPaint( x, y, getRandomColor(), width, height, getRandomColor() ); } } /***************************************************************************************** * Random Color generator. * * @return Paint[] ******************************************************************************************/ public static Paint[] getRandomPaints( int numToCreate ) { Paint paints[]=new Paint[ numToCreate ]; for( int i=0; i < numToCreate; i++ ) { paints[ i ]=getRandomPaint(); } return paints; } /***************************************************************************************** * Random Color generator. * * @return Color ******************************************************************************************/ protected static Color getRandomColor() { int transparency=(int) getRandomNumber( 100, 375 ); if( transparency > 255 ) { transparency=255; } return new Color( (int) getRandomNumber( 255 ), (int) getRandomNumber( 255 ), (int) getRandomNumber( 255 ), transparency ); } /***************************************************************************************** * Random String generator. * * @param maxStringLength * @param canBeNull * @return String ******************************************************************************************/ protected static String getRandomString( int maxStringLength, boolean canBeNull ) { if( canBeNull ) { if( TestDataGenerator.getRandomNumber( 10 ) <= 1 ) { return null; } } int tempVal; int stringLength=1 + (int) getRandomNumber( maxStringLength ); StringBuffer stringBuffer=new StringBuffer( stringLength ); while( stringLength-- > 0 ) { tempVal=65 + (int) getRandomNumber( 58 ); while( tempVal > 90 && tempVal < 97 ) { tempVal=65 + (int) getRandomNumber( 58 ); } stringBuffer.append( (char) tempVal ); } return stringBuffer.toString(); } /***************************************************************************************** * Random String generator. * * @return String[] ******************************************************************************************/ protected static String[] getRandomStrings( int numToCreate, int maxStringLength, boolean canBeNull ) { if( canBeNull ) { if( (int) TestDataGenerator.getRandomNumber( 10 ) <= 1 ) { return null; } } String strings[]=new String[ numToCreate ]; for( int i=0; i < numToCreate; i++ ) { strings[ i ]=getRandomString( maxStringLength, false ); } return strings; } /****************************************************************************************** * Takes the passed AxisProperties and randomizes it. * * @param axisProperties ******************************************************************************************/ protected static void randomizeAxisProperties( AxisProperties axisProperties ) { DataAxisProperties dataAxisProperties; LabelAxisProperties labelAxisProperties; if( axisProperties.isPlotHorizontal() ) { dataAxisProperties= (DataAxisProperties) axisProperties.getXAxisProperties(); labelAxisProperties= (LabelAxisProperties) axisProperties.getYAxisProperties(); } else { dataAxisProperties= (DataAxisProperties) axisProperties.getYAxisProperties(); labelAxisProperties= (LabelAxisProperties) axisProperties.getXAxisProperties(); } dataAxisProperties.setNumItems( (int) TestDataGenerator.getRandomNumber( 2, 15 ) ); dataAxisProperties.setRoundToNearest( (int) TestDataGenerator.getRandomNumber( -5, 3 ) ); dataAxisProperties.setUseDollarSigns( TestDataGenerator.getRandomNumber( 1 ) > 0.5d ); dataAxisProperties.setUseCommas( TestDataGenerator.getRandomNumber( 1 ) > 0.5d ); //axisProperties.setShowAxisTitle( AxisProperties.X_AXIS, TestDataGenerator.getRandomNumber( 1 ) > 0.5d ); //axisProperties.setShowAxisTitle( AxisProperties.Y_AXIS, TestDataGenerator.getRandomNumber( 1 ) > 0.5d ); //axisProperties.setShowGridLine( AxisProperties.X_AXIS, (int) TestDataGenerator.getRandomNumber( 3 ) ); //axisProperties.setShowGridLine( AxisProperties.X_AXIS, AxisProperties.GRID_LINES_ONLY_WITH_LABELS ); //axisProperties.setShowGridLine( AxisProperties.Y_AXIS, (int) TestDataGenerator.getRandomNumber( 3 ) ); dataAxisProperties.setShowEndBorder( TestDataGenerator.getRandomNumber( 1 ) > 0.5d ); labelAxisProperties.setShowEndBorder( TestDataGenerator.getRandomNumber( 1 ) > 0.5d ); // axisProperties.setShowTicks( AxisProperties.X_AXIS, (int) TestDataGenerator.getRandomNumber( 3 ) ); //axisProperties.setShowTicks( AxisProperties.X_AXIS, AxisProperties.TICKS_ONLY_WITH_LABELS ); //axisProperties.setShowTicks( AxisProperties.Y_AXIS, (int) TestDataGenerator.getRandomNumber( 3 ) ); //axisProperties.setShowZeroLine( TestDataGenerator.getRandomNumber( 1 ) > 0.5d ); //axisProperties.setZeroLinePaint( TestDataGenerator.getRandomPaint() ); // axisProperties.setScaleFont( TestDataGenerator.getRandomFont( 12.0, 15.0 ) ); //axisProperties.setScaleFontColor( TestDataGenerator.getRandomPaint() ); //axisProperties.setAxisTitleFont( TestDataGenerator.getRandomFont( 6.0, 20.0 ) ); axisProperties.getXAxisProperties().setAxisStroke( new ChartStroke( new BasicStroke( 1.5f ), TestDataGenerator.getRandomPaint() ) ); axisProperties.getYAxisProperties().setAxisStroke( new ChartStroke( new BasicStroke( 1.5f ), TestDataGenerator.getRandomPaint() ) ); //axisProperties.setBackgroundPaint( TestDataGenerator.getRandomPaint() ); } /****************************************************************************************** * Takes the passed Legend and randomizes it. * * @param legendProperties ******************************************************************************************/ protected static void randomizeLegend( LegendProperties legendProperties ) { Font font; int fontSize; int numColumns=(int) TestDataGenerator.getRandomNumber( 1, 6 ); if( numColumns == 6 ) { numColumns=LegendAreaProperties.COLUMNS_AS_MANY_AS_NEEDED; } legendProperties.setNumColumns( numColumns ); legendProperties.setPlacement( (int) TestDataGenerator.getRandomNumber( 4 ) ); fontSize=(int) TestDataGenerator.getRandomNumber( 6, 20 ); font=ALL_FONTS[ (int) TestDataGenerator.getRandomNumber( ALL_FONTS.length ) ]; font=font.deriveFont( (float) fontSize ); legendProperties.setFont( font ); legendProperties.setFontPaint( TestDataGenerator.getRandomPaint() ); //---random between null and having a color. if( (int) TestDataGenerator.getRandomNumber( 2 ) == 0 ) { legendProperties.setBorderStroke( null ); } else { legendProperties.setBorderStroke( ChartStroke.DEFAULT_LEGEND_OUTLINE ); } //---random between null and having a color. if( (int) TestDataGenerator.getRandomNumber( 2 ) == 0 ) { legendProperties.setBackgroundPaint( null ); } else { legendProperties.setBackgroundPaint( TestDataGenerator.getRandomPaint() ); } } }jcharts-0.7.5/src/org/jCharts/types/0000755000175000001440000000000007751071402016335 5ustar onkarusersjcharts-0.7.5/src/org/jCharts/types/ChartType.java0000644000175000001440000001053607751071402021110 0ustar onkarusers/*********************************************************************************************** * File Info: $Id: ChartType.java,v 1.4 2003/02/17 02:55:37 nathaniel_auvil Exp $ * Copyright (C) 2002 * Author: Nathaniel G. Auvil * Contributor(s): * * Copyright 2002 (C) Nathaniel G. Auvil. All Rights Reserved. * * Redistribution and use of this software and associated documentation ("Software"), with or * without modification, are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain copyright statements and notices. * Redistributions must also contain a copy of this document. * * 2. Redistributions in binary form must reproduce the above copyright notice, this list of * conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. * * 3. The name "jCharts" or "Nathaniel G. Auvil" must not be used to endorse or promote * products derived from this Software without prior written permission of Nathaniel G. * Auvil. For written permission, please contact nathaniel_auvil@users.sourceforge.net * * 4. Products derived from this Software may not be called "jCharts" nor may "jCharts" appear * in their names without prior written permission of Nathaniel G. Auvil. jCharts is a * registered trademark of Nathaniel G. Auvil. * * 5. Due credit should be given to the jCharts Project (http://jcharts.sourceforge.net/). * * THIS SOFTWARE IS PROVIDED BY Nathaniel G. Auvil AND CONTRIBUTORS ``AS IS'' AND ANY * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL * jCharts OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE ************************************************************************************************/ package org.jCharts.types; /***************************************************************************************** * Chart IntType constants to be used on data sets to specify how they should be plotted. * ******************************************************************************************/ public class ChartType extends IntType { public static final ChartType BAR=new ChartType( 0, false ); public static final ChartType BAR_CLUSTERED=new ChartType( 1, false ); public static final ChartType BAR_STACKED=new ChartType( 2, true ); public static final ChartType LINE=new ChartType( 3, false ); public static final ChartType POINT=new ChartType( 4, false ); public static final ChartType AREA=new ChartType( 5, false ); public static final ChartType AREA_STACKED=new ChartType( 6, true ); public static final ChartType STOCK=new ChartType( 7, false ); public static final ChartType SCATTER_PLOT=new ChartType( 8, false ); private boolean stackedData; /*************************************************************************************** * * ****************************************************************************************/ private ChartType( int typeCode, boolean stackedData ) { super( typeCode ); this.stackedData=stackedData; } /*************************************************************************************** * Returns flag indicating whether chart type has stacked data * * @return boolean ****************************************************************************************/ public boolean isStacked() { return this.stackedData; } /*************************************************************************************** * Returns flag indicating whether passed ChartType is equal to this one * * @return boolean ****************************************************************************************/ public boolean equals( ChartType chartType ) { return ( this.getInt() == chartType.getInt() ); } } jcharts-0.7.5/src/org/jCharts/types/IntType.java0000644000175000001440000000646107751071402020603 0ustar onkarusers/*********************************************************************************************** * File Info: $Id: IntType.java,v 1.5 2002/12/11 03:32:34 nathaniel_auvil Exp $ * Copyright (C) 2001 * Author: Nathaniel G. Auvil * Contributor(s): * * Copyright 2002 (C) Nathaniel G. Auvil. All Rights Reserved. * * Redistribution and use of this software and associated documentation * ("Software"), with or without modification, are permitted provided * that the following conditions are met: * * 1. Redistributions of source code must retain copyright * statements and notices. Redistributions must also contain a * copy of this document. * * 2. Redistributions in binary form must reproduce the * above copyright notice, this list of conditions and the * following disclaimer in the documentation and/or other * materials provided with the distribution. * * 3. The name "jCharts" or "Nathaniel G. Auvil" must not be used to * endorse or promote products derived from this Software without * prior written permission of Nathaniel G. Auvil. For written * permission, please contact nathaniel_auvil@users.sourceforge.net * * 4. Products derived from this Software may not be called "jCharts" * nor may "jCharts" appear in their names without prior written * permission of Nathaniel G. Auvil. jCharts is a registered * trademark of Nathaniel G. Auvil. * * 5. Due credit should be given to the jCharts Project * (http://jcharts.sourceforge.net/). * * THIS SOFTWARE IS PROVIDED BY Nathaniel G. Auvil AND CONTRIBUTORS * ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT * NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL * jCharts OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED * OF THE POSSIBILITY OF SUCH DAMAGE. ************************************************************************************************/ package org.jCharts.types; import java.io.Serializable; /***************************************************************************************** * Provides a common base class for all types. * ******************************************************************************************/ abstract public class IntType implements Serializable { private int type; /*************************************************************************************** * * @param typeCode ****************************************************************************************/ protected IntType( int typeCode ) { this.type=typeCode; } /*************************************************************************************** * * @return int ****************************************************************************************/ public int getInt() { return this.type; } } jcharts-0.7.5/src/org/jCharts/types/PieLabelType.java0000644000175000001440000000575507751071402021533 0ustar onkarusers/*********************************************************************************************** * File Info: $Id: PieLabelType.java,v 1.1 2003/03/11 02:52:45 nathaniel_auvil Exp $ * Copyright (C) 2002 * Author: Nathaniel G. Auvil * Contributor(s): * * Copyright 2002 (C) Nathaniel G. Auvil. All Rights Reserved. * * Redistribution and use of this software and associated documentation ("Software"), with or * without modification, are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain copyright statements and notices. * Redistributions must also contain a copy of this document. * * 2. Redistributions in binary form must reproduce the above copyright notice, this list of * conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. * * 3. The name "jCharts" or "Nathaniel G. Auvil" must not be used to endorse or promote * products derived from this Software without prior written permission of Nathaniel G. * Auvil. For written permission, please contact nathaniel_auvil@users.sourceforge.net * * 4. Products derived from this Software may not be called "jCharts" nor may "jCharts" appear * in their names without prior written permission of Nathaniel G. Auvil. jCharts is a * registered trademark of Nathaniel G. Auvil. * * 5. Due credit should be given to the jCharts Project (http://jcharts.sourceforge.net/). * * THIS SOFTWARE IS PROVIDED BY Nathaniel G. Auvil AND CONTRIBUTORS ``AS IS'' AND ANY * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL * jCharts OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE ************************************************************************************************/ package org.jCharts.types; public class PieLabelType extends IntType { public static final PieLabelType NO_LABELS= new PieLabelType( 0 ); public static final PieLabelType VALUE_LABELS= new PieLabelType( 1 ); public static final PieLabelType LEGEND_LABELS= new PieLabelType( 2 ); /******************************************************************************* * * @param value ******************************************************************************/ private PieLabelType( int value ) { super( value ); } public boolean equals( PieLabelType pieLabelType ) { return this.getInt() == pieLabelType.getInt(); } } jcharts-0.7.5/src/org/jCharts/types/StockChartDataType.java0000644000175000001440000000622207751071402022703 0ustar onkarusers/*********************************************************************************************** * File Info: $Id: StockChartDataType.java,v 1.2 2002/10/14 20:52:05 nathaniel_auvil Exp $ * Copyright (C) 2002 * Author: Nathaniel G. Auvil * Contributor(s): * * Copyright 2002 (C) Nathaniel G. Auvil. All Rights Reserved. * * Redistribution and use of this software and associated documentation * ("Software"), with or without modification, are permitted provided * that the following conditions are met: * * 1. Redistributions of source code must retain copyright * statements and notices. Redistributions must also contain a * copy of this document. * * 2. Redistributions in binary form must reproduce the * above copyright notice, this list of conditions and the * following disclaimer in the documentation and/or other * materials provided with the distribution. * * 3. The name "jCharts" or "Nathaniel G. Auvil" must not be used to * endorse or promote products derived from this Software without * prior written permission of Nathaniel G. Auvil. For written * permission, please contact nathaniel_auvil@users.sourceforge.net * * 4. Products derived from this Software may not be called "jCharts" * nor may "jCharts" appear in their names without prior written * permission of Nathaniel G. Auvil. jCharts is a registered * trademark of Nathaniel G. Auvil. * * 5. Due credit should be given to the jCharts Project * (http://jcharts.sourceforge.net/). * * THIS SOFTWARE IS PROVIDED BY Nathaniel G. Auvil AND CONTRIBUTORS * ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT * NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL * jCharts OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED * OF THE POSSIBILITY OF SUCH DAMAGE. ************************************************************************************************/ package org.jCharts.types; public class StockChartDataType extends IntType { public static final StockChartDataType OPEN=new StockChartDataType( 0 ); public static final StockChartDataType CLOSE=new StockChartDataType( 1 ); public static final StockChartDataType HIGH=new StockChartDataType( 2 ); public static final StockChartDataType LOW=new StockChartDataType( 3 ); //public static final StockChartDataType VOLUME= new StockChartDataType( 4 ); /*************************************************************************************** * * @param int ****************************************************************************************/ private StockChartDataType( int typeCode ) { super( typeCode ); } } jcharts-0.7.5/src/org/jCharts/types/Type.java0000644000175000001440000000645207751071402020130 0ustar onkarusers/*********************************************************************************************** * File Info: $Id: Type.java,v 1.2 2002/10/14 20:52:05 nathaniel_auvil Exp $ * Copyright (C) 2001 * Author: Nathaniel G. Auvil * Contributor(s): * * Copyright 2002 (C) Nathaniel G. Auvil. All Rights Reserved. * * Redistribution and use of this software and associated documentation * ("Software"), with or without modification, are permitted provided * that the following conditions are met: * * 1. Redistributions of source code must retain copyright * statements and notices. Redistributions must also contain a * copy of this document. * * 2. Redistributions in binary form must reproduce the * above copyright notice, this list of conditions and the * following disclaimer in the documentation and/or other * materials provided with the distribution. * * 3. The name "jCharts" or "Nathaniel G. Auvil" must not be used to * endorse or promote products derived from this Software without * prior written permission of Nathaniel G. Auvil. For written * permission, please contact nathaniel_auvil@users.sourceforge.net * * 4. Products derived from this Software may not be called "jCharts" * nor may "jCharts" appear in their names without prior written * permission of Nathaniel G. Auvil. jCharts is a registered * trademark of Nathaniel G. Auvil. * * 5. Due credit should be given to the jCharts Project * (http://jcharts.sourceforge.net/). * * THIS SOFTWARE IS PROVIDED BY Nathaniel G. Auvil AND CONTRIBUTORS * ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT * NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL * jCharts OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED * OF THE POSSIBILITY OF SUCH DAMAGE. ************************************************************************************************/ package org.jCharts.types; import java.io.Serializable; /***************************************************************************************** * Provides a common base class for all types. * ******************************************************************************************/ abstract public class Type implements Serializable { private int typeCode; /*************************************************************************************** * * @param int ****************************************************************************************/ Type( int typeCode ) { this.typeCode=typeCode; } /*************************************************************************************** * * @return int ****************************************************************************************/ public int getTypeCode() { return this.typeCode; } } jcharts-0.7.5/src/org/jCharts/Chart.java0000644000175000001440000003306407751071402017103 0ustar onkarusers/*********************************************************************************************** * File Info: $Id: Chart.java,v 1.12 2003/06/29 13:28:10 nathaniel_auvil Exp $ * Copyright (C) 2002 * Author: Nathaniel G. Auvil * Contributor(s): Sandor Dornbush * * Copyright 2002 (C) Nathaniel G. Auvil. All Rights Reserved. * * Redistribution and use of this software and associated documentation ("Software"), with or * without modification, are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain copyright statements and notices. * Redistributions must also contain a copy of this document. * * 2. Redistributions in binary form must reproduce the above copyright notice, this list of * conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. * * 3. The name "jCharts" or "Nathaniel G. Auvil" must not be used to endorse or promote * products derived from this Software without prior written permission of Nathaniel G. * Auvil. For written permission, please contact nathaniel_auvil@users.sourceforge.net * * 4. Products derived from this Software may not be called "jCharts" nor may "jCharts" appear * in their names without prior written permission of Nathaniel G. Auvil. jCharts is a * registered trademark of Nathaniel G. Auvil. * * 5. Due credit should be given to the jCharts Project (http://jcharts.sourceforge.net/). * * THIS SOFTWARE IS PROVIDED BY Nathaniel G. Auvil AND CONTRIBUTORS ``AS IS'' AND ANY * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL * jCharts OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE ************************************************************************************************/ package org.jCharts; import org.jCharts.imageMap.ImageMap; import org.jCharts.properties.*; import org.jCharts.test.HTMLGenerator; import org.jCharts.chartData.ChartDataException; import java.awt.*; import java.awt.font.*; import java.awt.geom.Rectangle2D; import java.awt.image.BufferedImage; import java.io.Serializable; import java.text.AttributedString; /*********************************************************************************************** * Base class of all charts. * ***********************************************************************************************/ abstract public class Chart implements Serializable { //---Be aware that the calls BufferedImage.getGraphics() and BufferedImage.createGraphics(), actually //--- create a new Graphics2D Object on each invocation. So keep a reference here. private Graphics2D graphics2D; private int width; private int height; private Legend legend; //---general properties of all chart types. private ChartProperties chartProperties; //---used to generate an image map for the image private boolean generateImageMap = false; private ImageMap imageMap = null; private BufferedImage bufferedImage = null; /****************************************************************************************** * Constructor * * @param legendProperties * @param chartProperties * @param pixelWidth * @param pixelHeight *******************************************************************************************/ public Chart( LegendProperties legendProperties, ChartProperties chartProperties, int pixelWidth, int pixelHeight ) { this.width = pixelWidth; this.height = pixelHeight; this.chartProperties = chartProperties; if( legendProperties != null ) { this.legend = new Legend( this, legendProperties ); legendProperties.setSize(new Dimension(width, height)); } } /****************************************************************************************** * Returns flag indicating whether to generate an ImageMap * * @return boolean *******************************************************************************************/ public boolean getGenerateImageMapFlag() { return this.generateImageMap; } /****************************************************************************************** * Returns the BufferedImage used to generate the ImageMap. Only should be called on * binary format images, such as PNG and JPG, as it will not work on SVG. * * This is a HACK and the design of jCharts should do better than this!!!!!! * * @return BufferedImage *******************************************************************************************/ public BufferedImage getBufferedImage() { return this.bufferedImage; } /****************************************************************************************** * Renders the chart into a BufferedImage so that we can calculate all the Image Map * coordinates. * * @throws ChartDataException * @throws PropertyException *******************************************************************************************/ public void renderWithImageMap() throws ChartDataException, PropertyException { this.bufferedImage = new BufferedImage( this.getImageWidth(), this.getImageHeight(), BufferedImage.TYPE_INT_RGB ); this.setGraphics2D( this.bufferedImage.createGraphics() ); this.generateImageMap = true; this.render(); } /****************************************************************************************** * Call this to kick off rendering of the chart * * @throws ChartDataException * @throws PropertyException *******************************************************************************************/ public void render() throws ChartDataException, PropertyException { Rectangle2D.Float rectangle = new Rectangle2D.Float( 0, 0, this.width, this.height ); //---fill the background this.graphics2D.setPaint( this.chartProperties.getBackgroundPaint() ); this.graphics2D.fill( rectangle ); //---draw a border around the chart if desired if( this.chartProperties.getBorderStroke() != null ) { //---there is a one pixel difference when you fill versus draw a rectangle rectangle.width -= 1; rectangle.height -= 1; this.chartProperties.getBorderStroke().draw( this.graphics2D, rectangle ); } //---draw the chart this.renderChart(); } /************************************************************************************************* * Displays the chart title and returns the height of the title PLUS title padding. * * @param chartTitle * @param fontRenderContext * @return float the height required by the title. If no title is displayed, zero is returned. **************************************************************************************************/ protected float renderChartTitle( String chartTitle, FontRenderContext fontRenderContext ) { float height = 0; if( chartTitle != null ) { //---the y value of where to write the current line float currentLine = this.getChartProperties().getEdgePadding(); // change title into an AttributedString with the font as an attribute AttributedString s = new AttributedString( chartTitle ); s.addAttribute( TextAttribute.FONT, this.getChartProperties().getTitleFont().getFont() ); //---get LineBreakMeasurer on the attributed string...it will break the text for us LineBreakMeasurer measurer = new LineBreakMeasurer( s.getIterator(), fontRenderContext ); //---set the text color this.getGraphics2D().setPaint( this.getChartProperties().getTitleFont().getPaint() ); //---draw each title line. Subtract padding from each side for printable width. float wrappingWidth= this.getImageWidth() - ( this.getChartProperties().getEdgePadding() * 2 ); TextLayout titleTextLayout= null; while( ( titleTextLayout = measurer.nextLayout( wrappingWidth ) ) != null ) { //---set the current line to where the title will be written currentLine += titleTextLayout.getAscent(); titleTextLayout.draw( this.getGraphics2D(), ( ( this.getImageWidth() - titleTextLayout.getAdvance() ) / 2 ), currentLine ); //---keep track of total height of all the title lines height += titleTextLayout.getAscent() + titleTextLayout.getDescent(); } //---add in the padding between the title and the top of the chart. height += this.getChartProperties().getTitlePadding(); } return height; } /****************************************************************************************** * * @throws ChartDataException * @throws PropertyException *******************************************************************************************/ abstract protected void renderChart() throws ChartDataException, PropertyException; /****************************************************************************************** * Returns the BufferedImage width * * @return int *******************************************************************************************/ public final int getImageWidth() { return this.width; } /****************************************************************************************** * Returns the BufferedImage height * * @return int *******************************************************************************************/ public final int getImageHeight() { return this.height; } /****************************************************************************************** * Returns the general properties Object. * * @return ChartProperties *******************************************************************************************/ public final ChartProperties getChartProperties() { return this.chartProperties; } /****************************************************************************************** * Returns the Legend. Will be NULL if no Legend is desired. * * @return Legend *******************************************************************************************/ protected final Legend getLegend() { return this.legend; } /****************************************************************************************** * Returns flag indicating if there is a Legend. * * @return boolean *******************************************************************************************/ public final boolean hasLegend() { return this.legend != null; } /****************************************************************************************** * Sets the graphics object to render the chart on by the encoder. * * @param graphics2D *******************************************************************************************/ public final void setGraphics2D( Graphics2D graphics2D ) { this.graphics2D = graphics2D; } /****************************************************************************************** * Shortcut method to get Graphics2D. Be aware that the call BufferedImage.getGraphics() * and BufferedImage.createGraphics(), actually create a new Grpahics2D Object on each * invocation. This returns the member reference so calls to this are not creating a new * Object each time. * * @return Graphics2D *******************************************************************************************/ public final Graphics2D getGraphics2D() { return this.graphics2D; } /********************************************************************************************** * To optimze performance of the ImageMap Object, we create it once we know how many data * elements are in the chart which is dependent on the AxisChart or PieChart2D * * @param imageMap **********************************************************************************************/ public final void setImageMap( ImageMap imageMap ) { this.imageMap = imageMap; } /********************************************************************************************** * * @return imageMap **********************************************************************************************/ public final ImageMap getImageMap() { return this.imageMap; } /********************************************************************************************** * Enables the testing routines to display the contents of this Object. * * @param htmlGenerator * @param imageFileName * @param imageMap if this is NULL we are not creating image map data in html **********************************************************************************************/ public void toHTML( HTMLGenerator htmlGenerator, String imageFileName, ImageMap imageMap ) { htmlGenerator.chartTableStart( this.getClass().getName(), imageFileName, imageMap ); htmlGenerator.chartTableRowStart(); this.chartProperties.toHTML( htmlGenerator ); htmlGenerator.chartTableRowEnd(); if( this.legend != null ) { htmlGenerator.chartTableRowStart(); this.getLegend().toHTML( htmlGenerator ); htmlGenerator.chartTableRowEnd(); } htmlGenerator.chartTableEnd(); } } jcharts-0.7.5/src/org/jCharts/Legend.java0000644000175000001440000004621607751071402017243 0ustar onkarusers/*********************************************************************************************** * Copyright 2002 (C) Nathaniel G. Auvil. All Rights Reserved. * * Redistribution and use of this software and associated documentation ("Software"), with or * without modification, are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain copyright statements and notices. * Redistributions must also contain a copy of this document. * * 2. Redistributions in binary form must reproduce the above copyright notice, this list of * conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. * * 3. The name "jCharts" or "Nathaniel G. Auvil" must not be used to endorse or promote * products derived from this Software without prior written permission of Nathaniel G. * Auvil. For written permission, please contact nathaniel_auvil@users.sourceforge.net * * 4. Products derived from this Software may not be called "jCharts" nor may "jCharts" appear * in their names without prior written permission of Nathaniel G. Auvil. jCharts is a * registered trademark of Nathaniel G. Auvil. * * 5. Due credit should be given to the jCharts Project (http://jcharts.sourceforge.net/). * * THIS SOFTWARE IS PROVIDED BY Nathaniel G. Auvil AND CONTRIBUTORS ``AS IS'' AND ANY * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL * jCharts OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE ************************************************************************************************/ package org.jCharts; import org.jCharts.chartData.interfaces.*; import org.jCharts.chartData.processors.TextProcessor; import org.jCharts.properties.*; import org.jCharts.test.HTMLGenerator; import org.jCharts.test.HTMLTestable; import org.jCharts.types.ChartType; import java.awt.*; import java.awt.geom.AffineTransform; import java.awt.geom.Rectangle2D; import java.io.Serializable; import java.util.ArrayList; import java.util.Iterator; /************************************************************************************* * * @author Nathaniel Auvil, Sandor Dornbush, Sundar Balasubramanian * @version $Id: Legend.java,v 1.17 2003/04/19 01:39:17 nathaniel_auvil Exp $ ************************************************************************************/ final public class Legend implements HTMLTestable, Serializable { private Chart chart; private LegendProperties legendProperties; private float iconSide; //---derived values private float widestLabelAndColumnPadding; private int numColumns; private int numRows; private TextProcessor textProcessor; private float x; private float y; private float width = 0; private float height = 0; //---used to extract the legendLabels and paints from the data set and make them easy to loop through private ArrayList labels; private ArrayList paints; private ArrayList shapes = new ArrayList(); private ArrayList fillPointsFlags = new ArrayList(); private ArrayList pointOutlinePaints = new ArrayList(); /********************************************************************************************* * * @param chart * @deprecated **********************************************************************************************/ public Legend( Chart chart ) { this.chart = chart; } /********************************************************************************************* * * @param chart * @param legendProperties **********************************************************************************************/ public Legend( Chart chart, LegendProperties legendProperties ) { this.chart = chart; this.legendProperties = legendProperties; } public void setX( float x ) { this.x = x; } public void setY( float y ) { this.y = y; } /***************************************************************************************** * * @param iAxisDataSeries * @param chartTitleHeight ****************************************************************************************/ public void computeLegendXY( IAxisDataSeries iAxisDataSeries, float chartTitleHeight ) { //---PROCESS the size needed for drawing the legend. this.calculateDrawingValues( iAxisDataSeries ); if( (this.getLegendProperties().getPlacement() == LegendAreaProperties.RIGHT) || (this.getLegendProperties().getPlacement() == LegendAreaProperties.LEFT) ) { if( this.getHeight() > this.chart.getImageHeight() - this.chart.getChartProperties().getEdgePadding() * 2 ) { this.setY( this.chart.getChartProperties().getEdgePadding() ); } else { this.setY( (this.chart.getImageHeight() / 2) - (this.getHeight() / 2) ); } if( this.getLegendProperties().getPlacement() == LegendAreaProperties.RIGHT ) { this.setX( this.chart.getImageWidth() - this.getWidth() - this.chart.getChartProperties().getEdgePadding() ); } else //---else, LegendAreaProperties.LEFT { this.setX( this.chart.getChartProperties().getEdgePadding() ); } } else //---LegendAreaProperties.BOTTOM, OR LegendAreaProperties.TOP { if( this.getWidth() + this.chart.getChartProperties().getEdgePadding() * 2 > this.chart.getImageWidth() ) { this.setX( this.chart.getChartProperties().getEdgePadding() ); } else { this.setX( (this.chart.getImageWidth() / 2) - (this.getWidth() / 2) ); } if( this.getLegendProperties().getPlacement() == LegendAreaProperties.BOTTOM ) { this.setY( this.chart.getImageHeight() - this.getHeight() - this.chart.getChartProperties().getEdgePadding() ); } else //---else, LegendAreaProperties.TOP { this.setY( this.chart.getChartProperties().getEdgePadding() + chartTitleHeight ); } } } /********************************************************************************************** * Central method for processing data; try to minimize looping. * 1) calculate the maximum height of labels * 2) find the maximum label width * * @param iAxisDataSeries **********************************************************************************************/ private void processData( IAxisDataSeries iAxisDataSeries ) { this.textProcessor = new TextProcessor(); Iterator iterator = iAxisDataSeries.getIAxisPlotDataSetIterator(); //LOOP while( iterator.hasNext() ) { this.processLegendLabels( (IAxisPlotDataSet) iterator.next() ); } } /********************************************************************************************** * Central method for processing data; try to minimize looping. * 1) calculate the maximum height of labels * 2) find the maximum label width * * @param iPieChartDataSet **********************************************************************************************/ private void processData( IPieChartDataSet iPieChartDataSet ) { this.textProcessor = new TextProcessor(); this.processLegendLabels( iPieChartDataSet ); } /********************************************************************************************** * Method for processing data for AxisPlot datasets; try to minimize * looping. * 1) calculate the maximum height of labels * 2) find the maximum label width * * @param iAxisPlotDataSet * *********************************************************************************************/ private void processLegendLabels( IAxisPlotDataSet iAxisPlotDataSet ) { for( int i = 0; i < iAxisPlotDataSet.getNumberOfLegendLabels(); i++ ) { //---StockChartDataSets could have NULLs depending on the data if( iAxisPlotDataSet.getLegendLabel( i ) != null ) { this.textProcessor.addLabel( iAxisPlotDataSet.getLegendLabel( i ), this.legendProperties.getFont(), this.chart.getGraphics2D().getFontRenderContext() ); //---pair labels with paints to get around ugly piechart vs axischart data structure mess this.labels.add( iAxisPlotDataSet.getLegendLabel( i ) ); this.paints.add( iAxisPlotDataSet.getPaint( i ) ); if( iAxisPlotDataSet.getChartType().equals( ChartType.POINT ) ) { PointChartProperties pointChartProperties = (PointChartProperties) iAxisPlotDataSet.getChartTypeProperties(); this.shapes.add( pointChartProperties.getShape( i ) ); this.fillPointsFlags.add( new Boolean( pointChartProperties.getFillPointsFlag( i ) ) ); this.pointOutlinePaints.add( pointChartProperties.getPointOutlinePaints( i ) ); } } } } /********************************************************************************************** * Method for processing data for PieCharts; try to minimize looping. * 1) calculate the maximum height of labels * 2) find the maximum label width * @param iPieChartDataSet * ********************************************************************************************/ private void processLegendLabels( IPieChartDataSet iPieChartDataSet ) { for( int i = 0; i < iPieChartDataSet.getNumberOfLegendLabels(); i++ ) { //---StockChartDataSets could have NULLs depending on the data if( iPieChartDataSet.getLegendLabel( i ) != null ) { this.textProcessor.addLabel( iPieChartDataSet.getLegendLabel( i ), this.legendProperties.getFont(), this.chart.getGraphics2D().getFontRenderContext() ); //---pair labels with paints to get around ugly piechart vs axischart data structure mess this.labels.add( iPieChartDataSet.getLegendLabel( i ) ); this.paints.add( iPieChartDataSet.getPaint( i ) ); } } } /************************************************************************************************ * *************************************************************************************************/ public LegendProperties getLegendProperties() { return this.legendProperties; } /************************************************************************************************ * Calculates the width and height needed to display the Legend. Use the getWidth() and * getHeight() methods to extract this information. * * @param iData can pass either the IPieChartDataSet or the IChartDataSeries to this. ************************************************************************************************/ public void calculateDrawingValues( IData iData ) { int numberOfLabels; this.labels = new ArrayList(); this.paints = new ArrayList(); if( iData instanceof IAxisDataSeries ) { IAxisDataSeries iAxisDataSeries = (IAxisDataSeries) iData; this.processData( iAxisDataSeries ); numberOfLabels = iAxisDataSeries.getTotalNumberOfDataSets(); } else { IPieChartDataSet iPieChartDataSet = (IPieChartDataSet) iData; this.processData( iPieChartDataSet ); numberOfLabels = iPieChartDataSet.getNumberOfLegendLabels(); } //---make the icon proportional to the Font being used. this.iconSide = (float) .50 * this.textProcessor.getTallestLabel(); this.determineWidthAndHeight( numberOfLabels ); } /******************************************************************************************** * ********************************************************************************************/ public float getWidth() { return this.width; } /******************************************************************************************** * ********************************************************************************************/ public int getHeight() { //why not return a float here? return ((int) Math.ceil( this.height )); } /********************************************************************************************** * Determines the dimensions needed for the Legend and creates the image for it. * **********************************************************************************************/ private void determineWidthAndHeight( int numberOfLabels ) { //---start with the padding no matter how many columns or specified width width = this.legendProperties.getEdgePadding() * 2; height = width; //---if don't care how many columns or the number of labels is less than num columns specified, all in one row. if( this.legendProperties.getNumColumns() == LegendAreaProperties.COLUMNS_AS_MANY_AS_NEEDED || this.legendProperties.getNumColumns() >= numberOfLabels ) { this.numColumns = numberOfLabels; width += this.textProcessor.getTotalLabelWidths(); this.numRows = 1; } //---else, more than one row else { //---one less addition to do when looping. this.widestLabelAndColumnPadding = this.textProcessor.getWidestLabel() + this.legendProperties.getColumnPadding(); if( legendProperties.getNumColumns() == LegendAreaProperties.COLUMNS_FIT_TO_IMAGE ) { // calculate that the columns match exactly float actualWidth = legendProperties.getSize().width; float widestLabelColumnAndIcon = widestLabelAndColumnPadding + iconSide + legendProperties.getIconPadding() + legendProperties.getColumnPadding(); numColumns = (int) (actualWidth / widestLabelColumnAndIcon); numColumns = Math.min( numColumns, numberOfLabels ); } else { numColumns = this.legendProperties.getNumColumns(); } width += this.textProcessor.getWidestLabel() * this.numColumns; this.numRows = (int) Math.ceil( (double) numberOfLabels / (double) this.numColumns ); } //---account for icons width += (this.iconSide + this.legendProperties.getIconPadding()) * this.numColumns; //---account for space between each column width += this.legendProperties.getColumnPadding() * (this.numColumns - 1); //---account for each row height += (this.textProcessor.getTallestLabel() * this.numRows); //---account for each row padding height += (this.legendProperties.getRowPadding() * (this.numRows - 1)); } /********************************************************************************************** * Renders the legend. * **********************************************************************************************/ public void render() { Graphics2D g2d = this.chart.getGraphics2D(); //---get the bounds of the image Rectangle2D.Float rectangle = new Rectangle2D.Float( this.x, this.y, this.width - 1, this.height - 1 ); //---fill the background of the Legend with the specified Paint if( this.legendProperties.getBackgroundPaint() != null ) { g2d.setPaint( this.legendProperties.getBackgroundPaint() ); g2d.fill( rectangle ); } //---draw Legend border if( this.legendProperties.getBorderStroke() != null ) { this.legendProperties.getBorderStroke().draw( g2d, rectangle ); } //---dont think we want this so text will be clean but leave commented out. //g2d.setRenderingHint( RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_OFF ); //---set the font and text color. g2d.setFont( this.legendProperties.getFont() ); //---icon coordinates rectangle.y += this.legendProperties.getEdgePadding() + (this.textProcessor.getTallestLabel() / 2) - (this.iconSide / 2); rectangle.width = this.iconSide; rectangle.height = this.iconSide; float posX = this.x + this.legendProperties.getEdgePadding(); float fontY = rectangle.y + rectangle.height; //---pre calculate utility values float yIncrement = this.textProcessor.getTallestLabel() + this.legendProperties.getRowPadding(); float iconAndPaddingWidth = this.iconSide + this.legendProperties.getIconPadding(); int labelIndex = 0; //LOOP for( int j = 0; j < this.numRows; j++ ) { //LOOP for( int i = 0; i < this.numColumns; i++ ) { rectangle.x = posX; //---display icon g2d.setPaint( (Paint) this.paints.get( labelIndex ) ); //---get the original transform so can reset it. AffineTransform affineTransform = g2d.getTransform(); if( this.shapes.size() > 0 ) { //---translate the Shape into position. g2d.translate( rectangle.x, rectangle.y ); if( ((Boolean) this.fillPointsFlags.get( labelIndex )).booleanValue() ) { g2d.fill( (Shape) this.shapes.get( labelIndex ) ); //---if we are filling the points, see if we should outline the Shape if( this.pointOutlinePaints.get( labelIndex ) != null ) { g2d.setPaint( (Paint) this.pointOutlinePaints.get( labelIndex ) ); g2d.draw( (Shape) this.shapes.get( labelIndex ) ); } } else { g2d.draw( (Shape) this.shapes.get( labelIndex ) ); } g2d.setTransform( affineTransform ); } else { g2d.fill( rectangle ); //---border around icon if( this.legendProperties.getIconBorderStroke() != null ) { g2d.setStroke( this.legendProperties.getIconBorderStroke() ); g2d.setPaint( this.legendProperties.getIconBorderPaint() ); g2d.draw( rectangle ); } } //---draw the label g2d.setPaint( this.legendProperties.getFontPaint() ); posX += iconAndPaddingWidth; g2d.drawString( (String) this.labels.get( labelIndex ), posX, fontY ); if( this.legendProperties.getNumColumns() == LegendAreaProperties.COLUMNS_AS_MANY_AS_NEEDED || this.legendProperties.getNumColumns() >= this.labels.size() ) { //---each column is as wide as it needs to be posX += this.textProcessor.getTextTag( labelIndex ).getWidth() + this.legendProperties.getColumnPadding(); } else { //---all columns have the same width posX += this.widestLabelAndColumnPadding; } labelIndex++; //---if no more labels, we are done. if( labelIndex == this.labels.size() ) break; } posX = this.x + this.legendProperties.getEdgePadding(); fontY += yIncrement; rectangle.y += yIncrement; } } /********************************************************************************************* * Enables the testing routines to display the contents of this Object. * * @param htmlGenerator **********************************************************************************************/ public void toHTML( HTMLGenerator htmlGenerator ) { htmlGenerator.legendTableStart(); htmlGenerator.addTableRow( "Width", Float.toString( this.width ) ); htmlGenerator.addTableRow( "Height", Float.toString( this.height ) ); htmlGenerator.addTableRow( "Icon Side", Float.toString( this.iconSide ) ); htmlGenerator.innerTableRowStart(); this.legendProperties.toHTML( htmlGenerator ); htmlGenerator.innerTableRowEnd(); htmlGenerator.legendTableEnd(); } }