You can subscribe to this list here.
2003 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(95) |
Sep
(42) |
Oct
(2) |
Nov
(7) |
Dec
(6) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2004 |
Jan
|
Feb
(34) |
Mar
|
Apr
|
May
(64) |
Jun
(113) |
Jul
(60) |
Aug
(9) |
Sep
(6) |
Oct
(20) |
Nov
(11) |
Dec
|
From: <nat...@us...> - 2003-08-30 15:45:19
|
Update of /cvsroot/jcharts/krysalis-jcharts In directory sc8-pr-cvs1:/tmp/cvs-serv31650 Modified Files: build.xml Log Message: got war task working so can run servlet demos again Index: build.xml =================================================================== RCS file: /cvsroot/jcharts/krysalis-jcharts/build.xml,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** build.xml 28 Aug 2003 02:04:52 -0000 1.5 --- build.xml 30 Aug 2003 15:45:15 -0000 1.6 *************** *** 8,12 **** = environment variables needed: = - = J2EE_HOME - if you want to compile the example servlets = TOMCAT_HOME - if you want to automatically build and deploy on TOMCAT =============================================================================================--> --- 8,11 ---- *************** *** 14,38 **** <project name="Krysalis-jCharts" default="compile" basedir="."> ! <property environment="environment" /> ! <property name="project.name" value="krysalis-jCharts" /> ! <property name="project.version" value="1.0.0" /> ! <property name="jar.jCharts" value="${project.name}-${project.version}.jar" /> ! <property name="zip.jCharts" value="${project.name}-${project.version}.zip" /> ! <property name="servletExamples" value="jChartsServletExamples" /> ! <property name="servletExamples.war" value="${servletExamples}.war" /> ! <property name="dir.release" value="delete_me/${project.name}-${project.version}" /> ! <property name="dir.src" value="src/java" /> ! <property name="dir.build" value="delete_me" /> ! <property name="dir.javadocs" value="${dir.release}/javadocs" /> ! <property name="batik.classpath" value="lib/batik-svggen.jar;lib/batik-dom.jar;lib/batik-awt-util.jar" /> ! <property name="demo.classpath" value="${jar.jCharts};${environment.J2EE_HOME}/lib/j2ee.jar" /> --- 13,39 ---- <project name="Krysalis-jCharts" default="compile" basedir="."> ! <property environment="environment"/> ! <property name="project.name" value="krysalis-jCharts"/> ! <property name="project.version" value="1.0.0"/> ! <property name="jar.jCharts" value="${project.name}-${project.version}.jar"/> ! <property name="zip.jCharts" value="${project.name}-${project.version}.zip"/> ! <property name="servletExamples" value="jChartsServletExamples"/> ! <property name="servletExamples.war" value="${servletExamples}.war"/> ! <property name="dir.release" value="delete_me/${project.name}-${project.version}"/> ! <property name="dir.src" value="src/java"/> ! <property name="dir.build" value="delete_me"/> ! <property name="dir.javadocs" value="${dir.release}/javadocs"/> ! <property name="batik.classpath" value="lib/batik-svggen.jar;lib/batik-dom.jar;lib/batik-awt-util.jar"/> ! <property name="j2ee.classpath" value="lib/servlet_2_2.jar"/> ! ! <property name="demo.classpath" value="${jar.jCharts};${environment.J2EE_HOME}/lib/j2ee.jar"/> *************** *** 40,51 **** <target name="prepare"> <tstamp/> ! <delete dir="${dir.build}" /> ! <mkdir dir="${dir.build}" /> </target> ! <!--===============================================================================--> <target name="compile" depends="prepare"> ! <javac classpath="${batik.classpath};${environment.J2EE_HOME}/lib/j2ee.jar" srcdir="${dir.src}" destdir="${dir.build}" /> </target> --- 41,52 ---- <target name="prepare"> <tstamp/> ! <delete dir="${dir.build}"/> ! <mkdir dir="${dir.build}"/> </target> ! <!--=== Compiles **ALL** the source ===============================================================--> <target name="compile" depends="prepare"> ! <javac classpath="${batik.classpath};${j2ee.classpath}" srcdir="${dir.src}" destdir="${dir.build}"/> </target> *************** *** 55,67 **** <target name="compile13" depends="prepare"> <javac classpath="${batik.classpath};${environment.J2EE_HOME}/lib/j2ee.jar" ! srcdir="${dir.src}" ! destdir="${dir.build}" ! fork="yes" ! executable="${environment.JAVA13_HOME}/bin/javac"> ! <exclude name="**/encoders/JPEGEncoder.java" /> ! <exclude name="**/encoders/PNGEncoder.java" /> ! <exclude name="**/encoders/ServletEncoderHelper.java" /> ! <exclude name="**/test/*" /> </javac> </target> --- 56,68 ---- <target name="compile13" depends="prepare"> <javac classpath="${batik.classpath};${environment.J2EE_HOME}/lib/j2ee.jar" ! srcdir="${dir.src}" ! destdir="${dir.build}" ! fork="yes" ! executable="${environment.JAVA13_HOME}/bin/javac"> ! <exclude name="**/encoders/JPEGEncoder.java"/> ! <exclude name="**/encoders/PNGEncoder.java"/> ! <exclude name="**/encoders/ServletEncoderHelper.java"/> ! <exclude name="**/test/*"/> </javac> </target> *************** *** 70,79 **** <!--===============================================================================--> <target name="test" depends="compile"> ! <java classname="org.krysalis.jcharts.test.ChartTestDriver"> ! <arg value="" /> ! <classpath> ! <pathelement path="${dir.build}"/> ! <pathelement path="../lib"/> ! </classpath> </java> </target> --- 71,80 ---- <!--===============================================================================--> <target name="test" depends="compile"> ! <java classname="org.krysalis.jcharts.test.ChartTestDriver"> ! <arg value=""/> ! <classpath> ! <pathelement path="${dir.build}"/> ! <pathelement path="../lib"/> ! </classpath> </java> </target> *************** *** 84,93 **** <!-- generates the samples used on the web site. --> <target name="websiteSamples" depends="compile"> ! <java classname="org.krysalis.jcharts.demo.samples.Sample"> ! <arg value="./src/documentation/resources/images" /> ! <classpath> ! <pathelement path="${dir.build}"/> ! <pathelement path="../lib"/> ! </classpath> </java> </target> --- 85,94 ---- <!-- generates the samples used on the web site. --> <target name="websiteSamples" depends="compile"> ! <java classname="org.krysalis.jcharts.demo.samples.Sample"> ! <arg value="./src/documentation/resources/images"/> ! <classpath> ! <pathelement path="${dir.build}"/> ! <pathelement path="../lib"/> ! </classpath> </java> </target> *************** *** 96,106 **** <!--===============================================================================--> <target name="jar" depends="compile"> ! <delete file="${jar.jCharts}" /> <jar jarfile="${jar.jCharts}"> ! <fileset dir="${dir.build}" > ! <exclude name="**/simpleservlet/**" /> ! <exclude name="**/designer/**" /> ! <exclude name="**/userGuide/**" /> ! <exclude name="**/samples/**" /> </fileset> </jar> --- 97,107 ---- <!--===============================================================================--> <target name="jar" depends="compile"> ! <delete file="${jar.jCharts}"/> <jar jarfile="${jar.jCharts}"> ! <fileset dir="${dir.build}"> ! <exclude name="**/simpleservlet/**"/> ! <exclude name="**/designer/**"/> ! <exclude name="**/userGuide/**"/> ! <exclude name="**/samples/**"/> </fileset> </jar> *************** *** 110,125 **** <!--===============================================================================--> <target name="javadocs"> ! <delete dir="${dir.javadocs}" /> ! <mkdir dir="${dir.javadocs}" /> <javadoc sourcepath="${dir.src}" ! classpath="${batik.classpath};${environment.J2EE_HOME}/lib/j2ee.jar" ! destdir="${dir.javadocs}" ! packagenames="org.krysalis.jcharts.*" ! excludepackagenames="javax.*,org.krysalis.jcharts.designer.*,org.krysalis.jcharts.demo.*" ! author="true" ! private="true" ! version="true" ! windowtitle="${project.name}-${project.version} API" ! doctitle="${project.name}-${project.version}"> </javadoc> </target> --- 111,126 ---- <!--===============================================================================--> <target name="javadocs"> ! <delete dir="${dir.javadocs}"/> ! <mkdir dir="${dir.javadocs}"/> <javadoc sourcepath="${dir.src}" ! classpath="${batik.classpath};${environment.J2EE_HOME}/lib/j2ee.jar" ! destdir="${dir.javadocs}" ! packagenames="org.krysalis.jcharts.*" ! excludepackagenames="javax.*,org.krysalis.jcharts.designer.*,org.krysalis.jcharts.demo.*" ! author="true" ! private="true" ! version="true" ! windowtitle="${project.name}-${project.version} API" ! doctitle="${project.name}-${project.version}"> </javadoc> </target> *************** *** 131,136 **** <target name="release" depends="jar"> ! <delete dir="${dir.release}" /> ! <mkdir dir="${dir.release}" /> --- 132,137 ---- <target name="release" depends="jar"> ! <delete dir="${dir.release}"/> ! <mkdir dir="${dir.release}"/> *************** *** 140,149 **** <!--======== jCharts.jar ==============================================--> ! <move file="${jar.jCharts}" todir="${dir.release}" /> <!--======== jCharts source ===========================================--> <copy todir="${dir.release}/${dir.src}"> <fileset dir="../${dir.src}"> ! <include name="**/*.java" /> </fileset> </copy> --- 141,150 ---- <!--======== jCharts.jar ==============================================--> ! <move file="${jar.jCharts}" todir="${dir.release}"/> <!--======== jCharts source ===========================================--> <copy todir="${dir.release}/${dir.src}"> <fileset dir="../${dir.src}"> ! <include name="**/*.java"/> </fileset> </copy> *************** *** 152,157 **** <copy todir="${dir.release}/demo"> <fileset dir="../demo"> ! <include name="**/*.java" /> ! <include name="**/*.xml" /> </fileset> </copy> --- 153,158 ---- <copy todir="${dir.release}/demo"> <fileset dir="../demo"> ! <include name="**/*.java"/> ! <include name="**/*.xml"/> </fileset> </copy> *************** *** 159,169 **** <!--======== servlet examples war =====================================--> ! <move file="${servletExamples.war}" todir="${dir.release}" /> <!--======== servlet examples source ==================================--> <copy todir="${dir.release}/${dir.servletsApp}"> <fileset dir="../demo/simpleServlet/"> ! <exclude name="**/*.class" /> ! <exclude name="**/*.jar" /> </fileset> </copy> --- 160,170 ---- <!--======== servlet examples war =====================================--> ! <move file="${servletExamples.war}" todir="${dir.release}"/> <!--======== servlet examples source ==================================--> <copy todir="${dir.release}/${dir.servletsApp}"> <fileset dir="../demo/simpleServlet/"> ! <exclude name="**/*.class"/> ! <exclude name="**/*.jar"/> </fileset> </copy> *************** *** 176,185 **** <!--======== build directory ===========================================--> ! <mkdir dir="${dir.release}/build" /> ! <copy file="build.xml" todir="${dir.release}/build" /> <!--======== docs directory ============================================--> <copy todir="${dir.release}/docs"> ! <fileset dir="../docs" /> </copy> --- 177,186 ---- <!--======== build directory ===========================================--> ! <mkdir dir="${dir.release}/build"/> ! <copy file="build.xml" todir="${dir.release}/build"/> <!--======== docs directory ============================================--> <copy todir="${dir.release}/docs"> ! <fileset dir="../docs"/> </copy> *************** *** 187,234 **** <!--======== lib directory ============================================--> <copy todir="${dir.release}/lib"> ! <fileset dir="../lib" /> </copy> <!--======== make the ZIP file =========================================--> ! <delete file="${zip.jCharts}" /> <zip zipfile="${zip.jCharts}"> ! <fileset dir="${dir.release}/.." /> </zip> ! <delete dir="${dir.release}/.." /> </target> - <!--== Target no longer needed ===================================================--> - <!--== Target no longer needed ===================================================--> - <!--== Target no longer needed ===================================================--> - <target name="compileExamples" depends="jar"> - <javac classpath="${demo.classpath}" srcdir="../${dir.servletsApp}/WEB-INF/classes" /> - </target> - <!--===============================================================================--> <!--===============================================================================--> <!--===============================================================================--> ! <target name="packageExamples" depends="compileExamples"> ! <delete file="${servletExamples.war}" /> ! ! <!-- copy file="${jar.jCharts}" todir="../${dir.servletsApp}/WEB-INF/lib" /--> <war warfile="${servletExamples.war}" webxml="${dir.src}/org/krysalis/jcharts/demo/simpleservlet/web.xml"> ! <fileset dir="${dir.src}/org/krysalis/jcharts/demo/simpleservlet/" > ! <exclude name="*.java" /> ! <exclude name="web.xml" /> </fileset> ! <lib dir="lib" /> ! <classes dir="${build.dir}/**/simpleServlet/*.class"/> </war> </target> ! <target name="deployTomcat" depends="packageExamples"> ! <delete dir="${environment.TOMCAT_HOME}/webapps/${servletExamples}" /> ! <delete file="${environment.TOMCAT_HOME}/webapps/${servletExamples.war}" /> ! <copy file="${servletExamples.war}" todir="${environment.TOMCAT_HOME}/webapps" /> </target> --- 188,231 ---- <!--======== lib directory ============================================--> <copy todir="${dir.release}/lib"> ! <fileset dir="../lib"/> </copy> <!--======== make the ZIP file =========================================--> ! <delete file="${zip.jCharts}"/> <zip zipfile="${zip.jCharts}"> ! <fileset dir="${dir.release}/.."/> </zip> ! <delete dir="${dir.release}/.."/> </target> <!--===============================================================================--> <!--===============================================================================--> <!--===============================================================================--> ! <target name="war" depends="jar"> ! <delete file="${servletExamples.war}"/> <war warfile="${servletExamples.war}" webxml="${dir.src}/org/krysalis/jcharts/demo/simpleservlet/web.xml"> ! <fileset dir="${dir.src}/org/krysalis/jcharts/demo/simpleservlet/"> ! <exclude name="*.java"/> ! <exclude name="web.xml"/> </fileset> ! <lib dir="."> ! <include name="${jar.jCharts}"/> ! </lib> ! <classes dir="${dir.build}"> ! <include name="**/simpleservlet/*.class"/> ! </classes> </war> </target> ! ! <target name="deployTomcat" depends="war"> ! <delete dir="${environment.TOMCAT_HOME}/webapps/${servletExamples}"/> ! <delete file="${environment.TOMCAT_HOME}/webapps/${servletExamples.war}"/> ! <copy file="${servletExamples.war}" todir="${environment.TOMCAT_HOME}/webapps"/> </target> |
From: <nat...@us...> - 2003-08-30 15:44:40
|
Update of /cvsroot/jcharts/krysalis-jcharts/src/java/org/krysalis/jcharts/demo/simpleservlet In directory sc8-pr-cvs1:/tmp/cvs-serv31533 Modified Files: chart.jsp Log Message: changed package naming Index: chart.jsp =================================================================== RCS file: /cvsroot/jcharts/krysalis-jcharts/src/java/org/krysalis/jcharts/demo/simpleservlet/chart.jsp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** chart.jsp 30 Aug 2003 15:39:12 -0000 1.1 --- chart.jsp 30 Aug 2003 15:44:33 -0000 1.2 *************** *** 1,46 **** ! <%@ 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 nat...@us... * ! * 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 --- 1,49 ---- ! <%@ page import="java.awt.*, ! org.krysalis.jcharts.properties.LegendProperties, ! org.krysalis.jcharts.properties.ChartProperties, ! org.krysalis.jcharts.properties.AxisProperties, ! org.krysalis.jcharts.properties.util.ChartFont, ! org.krysalis.jcharts.properties.LineChartProperties, ! org.krysalis.jcharts.properties.PointChartProperties, ! org.krysalis.jcharts.chartData.DataSeries, ! org.krysalis.jcharts.test.TestDataGenerator, ! org.krysalis.jcharts.chartData.AxisChartDataSet, ! org.krysalis.jcharts.types.ChartType, ! org.krysalis.jcharts.axisChart.AxisChart, ! org.krysalis.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 nat...@us... * ! * 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 |
Update of /cvsroot/jcharts/krysalis-jcharts/src/java/org/krysalis/jcharts/demo/simpleservlet In directory sc8-pr-cvs1:/tmp/cvs-serv30508 Added Files: jChartsTitle.png web.xml imageMapChart.jsp chart.jsp index.html Log Message: initial revisions --- NEW FILE: jChartsTitle.png --- (This appears to be a binary file; contents omitted.) --- NEW FILE: web.xml --- <!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN" "http://java.sun.com/j2ee/dtds/web-app_2_2.dtd"> <!-- $Id: web.xml,v 1.1 2003/08/30 15:39:12 nathaniel_auvil Exp $ --> <web-app> <display-name>jCharts - Simple Servlet Examples Web Application</display-name> <servlet> <servlet-name>PieChart2DServlet</servlet-name> <servlet-class>org.krysalis.jcharts.demo.simpleservlet.PieChart2DServlet</servlet-class> </servlet> <servlet> <servlet-name>BarChartServlet</servlet-name> <servlet-class>org.krysalis.jcharts.demo.simpleservlet.BarChartServlet</servlet-class> </servlet> <servlet> <servlet-name>ComboChartServlet</servlet-name> <servlet-class>org.krysalis.jcharts.demo.simpleservlet.ComboChartServlet</servlet-class> </servlet> <servlet> <servlet-name>ScatterPlotChartServlet</servlet-name> <servlet-class>org.krysalis.jcharts.demo.simpleservlet.ScatterPlotChartServlet</servlet-class> </servlet> <servlet> <servlet-name>HorizontalBarImageMapServlet</servlet-name> <servlet-class>org.krysalis.jcharts.demo.simpleservlet.HorizontalBarImageMapServlet</servlet-class> </servlet> <servlet> <servlet-name>ChartServlet</servlet-name> <servlet-class>org.krysalis.jcharts.demo.simpleservlet.ChartServlet</servlet-class> </servlet> <servlet> <servlet-name>DualYAxis</servlet-name> <servlet-class>org.krysalis.jcharts.demo.simpleservlet.DualYAxis</servlet-class> </servlet> <servlet-mapping> <servlet-name>PieChart2DServlet</servlet-name> <url-pattern>/PieChart2DServlet/*</url-pattern> </servlet-mapping> <servlet-mapping> <servlet-name>BarChartServlet</servlet-name> <url-pattern>/BarChartServlet/*</url-pattern> </servlet-mapping> <servlet-mapping> <servlet-name>ComboChartServlet</servlet-name> <url-pattern>/ComboChartServlet/*</url-pattern> </servlet-mapping> <servlet-mapping> <servlet-name>ScatterPlotChartServlet</servlet-name> <url-pattern>/ScatterPlotChartServlet/*</url-pattern> </servlet-mapping> <servlet-mapping> <servlet-name>DualYAxis</servlet-name> <url-pattern>/DualYAxis/*</url-pattern> </servlet-mapping> <servlet-mapping> <servlet-name>HorizontalBarImageMapServlet</servlet-name> <url-pattern>/HorizontalBarImageMapServlet/*</url-pattern> </servlet-mapping> <servlet-mapping> <servlet-name>ChartServlet</servlet-name> <url-pattern>/ChartServlet/*</url-pattern> </servlet-mapping> </web-app> --- NEW FILE: imageMapChart.jsp --- <%@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 nat...@us... * * 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. **********************************************************************************/ %> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <html> <head> <title>jCharts - Client-side Image Map Demo</title> <script language="JavaScript"> /*******************************************************************/ function showValues( value, legendLabel, xAxisLabel ) { if( xAxisLabel != 'null' ) { alert( "value= " + value + "\nlegend label= " + legendLabel + "\naxis label= " + xAxisLabel ); } else { alert( "value= " + value + "\nlegend label= " + legendLabel ); } } </script> </head> <body leftmargin=5 topmargin=0> <table width="100%" bgcolor="Black"> <tr> <td><img src="jChartsTitle.png" width=200 height=65 border=0 alt=""></td> </tr> <tr> <td style="font-family: 'Arial Narrow'; color: White; font-size: 14pt;"> Client-side Image Map Demo</td> </tr> </table> <br/><br/> <table border="1" cellspacing="10" cellpadding="10"> <tr> <td bgcolor="Silver"><img border="0" src="ChartServlet" useMap="#chartMap"></td> </tr> </table> <map name="chartMap"> <% 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() ); } %> </map> <br/><br/> Click on the chart to see the values.<br/><br/> This is a trivial example of what is possible. For example, you could create a <b>mouseOver</b> 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... <br/><br/> I will leave the rest to your imagination and your html coder... </body> </html> --- NEW FILE: chart.jsp --- <%@ 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 nat...@us... * * 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); } %> --- NEW FILE: index.html --- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <!-- /*********************************************************************************************** * File Info: $Id: index.html,v 1.1 2003/08/30 15:39: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 nat...@us... * * 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 ************************************************************************************************/ --> <html> <head> <title>jCharts - Simple Servlet Examples</title> <style> td.formats { vertical-align : middle; text-align : left; } </style> </head> <body leftmargin=0 topmargin=0> <table width="100%" cellspacing="5" cellpadding="5" bgcolor="Black"> <tr> <td><img src="jChartsTitle.png" width=200 height=65 border=0 alt=""></td> </tr> <tr> <td style="font-family: 'Arial Narrow'; color: White; font-size: 14pt;"> jCharts Simple Servlet Demo's</td> </tr> </table> <br/> <table width="100%" border="0" cellspacing="20" cellpadding="20"> <tr> <td> <table width="300" border="0" cellspacing="0" cellpadding="5" class="formats" style="border: 1px solid Black;"> <tr> <td class="formats" bgcolor="#FFEFDF"><a href="PieChart2DServlet">Pie</a></td> </tr> <tr> <td class="formats" bgcolor="#FFEFDF"><a href="BarChartServlet">Bar</a></td> </tr> <tr> <td class="formats" bgcolor="#FFEFDF"><a href="HorizontalBarImageMapServlet">Horizontal Bar with Image Map</a></td> </tr> <tr> <td class="formats" bgcolor="#FFEFDF"><a href="ComboChartServlet">Combo</a></td> </tr> <tr> <td class="formats" bgcolor="#FFEFDF"><a href="ScatterPlotChartServlet">Scatter Plot</a></td> </tr> <tr> <td class="formats" bgcolor="#FFEFDF"><a href="DualYAxis">Line with Dual Y Axis</a></td> </tr> </table> <p> <table border="0" cellspacing="0" cellpadding="5" style="border: 1px solid Black;"> <tr> <td> Here is a chart generated directly from a <a href="chart.jsp">JSP</a>, although, this is not a good design to follow, as<br/> the preferred way to generate a chart, is to use a Servlet. </td> </tr> </table> </p> </td> </tr> </table> </body> </html> |
From: <nat...@us...> - 2003-08-29 20:10:53
|
Update of /cvsroot/jcharts/krysalis-jcharts/src/documentation/content/xdocs In directory sc8-pr-cvs1:/tmp/cvs-serv27123 Modified Files: site.xml Log Message: initial version Index: site.xml =================================================================== RCS file: /cvsroot/jcharts/krysalis-jcharts/src/documentation/content/xdocs/site.xml,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** site.xml 28 Aug 2003 00:57:34 -0000 1.7 --- site.xml 29 Aug 2003 20:10:50 -0000 1.8 *************** *** 32,35 **** --- 32,36 ---- <tasks label="Tasks" href="http://sourceforge.net/pm/task.php?group_project_id=26743&group_id=16161&func=browse"/> <cvs label="CVS" href="http://sourceforge.net/cvs/?group_id=16161"/> + <antTasks label="Ant Build Targets" href="antTargets.html"/> </development> |
From: <nat...@us...> - 2003-08-29 20:10:47
|
Update of /cvsroot/jcharts/krysalis-jcharts/src/documentation/content/xdocs In directory sc8-pr-cvs1:/tmp/cvs-serv27102 Added Files: antTargets.xml Log Message: initial version --- NEW FILE: antTargets.xml --- <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE document PUBLIC "-//APACHE//DTD Documentation V1.1//EN" "document-v11.dtd"> <document> <header> <title>Ant Build Targets</title> <authors> <person name="Nathaniel Auvil" email=""/> </authors> </header> <body> <section> <title>compile</title> <p> Compiles <strong>ALL</strong> the source of jCharts. </p> <warning> This target, and all targets unless otherwise noted, require you to be running the JDK 1.4+. </warning> </section> <section> <title>compile13</title> <p> Compiles <strong>ALL</strong> the source of jCharts using the JDK 1.3+. It excludes the code which is specific to the JDK 1.4+, located in the <em>encoders</em> package. </p> <note> This target requires an environment variable: <strong>JAVA13_HOME</strong> to exist and be pointing to the JDK 1.3+ installation directory. </note> </section> <section> <title>websiteSamples</title> <p> Generates all the sample chart images used on the website an places them under the <code>documentation/resources/images/samples</code> directory. </p> <p><em>Depends: compile</em></p> </section> <section> <title>jar</title> <p> Creates a jar containing the core jCharts Classes. If you are creating custom mods against the jCharts tree, use this target to build yourself a jar to run against!. </p> <p><em>Depends: compile</em></p> </section> <section> <title>javadocs</title> <p> Generates JavaDocs for the jCharts sources. </p> </section> <section> <title>war</title> <p> </p> </section> <section> <title>release</title> <p> </p> </section> </body> </document> |
From: <nic...@us...> - 2003-08-28 15:44:08
|
Update of /cvsroot/jcharts/krysalis-jcharts In directory sc8-pr-cvs1:/tmp/cvs-serv23827 Added Files: .cvsignore Log Message: Things CVS must ignore. --- NEW FILE: .cvsignore --- build .checkstyle .checkclipse *.log garbage |
From: <nic...@us...> - 2003-08-28 15:43:05
|
Update of /cvsroot/jcharts/krysalis-jcharts In directory sc8-pr-cvs1:/tmp/cvs-serv23573 Modified Files: .classpath Log Message: adding servlet jar so that it properly compiles all the code. Index: .classpath =================================================================== RCS file: /cvsroot/jcharts/krysalis-jcharts/.classpath,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** .classpath 8 Aug 2003 08:51:57 -0000 1.1 --- .classpath 28 Aug 2003 15:42:57 -0000 1.2 *************** *** 5,11 **** <classpathentry kind="lib" path="lib/batik-awt-util.jar"/> <classpathentry kind="lib" path="lib/batik-dom.jar"/> ! <classpathentry kind="lib" path="lib/batik-svggen.jar"/> <classpathentry kind="lib" path="lib/batik-util.jar"/> ! <classpathentry kind="lib" path="lib/batik-xml.jar"/> ! <classpathentry kind="output" path="build"/> </classpath> --- 5,12 ---- <classpathentry kind="lib" path="lib/batik-awt-util.jar"/> <classpathentry kind="lib" path="lib/batik-dom.jar"/> ! <classpathentry kind="lib" path="lib/batik-svggen.jar"/> <classpathentry kind="lib" path="lib/batik-util.jar"/> ! <classpathentry kind="lib" path="lib/batik-xml.jar"/> ! <classpathentry kind="lib" path="lib/servlet_2_2.jar"/> ! <classpathentry kind="output" path="build"/> </classpath> |
From: <nic...@us...> - 2003-08-28 15:42:33
|
Update of /cvsroot/jcharts/krysalis-jcharts/lib In directory sc8-pr-cvs1:/tmp/cvs-serv23525 Added Files: servlet_2_2.jar Log Message: adding servlet jar so that it properly compiles all the code. --- NEW FILE: servlet_2_2.jar --- (This appears to be a binary file; contents omitted.) |
From: <nic...@us...> - 2003-08-28 14:36:36
|
Update of /cvsroot/jcharts/krysalis-jcharts/src/java/org/krysalis/jcharts/nonAxisChart In directory sc8-pr-cvs1:/tmp/cvs-serv10788/src/java/org/krysalis/jcharts/nonAxisChart Modified Files: RadarChart.java Log Message: Use class instead of instance. Index: RadarChart.java =================================================================== RCS file: /cvsroot/jcharts/krysalis-jcharts/src/java/org/krysalis/jcharts/nonAxisChart/RadarChart.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** RadarChart.java 7 Aug 2003 21:55:26 -0000 1.2 --- RadarChart.java 28 Aug 2003 14:36:28 -0000 1.3 *************** *** 259,263 **** // draw gridline labels g.setColor( Color.darkGray ); ! g.setFont( props.getAxisLabelChartFont().DEFAULT_AXIS_VALUE.getFont() ); int selectedLine = (int) iRadarChartDataSet.getNumberOfDataItems() / 2; for( double i = scaleIncrement; i <= scaleMax; i += scaleIncrement ) --- 259,263 ---- // draw gridline labels g.setColor( Color.darkGray ); ! g.setFont( ChartFont.DEFAULT_AXIS_VALUE.getFont() ); int selectedLine = (int) iRadarChartDataSet.getNumberOfDataItems() / 2; for( double i = scaleIncrement; i <= scaleMax; i += scaleIncrement ) |
From: <nat...@us...> - 2003-08-28 02:04:55
|
Update of /cvsroot/jcharts/krysalis-jcharts In directory sc8-pr-cvs1:/tmp/cvs-serv31363 Modified Files: build.xml Log Message: got the javadocs target working Index: build.xml =================================================================== RCS file: /cvsroot/jcharts/krysalis-jcharts/build.xml,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** build.xml 28 Aug 2003 01:46:32 -0000 1.4 --- build.xml 28 Aug 2003 02:04:52 -0000 1.5 *************** *** 29,35 **** <property name="dir.src" value="src/java" /> ! <property name="dir.build" value="garbage" /> ! <property name="dir.tempRelease" value="release" /> ! <property name="dir.javadocs" value="javadocs" /> --- 29,34 ---- <property name="dir.src" value="src/java" /> ! <property name="dir.build" value="delete_me" /> ! <property name="dir.javadocs" value="${dir.release}/javadocs" /> *************** *** 56,60 **** <target name="compile13" depends="prepare"> <javac classpath="${batik.classpath};${environment.J2EE_HOME}/lib/j2ee.jar" ! srcdir="../${dir.src}" destdir="${dir.build}" fork="yes" --- 55,59 ---- <target name="compile13" depends="prepare"> <javac classpath="${batik.classpath};${environment.J2EE_HOME}/lib/j2ee.jar" ! srcdir="${dir.src}" destdir="${dir.build}" fork="yes" *************** *** 117,121 **** destdir="${dir.javadocs}" packagenames="org.krysalis.jcharts.*" ! excludepackagenames="javax.*" author="true" private="true" --- 116,120 ---- destdir="${dir.javadocs}" packagenames="org.krysalis.jcharts.*" ! excludepackagenames="javax.*,org.krysalis.jcharts.designer.*,org.krysalis.jcharts.demo.*" author="true" private="true" *************** *** 130,137 **** <!--===============================================================================--> <!--===============================================================================--> ! <target name="release" depends="jar,javadocs,packageExamples"> <delete dir="${dir.release}" /> <mkdir dir="${dir.release}" /> --- 129,140 ---- <!--===============================================================================--> <!--===============================================================================--> ! <target name="release" depends="jar"> <delete dir="${dir.release}" /> <mkdir dir="${dir.release}" /> + + + <!-- //todo need to build WAR of examples --> + <!-- //todo need to run javadocs target --> |
From: <ki...@us...> - 2003-08-28 01:52:33
|
Update of /cvsroot/jcharts/krysalis-jcharts/src/java/org/krysalis/jcharts/axisChart In directory sc8-pr-cvs1:/tmp/cvs-serv28627/axisChart Modified Files: AxisChart.java Log Message: Fixed rounding problem in right hand axis label creation code. Index: AxisChart.java =================================================================== RCS file: /cvsroot/jcharts/krysalis-jcharts/src/java/org/krysalis/jcharts/axisChart/AxisChart.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** AxisChart.java 27 Aug 2003 04:37:44 -0000 1.4 --- AxisChart.java 28 Aug 2003 01:52:30 -0000 1.5 *************** *** 320,326 **** Float myFloat = new Float (this.yAxis.getAxisLabelsGroup().getTextTag(j).getText()); float temp = myFloat.floatValue(); ! Integer myInteger = new Integer ( Math.round(Math.round((float)(temp / this.axisProperties.getYAxisProperties().getSecondScaleRight()))/10)*10 ); ! String myString = new String (""); ! myString = myInteger.toString(); numericTagGroup2.addLabel(myString); j++; --- 320,328 ---- Float myFloat = new Float (this.yAxis.getAxisLabelsGroup().getTextTag(j).getText()); float temp = myFloat.floatValue(); ! // Rounding problems were causing errors ! //Integer myInteger = new Integer ( Math.round(Math.round((float)(temp / this.axisProperties.getYAxisProperties().getSecondScaleRight()))/10)*10 ); ! //String myString = new String (""); ! //myString = myInteger.toString(); ! String myString = new String (String.valueOf(Math.round(temp / (float)this.axisProperties.getYAxisProperties().getSecondScaleRight())) ); numericTagGroup2.addLabel(myString); j++; |
From: <nat...@us...> - 2003-08-28 01:46:35
|
Update of /cvsroot/jcharts/krysalis-jcharts In directory sc8-pr-cvs1:/tmp/cvs-serv27912 Modified Files: build.xml Log Message: updated the jar target Index: build.xml =================================================================== RCS file: /cvsroot/jcharts/krysalis-jcharts/build.xml,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** build.xml 16 Aug 2003 16:01:45 -0000 1.3 --- build.xml 28 Aug 2003 01:46:32 -0000 1.4 *************** *** 12,20 **** =============================================================================================--> ! <project name="jCharts" default="compile" basedir="."> <property environment="environment" /> ! <property name="project.name" value="jCharts" /> <property name="project.version" value="1.0.0" /> --- 12,20 ---- =============================================================================================--> ! <project name="Krysalis-jCharts" default="compile" basedir="."> <property environment="environment" /> ! <property name="project.name" value="krysalis-jCharts" /> <property name="project.version" value="1.0.0" /> *************** *** 32,36 **** <property name="dir.tempRelease" value="release" /> <property name="dir.javadocs" value="javadocs" /> ! <property name="dir.servletsApp" value="demo/simpleServlet" /> <property name="batik.classpath" value="lib/batik-svggen.jar;lib/batik-dom.jar;lib/batik-awt-util.jar" /> --- 32,36 ---- <property name="dir.tempRelease" value="release" /> <property name="dir.javadocs" value="javadocs" /> ! <property name="batik.classpath" value="lib/batik-svggen.jar;lib/batik-dom.jar;lib/batik-awt-util.jar" /> *************** *** 98,103 **** <target name="jar" depends="compile"> <delete file="${jar.jCharts}" /> ! <jar jarfile="${jar.jCharts}" basedir="${dir.build}" /> ! <delete dir="${dir.build}" /> </target> --- 98,109 ---- <target name="jar" depends="compile"> <delete file="${jar.jCharts}" /> ! <jar jarfile="${jar.jCharts}"> ! <fileset dir="${dir.build}" > ! <exclude name="**/simpleservlet/**" /> ! <exclude name="**/designer/**" /> ! <exclude name="**/userGuide/**" /> ! <exclude name="**/samples/**" /> ! </fileset> ! </jar> </target> *************** *** 107,114 **** <delete dir="${dir.javadocs}" /> <mkdir dir="${dir.javadocs}" /> ! <javadoc sourcepath="../${dir.src}" classpath="${batik.classpath};${environment.J2EE_HOME}/lib/j2ee.jar" destdir="${dir.javadocs}" ! packagenames="org.jCharts.*" excludepackagenames="javax.*" author="true" --- 113,120 ---- <delete dir="${dir.javadocs}" /> <mkdir dir="${dir.javadocs}" /> ! <javadoc sourcepath="${dir.src}" classpath="${batik.classpath};${environment.J2EE_HOME}/lib/j2ee.jar" destdir="${dir.javadocs}" ! packagenames="org.krysalis.jcharts.*" excludepackagenames="javax.*" author="true" *************** *** 191,197 **** ! <!--===============================================================================--> ! <!--===============================================================================--> ! <!--===============================================================================--> <target name="compileExamples" depends="jar"> <javac classpath="${demo.classpath}" srcdir="../${dir.servletsApp}/WEB-INF/classes" /> --- 197,204 ---- ! ! <!--== Target no longer needed ===================================================--> ! <!--== Target no longer needed ===================================================--> ! <!--== Target no longer needed ===================================================--> <target name="compileExamples" depends="jar"> <javac classpath="${demo.classpath}" srcdir="../${dir.servletsApp}/WEB-INF/classes" /> *************** *** 205,216 **** <delete file="${servletExamples.war}" /> ! <copy file="${jar.jCharts}" todir="../${dir.servletsApp}/WEB-INF/lib" /> ! <war warfile="${servletExamples.war}" webxml="../${dir.servletsApp}/WEB-INF/web.xml"> ! <fileset dir="../${dir.servletsApp}" > ! <exclude name="**/WEB-INF/**" /> </fileset> ! <lib dir="../${dir.servletsApp}/WEB-INF/lib" /> ! <classes dir="../${dir.servletsApp}/WEB-INF/classes"/> </war> </target> --- 212,224 ---- <delete file="${servletExamples.war}" /> ! <!-- copy file="${jar.jCharts}" todir="../${dir.servletsApp}/WEB-INF/lib" /--> ! <war warfile="${servletExamples.war}" webxml="${dir.src}/org/krysalis/jcharts/demo/simpleservlet/web.xml"> ! <fileset dir="${dir.src}/org/krysalis/jcharts/demo/simpleservlet/" > ! <exclude name="*.java" /> ! <exclude name="web.xml" /> </fileset> ! <lib dir="lib" /> ! <classes dir="${build.dir}/**/simpleServlet/*.class"/> </war> </target> |
From: <nat...@us...> - 2003-08-28 01:18:06
|
Update of /cvsroot/jcharts/krysalis-jcharts/src/java/org/krysalis/jcharts/demo/simpleservlet In directory sc8-pr-cvs1:/tmp/cvs-serv22698 Modified Files: DualYAxis.java Log Message: checked in other servlets Index: DualYAxis.java =================================================================== RCS file: /cvsroot/jcharts/krysalis-jcharts/src/java/org/krysalis/jcharts/demo/simpleservlet/DualYAxis.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** DualYAxis.java 27 Aug 2003 04:37:44 -0000 1.1 --- DualYAxis.java 28 Aug 2003 01:18:02 -0000 1.2 *************** *** 1,3 **** ! package org.krysalis.jcharts.demo; /*********************************************************************************************** * File Info: $Id$ --- 1,3 ---- ! /*********************************************************************************************** * File Info: $Id$ *************** *** 39,57 **** ************************************************************************************************/ ! import java.awt.*; ! import org.krysalis.jcharts.axisChart.*; ! import org.krysalis.jcharts.chartData.*; ! import org.krysalis.jcharts.chartData.interfaces.*; import org.krysalis.jcharts.encoders.ServletEncoderHelper; ! import org.krysalis.jcharts.properties.*; ! import org.krysalis.jcharts.properties.util.*; ! import org.krysalis.jcharts.types.*; ! import java.util.*; ! import javax.servlet.*; ! import javax.servlet.http.*; import java.io.IOException; ! // Dual Y axis changes courtesy of Stéphane NGUYEN integrated by CMC 25Aug03 // French translation courtesy of my good wife Jacki ... public class DualYAxis extends ChartServlet { --- 39,67 ---- ************************************************************************************************/ ! package org.krysalis.jcharts.demo.simpleservlet; ! ! ! import org.krysalis.jcharts.axisChart.AxisChart; ! import org.krysalis.jcharts.chartData.AxisChartDataSet; ! import org.krysalis.jcharts.chartData.DataSeries; ! import org.krysalis.jcharts.chartData.interfaces.IAxisDataSeries; import org.krysalis.jcharts.encoders.ServletEncoderHelper; ! import org.krysalis.jcharts.properties.AxisProperties; ! import org.krysalis.jcharts.properties.ChartProperties; ! import org.krysalis.jcharts.properties.ClusteredBarChartProperties; ! import org.krysalis.jcharts.properties.DataAxisProperties; ! import org.krysalis.jcharts.properties.LegendProperties; ! import org.krysalis.jcharts.properties.LineChartProperties; ! import org.krysalis.jcharts.properties.PointChartProperties; ! import org.krysalis.jcharts.properties.util.ChartFont; ! import org.krysalis.jcharts.types.ChartType; ! import javax.servlet.ServletException; ! import javax.servlet.http.HttpServletRequest; ! import javax.servlet.http.HttpServletResponse; ! import java.awt.*; import java.io.IOException; ! // Dual Y axis changes courtesy of St�phane NGUYEN integrated by CMC 25Aug03 // French translation courtesy of my good wife Jacki ... public class DualYAxis extends ChartServlet { *************** *** 99,103 **** axisProperties.setBackgroundPaint(new Color (245, 245, 245)); ! //Paramétrage de la boîte de légende //Parameters for the legend box //legendProperties.setPlacement(LegendAreaProperties.RIGHT); --- 109,113 ---- axisProperties.setBackgroundPaint(new Color (245, 245, 245)); ! //Param�trage de la bo�te de l�gende //Parameters for the legend box //legendProperties.setPlacement(LegendAreaProperties.RIGHT); *************** *** 109,118 **** legendProperties.setChartPadding(10); ! //Arrondi à la puissance 10 //Round up to the power of 10 DataAxisProperties dataAxisProperties= (DataAxisProperties) axisProperties.getYAxisProperties(); dataAxisProperties.setRoundToNearest(1); ! //Parametrage du nombre de graduation sur l'axe des ordonnées //Set the number of ticks(?) for the ordinal axis dataAxisProperties.setNumItems(6); --- 119,128 ---- legendProperties.setChartPadding(10); ! //Arrondi � la puissance 10 //Round up to the power of 10 DataAxisProperties dataAxisProperties= (DataAxisProperties) axisProperties.getYAxisProperties(); dataAxisProperties.setRoundToNearest(1); ! //Parametrage du nombre de graduation sur l'axe des ordonn�es //Set the number of ticks(?) for the ordinal axis dataAxisProperties.setNumItems(6); *************** *** 122,126 **** dataAxisProperties.setUseCommas(false); ! //Ne pas afficher les bordures supérieur et droite du chart // Don't attach upper borders and the right of the chart axisProperties.getYAxisProperties().setShowEndBorder(false); --- 132,136 ---- dataAxisProperties.setUseCommas(false); ! //Ne pas afficher les bordures sup�rieur et droite du chart // Don't attach upper borders and the right of the chart axisProperties.getYAxisProperties().setShowEndBorder(false); *************** *** 135,139 **** clusteredBarChartProperties = new ClusteredBarChartProperties(); ! //Paramètrage de la largeur des barres de l'histogramme et non affichage des contours //Set the width of the bars and don't show the outline clusteredBarChartProperties.setWidthPercentage( 0.70f ); --- 145,149 ---- clusteredBarChartProperties = new ClusteredBarChartProperties(); ! //Param�trage de la largeur des barres de l'histogramme et non affichage des contours //Set the width of the bars and don't show the outline clusteredBarChartProperties.setWidthPercentage( 0.70f ); *************** *** 183,192 **** Paint[] linePaints = new Paint[]{Color.green}; ! //------------On récupère une 2ème échelle "secondScale"------------------ ! //------------et on fait un traitement pour les nombres négatifs---------- //------------We get back the 2nd scale "secondScale"--------------------- //-------------and we handle the negative numbers--------------------- //On identifie la valeur maximum absolue des data Clustered Bar ! //et on compte le nombre de zéro et le nombre de chiffres négatifs // We identify the absolute maximum value of the data in the Clustered Bar // and we count the number of zero and negative digits --- 193,202 ---- Paint[] linePaints = new Paint[]{Color.green}; ! //------------On r�cup�re une 2�me �chelle "secondScale"------------------ ! //------------et on fait un traitement pour les nombres n�gatifs---------- //------------We get back the 2nd scale "secondScale"--------------------- //-------------and we handle the negative numbers--------------------- //On identifie la valeur maximum absolue des data Clustered Bar ! //et on compte le nombre de z�ro et le nombre de chiffres n�gatifs // We identify the absolute maximum value of the data in the Clustered Bar // and we count the number of zero and negative digits *************** *** 207,211 **** //On identifie la valeur maximum absolue des data Line ! //et on compte le nombre de zéro et le nombre de chiffres négatifs // We identify the absolute maximum value of the data lines // and we count the number of zero and negative digits --- 217,221 ---- //On identifie la valeur maximum absolue des data Line ! //et on compte le nombre de z�ro et le nombre de chiffres n�gatifs // We identify the absolute maximum value of the data lines // and we count the number of zero and negative digits *************** *** 222,227 **** } ! //On définit la valeur de la seconde échelle si les ordres de grandeurs ! //sont très différent (de l'ordre de 10). //We define the value of the second scale if the increment is an order of //magnitude greater --- 232,237 ---- } ! //On d�finit la valeur de la seconde �chelle si les ordres de grandeurs ! //sont tr�s diff�rent (de l'ordre de 10). //We define the value of the second scale if the increment is an order of //magnitude greater *************** *** 234,244 **** } ! //On vérifie s'il y a des valeurs négatives // Check if there are negative numbers if (numberOfNegativ>0) { if ((maxDataLineAbs*secondScale)>maxDataClustAbs) { axisProperties.getYAxisProperties().setMinRightAxis((double) (-maxDataLineAbs*secondScale)); ! //Si les valeurs ne sont pas toutes négatives on affiche l'axe des ordonnées ! //de manière a ce que le zéro soit centré // If the numbers are not all negative we center the ordinal axis around zero if (numberOfNegativ!=(3*xAxisLabels.length-numberOfZero)) { --- 244,254 ---- } ! //On v�rifie s'il y a des valeurs n�gatives // Check if there are negative numbers if (numberOfNegativ>0) { if ((maxDataLineAbs*secondScale)>maxDataClustAbs) { axisProperties.getYAxisProperties().setMinRightAxis((double) (-maxDataLineAbs*secondScale)); ! //Si les valeurs ne sont pas toutes n�gatives on affiche l'axe des ordonn�es ! //de mani�re a ce que le z�ro soit centr� // If the numbers are not all negative we center the ordinal axis around zero if (numberOfNegativ!=(3*xAxisLabels.length-numberOfZero)) { |
From: <nat...@us...> - 2003-08-28 01:17:42
|
Update of /cvsroot/jcharts/krysalis-jcharts/src/java/org/krysalis/jcharts/demo/simpleservlet In directory sc8-pr-cvs1:/tmp/cvs-serv22599 Added Files: ChartServlet.java ScatterPlotChartServlet.java PieChart2DServlet.java ComboChartServlet.java HorizontalBarImageMapServlet.java BarChartServlet.java Log Message: initial revision --- NEW FILE: ChartServlet.java --- /*********************************************************************************************** * File Info: $Id: ChartServlet.java,v 1.1 2003/08/28 01:17:36 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 nat...@us... * * 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.krysalis.jcharts.demo.simpleservlet; import org.krysalis.jcharts.Chart; import org.krysalis.jcharts.chartData.ChartDataException; import org.krysalis.jcharts.encoders.ServletEncoderHelper; import org.krysalis.jcharts.properties.PropertyException; import javax.servlet.ServletException; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; 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 ); } } --- NEW FILE: ScatterPlotChartServlet.java --- /*********************************************************************************************** * File Info: $Id: ScatterPlotChartServlet.java,v 1.1 2003/08/28 01:17:36 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 nat...@us... * * 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.krysalis.jcharts.demo.simpleservlet; import org.krysalis.jcharts.axisChart.ScatterPlotAxisChart; import org.krysalis.jcharts.chartData.ScatterPlotDataSeries; import org.krysalis.jcharts.chartData.ScatterPlotDataSet; import org.krysalis.jcharts.encoders.ServletEncoderHelper; import org.krysalis.jcharts.properties.AxisProperties; import org.krysalis.jcharts.properties.ChartProperties; import org.krysalis.jcharts.properties.DataAxisProperties; import org.krysalis.jcharts.properties.LegendProperties; import org.krysalis.jcharts.properties.LineChartProperties; import org.krysalis.jcharts.properties.PointChartProperties; import org.krysalis.jcharts.properties.ScatterPlotProperties; import org.krysalis.jcharts.properties.util.ChartFont; import javax.servlet.ServletException; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; 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(); } } } --- NEW FILE: PieChart2DServlet.java --- /*********************************************************************************************** * File Info: $Id: PieChart2DServlet.java,v 1.1 2003/08/28 01:17: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 nat...@us... * * 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.krysalis.jcharts.demo.simpleservlet; import org.krysalis.jcharts.chartData.ChartDataException; import org.krysalis.jcharts.chartData.PieChartDataSet; import org.krysalis.jcharts.encoders.ServletEncoderHelper; import org.krysalis.jcharts.nonAxisChart.PieChart2D; import org.krysalis.jcharts.properties.ChartProperties; import org.krysalis.jcharts.properties.LegendProperties; import org.krysalis.jcharts.properties.PieChart2DProperties; import javax.servlet.ServletException; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; 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 ); } } --- NEW FILE: ComboChartServlet.java --- /*********************************************************************************************** * File Info: $Id: ComboChartServlet.java,v 1.1 2003/08/28 01:17: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 nat...@us... * * 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.krysalis.jcharts.demo.simpleservlet; import org.krysalis.jcharts.properties.LineChartProperties; import org.krysalis.jcharts.properties.BarChartProperties; import org.krysalis.jcharts.properties.LegendProperties; import org.krysalis.jcharts.properties.AxisProperties; import org.krysalis.jcharts.properties.ChartProperties; import org.krysalis.jcharts.properties.PointChartProperties; import org.krysalis.jcharts.properties.util.ChartFont; import org.krysalis.jcharts.chartData.interfaces.IAxisDataSeries; import org.krysalis.jcharts.chartData.DataSeries; import org.krysalis.jcharts.chartData.AxisChartDataSet; import org.krysalis.jcharts.types.ChartType; import org.krysalis.jcharts.axisChart.AxisChart; import org.krysalis.jcharts.encoders.ServletEncoderHelper; 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(); } } } --- NEW FILE: HorizontalBarImageMapServlet.java --- /*********************************************************************************************** * 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 nat...@us... * * 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.krysalis.jcharts.demo.simpleservlet; import org.krysalis.jcharts.axisChart.AxisChart; import org.krysalis.jcharts.chartData.AxisChartDataSet; import org.krysalis.jcharts.chartData.ChartDataException; import org.krysalis.jcharts.chartData.DataSeries; import org.krysalis.jcharts.chartData.interfaces.IAxisDataSeries; import org.krysalis.jcharts.imageMap.ImageMap; import org.krysalis.jcharts.properties.AxisProperties; import org.krysalis.jcharts.properties.BarChartProperties; import org.krysalis.jcharts.properties.ChartProperties; import org.krysalis.jcharts.properties.LegendProperties; import org.krysalis.jcharts.properties.PropertyException; import org.krysalis.jcharts.properties.util.ChartFont; import org.krysalis.jcharts.types.ChartType; import javax.servlet.ServletException; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.awt.*; import java.io.IOException; /************************************************************************************* * * @author Nathaniel Auvil * @version $Id: HorizontalBarImageMapServlet.java,v 1.1 2003/08/28 01:17:36 nathaniel_auvil Exp $ ************************************************************************************/ 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 ); } } --- NEW FILE: BarChartServlet.java --- /*********************************************************************************************** * 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 nat...@us... * * 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.krysalis.jcharts.demo.simpleservlet; import org.krysalis.jcharts.axisChart.AxisChart; import org.krysalis.jcharts.axisChart.customRenderers.axisValue.renderers.ValueLabelPosition; import org.krysalis.jcharts.axisChart.customRenderers.axisValue.renderers.ValueLabelRenderer; import org.krysalis.jcharts.chartData.AxisChartDataSet; import org.krysalis.jcharts.chartData.DataSeries; import org.krysalis.jcharts.chartData.interfaces.IAxisDataSeries; import org.krysalis.jcharts.encoders.ServletEncoderHelper; import org.krysalis.jcharts.properties.AxisProperties; import org.krysalis.jcharts.properties.BarChartProperties; import org.krysalis.jcharts.properties.ChartProperties; import org.krysalis.jcharts.properties.DataAxisProperties; import org.krysalis.jcharts.properties.LegendProperties; import org.krysalis.jcharts.properties.PropertyException; import org.krysalis.jcharts.properties.util.ChartFont; import org.krysalis.jcharts.types.ChartType; import javax.servlet.ServletException; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.awt.*; import java.io.IOException; /************************************************************************************* * * @author Nathaniel Auvil * @version $Id: BarChartServlet.java,v 1.1 2003/08/28 01:17:36 nathaniel_auvil Exp $ ************************************************************************************/ 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(); } } } |
From: <nat...@us...> - 2003-08-28 00:57:38
|
Update of /cvsroot/jcharts/krysalis-jcharts/src/documentation/content/xdocs In directory sc8-pr-cvs1:/tmp/cvs-serv19315 Modified Files: site.xml Log Message: fixed links Index: site.xml =================================================================== RCS file: /cvsroot/jcharts/krysalis-jcharts/src/documentation/content/xdocs/site.xml,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** site.xml 16 Aug 2003 20:46:25 -0000 1.6 --- site.xml 28 Aug 2003 00:57:34 -0000 1.7 *************** *** 2,5 **** --- 2,7 ---- <!-- + File Info: $Id$ + Forrest site.xml *************** *** 28,32 **** <credits label="Credits" href="credits.html"/> <changes label="Changes" href="changes.html"/> ! <tasks label="Tasks" href="http://sourceforge.net/pm/?group_id=16161"/> <cvs label="CVS" href="http://sourceforge.net/cvs/?group_id=16161"/> </development> --- 30,34 ---- <credits label="Credits" href="credits.html"/> <changes label="Changes" href="changes.html"/> ! <tasks label="Tasks" href="http://sourceforge.net/pm/task.php?group_project_id=26743&group_id=16161&func=browse"/> <cvs label="CVS" href="http://sourceforge.net/cvs/?group_id=16161"/> </development> |
From: <nat...@us...> - 2003-08-28 00:56:38
|
Update of /cvsroot/jcharts/krysalis-jcharts/src/java/org/krysalis/jcharts/chartData/interfaces In directory sc8-pr-cvs1:/tmp/cvs-serv19168 Modified Files: IAxisDataSeries.java Log Message: fixed java doc comment Index: IAxisDataSeries.java =================================================================== RCS file: /cvsroot/jcharts/krysalis-jcharts/src/java/org/krysalis/jcharts/chartData/interfaces/IAxisDataSeries.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** IAxisDataSeries.java 17 May 2003 16:57:26 -0000 1.1 --- IAxisDataSeries.java 28 Aug 2003 00:56:34 -0000 1.2 *************** *** 82,86 **** * @throws PropertyException * @since 0.7.0 ! * @see org.jCharts.properties.ChartProperties#setValidate( boolean ) *********************************************************************************************/ public void validate() throws ChartDataException, PropertyException; --- 82,86 ---- * @throws PropertyException * @since 0.7.0 ! * @see org.krysalis.jcharts.properties.ChartProperties#setValidate( boolean ) *********************************************************************************************/ public void validate() throws ChartDataException, PropertyException; |
From: <ki...@us...> - 2003-08-27 19:21:30
|
Update of /cvsroot/jcharts/krysalis-jcharts/src/java/org/krysalis/jcharts/demo/simpleservlet In directory sc8-pr-cvs1:/tmp/cvs-serv17990/simpleservlet Log Message: Directory /cvsroot/jcharts/krysalis-jcharts/src/java/org/krysalis/jcharts/demo/simpleservlet added to the repository |
From: <ki...@us...> - 2003-08-27 04:38:04
|
Update of /cvsroot/jcharts/krysalis-jcharts/src/java/org/krysalis/jcharts/demo/simpleservlet In directory sc8-pr-cvs1:/tmp/cvs-serv23576/demo/simpleservlet Added Files: DualYAxis.java Log Message: Integration of the Dual Y axis code that was submitted to Nathaniel by Romain SEGUY. These are new properties added to the AxisTypeProperties class ChartFont AxisTypeProperties.getScaleChartFontRight() void AxisTypeProperties.setScaleChartFontRight( ChartFont scaleChartFontRight ) void AxisTypeProperties.setShowRightAxis( boolean showRightAxis ) float AxisTypeProperties.getSecondScaleRight() void AxisTypeProperties.setSecondScaleRight(float secondScaleRight) double AxisTypeProperties.getMinRightAxis() void AxisTypeProperties.setMinRightAxis(double minRightAxis) double AxisTypeProperties.getMaxRightAxis() void AxisTypeProperties.setMaxRightAxis(double maxRightAxis) Added to Axis class TextTagGroup Axis.getAxisLabelsGroupRight() void Axis.setAxisLabelsGroupRight( TextTagGroup axisLabelsGroupRight ) There is a demonstration servlet in org\krysalis\jcharts\demo\simpleservlet called DualYAxis.java --- NEW FILE: DualYAxis.java --- package org.krysalis.jcharts.demo; /*********************************************************************************************** * File Info: $Id: DualYAxis.java,v 1.1 2003/08/27 04:37:44 kiwicmc 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 nat...@us... * * 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 java.awt.*; import org.krysalis.jcharts.axisChart.*; import org.krysalis.jcharts.chartData.*; import org.krysalis.jcharts.chartData.interfaces.*; import org.krysalis.jcharts.encoders.ServletEncoderHelper; import org.krysalis.jcharts.properties.*; import org.krysalis.jcharts.properties.util.*; import org.krysalis.jcharts.types.*; import java.util.*; import javax.servlet.*; import javax.servlet.http.*; import java.io.IOException; // Dual Y axis changes courtesy of Stéphane NGUYEN integrated by CMC 25Aug03 // French translation courtesy of my good wife Jacki ... public class DualYAxis extends ChartServlet { //---all of the charts will have some properties. private LineChartProperties lineChartProperties; private ClusteredBarChartProperties clusteredBarChartProperties; protected LegendProperties legendProperties; protected ChartProperties chartProperties; protected AxisProperties axisProperties; //---all of the charts have the same size protected int width = 750; protected int height = 430; public void init() { //---------------------Font & Police---------------------------------------- legendProperties = new LegendProperties(); chartProperties = new ChartProperties(); axisProperties = new AxisProperties(false); ChartFont axisScaleFont = new ChartFont(new Font("Arial Narrow", Font.PLAIN, 10), Color.black); axisProperties.getXAxisProperties().setScaleChartFont(axisScaleFont); axisProperties.getYAxisProperties().setScaleChartFont(axisScaleFont); ChartFont axisTitleFont = new ChartFont(new Font("Arial Narrow", Font.PLAIN, 13), Color.black); axisProperties.getXAxisProperties().setTitleChartFont(axisTitleFont); axisProperties.getYAxisProperties().setTitleChartFont(axisTitleFont); ChartFont titleFont = new ChartFont(new Font("Georgia Negreta cursiva", Font.PLAIN, 15), Color.black); chartProperties.setTitleFont(titleFont); //On fixe la marge avec le cadre // Set the margin within the frame chartProperties.setEdgePadding(2f); //On met le graphe sur un fond gris clair // Set the chart against a plain grey background axisProperties.setBackgroundPaint(new Color (245, 245, 245)); //Paramétrage de la boîte de légende //Parameters for the legend box //legendProperties.setPlacement(LegendAreaProperties.RIGHT); //legendProperties.setNumColumns(1); //legendProperties.setFont( new Font("Arial Narrow", Font.PLAIN, 13) ); //legendProperties.setFontPaint(Color.black); ChartFont legendFont = new ChartFont(new Font("Arial Narrow", Font.PLAIN, 13), Color.black); legendProperties.setChartFont(legendFont); legendProperties.setChartPadding(10); //Arrondi à la puissance 10 //Round up to the power of 10 DataAxisProperties dataAxisProperties= (DataAxisProperties) axisProperties.getYAxisProperties(); dataAxisProperties.setRoundToNearest(1); //Parametrage du nombre de graduation sur l'axe des ordonnées //Set the number of ticks(?) for the ordinal axis dataAxisProperties.setNumItems(6); //utilisation de la virgule s'il y a lieu (normalement non) // Set the use of the comma if there are any (usually not) dataAxisProperties.setUseCommas(false); //Ne pas afficher les bordures supérieur et droite du chart // Don't attach upper borders and the right of the chart axisProperties.getYAxisProperties().setShowEndBorder(false); axisProperties.getXAxisProperties().setShowEndBorder(false); Stroke[] strokes = {LineChartProperties.DEFAULT_LINE_STROKE}; //Shape[] shapes = {null}; Shape[] shapes= { PointChartProperties.SHAPE_TRIANGLE }; lineChartProperties = new LineChartProperties(strokes, shapes); clusteredBarChartProperties = new ClusteredBarChartProperties(); //Paramètrage de la largeur des barres de l'histogramme et non affichage des contours //Set the width of the bars and don't show the outline clusteredBarChartProperties.setWidthPercentage( 0.70f ); clusteredBarChartProperties.setShowOutlinesFlag( false ); } /********************************************************************************************** * **********************************************************************************************/ public void service( HttpServletRequest req, HttpServletResponse httpServletResponse ) throws ServletException, IOException { //---Some charts will need a second scale to render some values and then will //---need to render an axis at the right of the charts with it long secondScale=1; //---specific variable use to render negative value in all case double maxDataClustAbs = 0; double maxDataLineAbs = 0; int numberOfNegativ=0; int numberOfZero=0; try { String[] xAxisLabels = {"MAR", "APR", "MAY", "JUN", "JUL", "AUG", "SEP", "OCT", "NOV", "DEC", "JAN", "FEB"}; double[][] dataClust = new double[][]{ {3533, 101265, 76076, 86664, 135567, 87729, 85309, 143423, 18732, 111842, 39534, 11980} , {0, 103400, 65000, 88500, 143000, 80000, 88500, 143500, 99000, 118500, 38500, 18000} }; double[][] dataLine = new double[][]{ {21, 4, 1, 2, 3, 2, 3, 2, 93, 18, 54, 0} }; String title = "Chart Title"; String legendLabel1 = "Legend Label 1"; String legendLabel2 = "Legend Label 2"; String legendLabel3 = "Legend Label 3"; //IAxisDataSeries dataSeries = new DataSeries( xAxisLabels, null, null, title ); IAxisDataSeries dataSeries = new DataSeries( xAxisLabels, "X Axis title", "Left Y Axis title", title ); String[] legendLabelsClust = {legendLabel1, legendLabel2}; Paint[] clustPaints = new Paint[]{Color.pink, Color.blue}; String[] legendLabelsLine = {legendLabel3}; Paint[] linePaints = new Paint[]{Color.green}; //------------On récupère une 2ème échelle "secondScale"------------------ //------------et on fait un traitement pour les nombres négatifs---------- //------------We get back the 2nd scale "secondScale"--------------------- //-------------and we handle the negative numbers--------------------- //On identifie la valeur maximum absolue des data Clustered Bar //et on compte le nombre de zéro et le nombre de chiffres négatifs // We identify the absolute maximum value of the data in the Clustered Bar // and we count the number of zero and negative digits for (int k=0; k<2; k++) { for (int j=0; j<xAxisLabels.length; j++) { if (maxDataClustAbs < (Math.abs(dataClust[k][j])) && (dataClust[k][j]!=0) ) { maxDataClustAbs=(Math.abs(dataClust[k][j])); } if (dataClust[k][j]<0) { numberOfNegativ+=1; } if (dataClust[k][j]==0) { numberOfZero+=1; } } } //On identifie la valeur maximum absolue des data Line //et on compte le nombre de zéro et le nombre de chiffres négatifs // We identify the absolute maximum value of the data lines // and we count the number of zero and negative digits for (int j=0; j<xAxisLabels.length; j++) { if (maxDataLineAbs < (Math.abs(dataLine[0][j])) && (dataLine[0][j]!=0) ) { maxDataLineAbs=(Math.abs(dataLine[0][j])); } if (dataLine[0][j]<0) { numberOfNegativ+=1; } if (dataLine[0][j]==0) { numberOfZero+=1; } } //On définit la valeur de la seconde échelle si les ordres de grandeurs //sont très différent (de l'ordre de 10). //We define the value of the second scale if the increment is an order of //magnitude greater if (maxDataClustAbs>10*maxDataLineAbs) { axisProperties.getYAxisProperties().setShowRightAxis(true); secondScale=Math.round(maxDataClustAbs/(maxDataLineAbs)); axisProperties.getYAxisProperties().setSecondScaleRight((float) (secondScale) ); ChartFont axisScaleFontRight = new ChartFont( new Font("Arial Narrow", Font.PLAIN, 10), Color.green.darker() ); axisProperties.getYAxisProperties().setScaleChartFontRight( axisScaleFontRight ); } //On vérifie s'il y a des valeurs négatives // Check if there are negative numbers if (numberOfNegativ>0) { if ((maxDataLineAbs*secondScale)>maxDataClustAbs) { axisProperties.getYAxisProperties().setMinRightAxis((double) (-maxDataLineAbs*secondScale)); //Si les valeurs ne sont pas toutes négatives on affiche l'axe des ordonnées //de manière a ce que le zéro soit centré // If the numbers are not all negative we center the ordinal axis around zero if (numberOfNegativ!=(3*xAxisLabels.length-numberOfZero)) { axisProperties.getYAxisProperties().setMaxRightAxis((double) (maxDataLineAbs*secondScale)); } } else { axisProperties.getYAxisProperties().setMinRightAxis((double) (-maxDataClustAbs)); if (numberOfNegativ!=(3*xAxisLabels.length-numberOfZero)) { axisProperties.getYAxisProperties().setMaxRightAxis((double) (maxDataClustAbs)); } } } dataSeries.addIAxisPlotDataSet( new AxisChartDataSet( dataClust, legendLabelsClust, clustPaints, ChartType.BAR_CLUSTERED, clusteredBarChartProperties ) ); dataSeries.addIAxisPlotDataSet( new AxisChartDataSet( dataLine, legendLabelsLine, linePaints, ChartType.LINE, lineChartProperties ) ); AxisChart axisChart = new AxisChart( dataSeries, chartProperties, axisProperties, legendProperties, width, height ); ServletEncoderHelper.encodeJPEG13( axisChart, 1.0f, httpServletResponse ); } catch( Throwable throwable ) { //HACK do your error handling here... throwable.printStackTrace(); } } } |
From: <ki...@us...> - 2003-08-27 04:38:03
|
Update of /cvsroot/jcharts/krysalis-jcharts/src/java/org/krysalis/jcharts/properties In directory sc8-pr-cvs1:/tmp/cvs-serv23576/properties Modified Files: AxisTypeProperties.java Log Message: Integration of the Dual Y axis code that was submitted to Nathaniel by Romain SEGUY. These are new properties added to the AxisTypeProperties class ChartFont AxisTypeProperties.getScaleChartFontRight() void AxisTypeProperties.setScaleChartFontRight( ChartFont scaleChartFontRight ) void AxisTypeProperties.setShowRightAxis( boolean showRightAxis ) float AxisTypeProperties.getSecondScaleRight() void AxisTypeProperties.setSecondScaleRight(float secondScaleRight) double AxisTypeProperties.getMinRightAxis() void AxisTypeProperties.setMinRightAxis(double minRightAxis) double AxisTypeProperties.getMaxRightAxis() void AxisTypeProperties.setMaxRightAxis(double maxRightAxis) Added to Axis class TextTagGroup Axis.getAxisLabelsGroupRight() void Axis.setAxisLabelsGroupRight( TextTagGroup axisLabelsGroupRight ) There is a demonstration servlet in org\krysalis\jcharts\demo\simpleservlet called DualYAxis.java Index: AxisTypeProperties.java =================================================================== RCS file: /cvsroot/jcharts/krysalis-jcharts/src/java/org/krysalis/jcharts/properties/AxisTypeProperties.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** AxisTypeProperties.java 17 May 2003 17:00:33 -0000 1.1 --- AxisTypeProperties.java 27 Aug 2003 04:37:44 -0000 1.2 *************** *** 89,92 **** --- 89,100 ---- private boolean showAxisLabels= true; + // Dual Y axis changes integrated CMC 25Aug03 + //variable added for the right axis + //the method corresponding are so implemented + private ChartFont scaleChartFontRight = ChartFont.DEFAULT_AXIS_SCALE; + private boolean showRightAxis = false; + private float secondScaleRight=1; + private double minRightAxis = 0; + private double maxRightAxis = 0; private ChartFont titleChartFont= ChartFont.DEFAULT_AXIS_TITLE; *************** *** 245,248 **** --- 253,267 ---- } + // Dual Y axis changes integrated CMC 25Aug03 + public ChartFont getScaleChartFontRight() + { + return scaleChartFontRight; + } + + + public void setScaleChartFontRight( ChartFont scaleChartFontRight ) + { + this.scaleChartFontRight = scaleChartFontRight; + } public ChartFont getAxisTitleChartFont() *************** *** 270,274 **** ! public float getPaddingBetweenAxisLabels() { return this.paddingBetweenAxisLabels; --- 289,341 ---- ! // Dual Y axis changes integrated CMC 25Aug03 ! public boolean getShowRightAxis() ! { ! return this.showRightAxis; ! } ! ! ! public void setShowRightAxis( boolean showRightAxis ) ! { ! this.showRightAxis = showRightAxis; ! } ! ! ! public float getSecondScaleRight() ! { ! return this.secondScaleRight; ! } ! ! ! public void setSecondScaleRight(float secondScaleRight) ! { ! this.secondScaleRight=secondScaleRight; ! } ! ! public double getMinRightAxis() ! { ! return this.minRightAxis; ! } ! ! ! public void setMinRightAxis(double minRightAxis) ! { ! this.minRightAxis=minRightAxis; ! } ! ! ! public double getMaxRightAxis() ! { ! return this.maxRightAxis; ! } ! ! ! public void setMaxRightAxis(double maxRightAxis) ! { ! this.maxRightAxis=maxRightAxis; ! } ! ! ! public float getPaddingBetweenAxisLabels() { return this.paddingBetweenAxisLabels; |
From: <ki...@us...> - 2003-08-27 04:38:02
|
Update of /cvsroot/jcharts/krysalis-jcharts/src/java/org/krysalis/jcharts/axisChart In directory sc8-pr-cvs1:/tmp/cvs-serv23576/axisChart Modified Files: AxisChart.java LineChart.java Log Message: Integration of the Dual Y axis code that was submitted to Nathaniel by Romain SEGUY. These are new properties added to the AxisTypeProperties class ChartFont AxisTypeProperties.getScaleChartFontRight() void AxisTypeProperties.setScaleChartFontRight( ChartFont scaleChartFontRight ) void AxisTypeProperties.setShowRightAxis( boolean showRightAxis ) float AxisTypeProperties.getSecondScaleRight() void AxisTypeProperties.setSecondScaleRight(float secondScaleRight) double AxisTypeProperties.getMinRightAxis() void AxisTypeProperties.setMinRightAxis(double minRightAxis) double AxisTypeProperties.getMaxRightAxis() void AxisTypeProperties.setMaxRightAxis(double maxRightAxis) Added to Axis class TextTagGroup Axis.getAxisLabelsGroupRight() void Axis.setAxisLabelsGroupRight( TextTagGroup axisLabelsGroupRight ) There is a demonstration servlet in org\krysalis\jcharts\demo\simpleservlet called DualYAxis.java Index: AxisChart.java =================================================================== RCS file: /cvsroot/jcharts/krysalis-jcharts/src/java/org/krysalis/jcharts/axisChart/AxisChart.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** AxisChart.java 22 Jun 2003 14:14:24 -0000 1.3 --- AxisChart.java 27 Aug 2003 04:37:44 -0000 1.4 *************** *** 70,73 **** --- 70,78 ---- import java.awt.geom.Rectangle2D; + // Dual Y axis changes integrated CMC 25Aug03 + import java.lang.Math.*; + import java.lang.Float.*; + + /************************************************************************************* *************** *** 156,171 **** { 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() ); --- 161,212 ---- { s = new AutomaticScaleCalculator(); ! // Dual Y axis changes integrated CMC 25Aug03 ! // s.setMaxValue( axisChartDataProcessor.getMaxValue() ); ! // s.setMinValue( axisChartDataProcessor.getMinValue() ); ! if (this.axisProperties.getYAxisProperties().getMaxRightAxis()>0) ! { ! s.setMaxValue( this.axisProperties.getYAxisProperties().getMaxRightAxis() ); ! } ! else ! { ! s.setMaxValue( axisChartDataProcessor.getMaxValue() ); ! } ! if (this.axisProperties.getYAxisProperties().getMinRightAxis()<0) ! { ! s.setMinValue( this.axisProperties.getYAxisProperties().getMinRightAxis() ); ! } ! else ! { ! s.setMinValue( axisChartDataProcessor.getMinValue() ); ! } ! } ! axis.setScaleCalculator( s ); } else { axis.setScaleCalculator( dataAxisProperties.getScaleCalculator() ); ! // Dual Y axis changes integrated CMC 25Aug03 ! // axis.getScaleCalculator().setMaxValue( axisChartDataProcessor.getMaxValue() ); ! // axis.getScaleCalculator().setMinValue( axisChartDataProcessor.getMinValue() ); ! ! if (this.axisProperties.getYAxisProperties().getMaxRightAxis()>0) ! { ! axis.getScaleCalculator().setMaxValue( this.axisProperties.getYAxisProperties().getMaxRightAxis() ); ! } ! else ! { ! axis.getScaleCalculator().setMaxValue( axisChartDataProcessor.getMaxValue() ); ! } ! ! if (this.axisProperties.getYAxisProperties().getMinRightAxis()<0) ! { ! axis.getScaleCalculator().setMinValue( this.axisProperties.getYAxisProperties().getMinRightAxis() ); ! } ! else ! { ! axis.getScaleCalculator().setMinValue( axisChartDataProcessor.getMinValue() ); ! } ! } axis.getScaleCalculator().setRoundingPowerOfTen( dataAxisProperties.getRoundToNearest() ); *************** *** 264,267 **** --- 305,331 ---- NumericTagGroup numericTagGroup= setupDataAxisProperties( this.yAxis, dataAxisProperties, axisChartDataProcessor, fontRenderContext ); this.yAxis.setAxisLabelsGroup( numericTagGroup ); + // Dual Y axis changes integrated CMC 25Aug03 + // compute the labels of the right axis if necessary + if ( this.axisProperties.getYAxisProperties().getSecondScaleRight()!=1 ) + { + NumericTagGroup numericTagGroup2 = new NumericTagGroup( dataAxisProperties.getScaleChartFontRight(), + fontRenderContext, + dataAxisProperties.useDollarSigns(), + dataAxisProperties.usePercentSigns(), + dataAxisProperties.useCommas(), + dataAxisProperties.getRoundToNearest() ); + int j=0; + while (j<this.getYAxis().getNumberOfScaleItems()) + { + Float myFloat = new Float (this.yAxis.getAxisLabelsGroup().getTextTag(j).getText()); + float temp = myFloat.floatValue(); + Integer myInteger = new Integer ( Math.round(Math.round((float)(temp / this.axisProperties.getYAxisProperties().getSecondScaleRight()))/10)*10 ); + String myString = new String (""); + myString = myInteger.toString(); + numericTagGroup2.addLabel(myString); + j++; + } + this.yAxis.setAxisLabelsGroupRight(numericTagGroup2); + } } *************** *** 283,288 **** { //---SUBTRACT space for axis titles, labels, ticks... ! xAxisWidth -= this.yAxis.getMinimumWidthNeeded(); ! yAxisHeight -= this.xAxis.getMinimumHeightNeeded(); //---SET THE PIXEL LENGTH OF THE AXIS --- 347,358 ---- { //---SUBTRACT space for axis titles, labels, ticks... ! // Dual Y axis changes integrated CMC 25Aug03 ! // if there is a right axis to render we subtract twice the minimum width needed ! if (this.axisProperties.getYAxisProperties().getShowRightAxis()) ! xAxisWidth -= 2*this.yAxis.getMinimumWidthNeeded(); ! else ! xAxisWidth -= this.yAxis.getMinimumWidthNeeded(); ! ! yAxisHeight -= this.xAxis.getMinimumHeightNeeded(); //---SET THE PIXEL LENGTH OF THE AXIS Index: LineChart.java =================================================================== RCS file: /cvsroot/jcharts/krysalis-jcharts/src/java/org/krysalis/jcharts/axisChart/LineChart.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** LineChart.java 17 May 2003 16:56:57 -0000 1.1 --- LineChart.java 27 Aug 2003 04:37:44 -0000 1.2 *************** *** 85,91 **** 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 --- 85,99 ---- if( iAxisChartDataSet.getValue( i, j ) != Double.NaN ) { ! // Dual Y axis changes integrated CMC 25Aug03 ! //yAxisCoordinates[ i ][ j ]= axisChart.getYAxis().computeAxisCoordinate( axisChart.getYAxis().getOrigin(), ! // iAxisChartDataSet.getValue( i, j ), ! // axisChart.getYAxis().getScaleCalculator().getMinValue() ); ! ! // The coordinates of the line charts are drawn with the default scale and ! // multiplicate with the second scale for the right axis (by default equal 1) ! // if the second scale at the right is unchanged then there will be no impact ! yAxisCoordinates[ i ][ j ]= axisChart.getYAxis().computeAxisCoordinate( axisChart.getYAxis().getOrigin(), ! iAxisChartDataSet.getValue( i, j )*axisChart.axisProperties.getYAxisProperties().getSecondScaleRight(), ! axisChart.getYAxis().getScaleCalculator().getMinValue() ); //---if we are generating an ImageMap, store the image coordinates |
From: <ki...@us...> - 2003-08-27 04:38:02
|
Update of /cvsroot/jcharts/krysalis-jcharts/src/java/org/krysalis/jcharts In directory sc8-pr-cvs1:/tmp/cvs-serv23576 Modified Files: Legend.java Log Message: Integration of the Dual Y axis code that was submitted to Nathaniel by Romain SEGUY. These are new properties added to the AxisTypeProperties class ChartFont AxisTypeProperties.getScaleChartFontRight() void AxisTypeProperties.setScaleChartFontRight( ChartFont scaleChartFontRight ) void AxisTypeProperties.setShowRightAxis( boolean showRightAxis ) float AxisTypeProperties.getSecondScaleRight() void AxisTypeProperties.setSecondScaleRight(float secondScaleRight) double AxisTypeProperties.getMinRightAxis() void AxisTypeProperties.setMinRightAxis(double minRightAxis) double AxisTypeProperties.getMaxRightAxis() void AxisTypeProperties.setMaxRightAxis(double maxRightAxis) Added to Axis class TextTagGroup Axis.getAxisLabelsGroupRight() void Axis.setAxisLabelsGroupRight( TextTagGroup axisLabelsGroupRight ) There is a demonstration servlet in org\krysalis\jcharts\demo\simpleservlet called DualYAxis.java Index: Legend.java =================================================================== RCS file: /cvsroot/jcharts/krysalis-jcharts/src/java/org/krysalis/jcharts/Legend.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** Legend.java 24 Aug 2003 14:47:59 -0000 1.8 --- Legend.java 27 Aug 2003 04:37:44 -0000 1.9 *************** *** 335,341 **** { //---get the bounds of the shape ! Double shapeWidthDouble = new Double( ( ( (Shape) this.shapes.get( i ) ).getBounds2D().getWidth() ) ); ! float shapeWidth = shapeWidthDouble.floatValue(); ! this.iconSide = Math.max(this.iconSide, shapeWidth); } } --- 335,351 ---- { //---get the bounds of the shape ! try ! { ! Double shapeWidthDouble = new Double( ( ( (Shape) this.shapes.get( i ) ).getBounds2D().getWidth() ) ); ! float shapeWidth = shapeWidthDouble.floatValue(); ! this.iconSide = Math.max(this.iconSide, shapeWidth); ! } ! catch (NullPointerException npe) ! { ! // Looks like in 0.74 it was quite acceptable to make shape = null ! // we should probably catch all these and render a "null" shape to the legend ! System.err.println("Warning: legend shape is null"); ! npe.printStackTrace(); ! } } } *************** *** 493,496 **** --- 503,507 ---- // only Point and Line Charts will have shapes drawn + if( this.shapes.size() > 0 && this.shapes.size() > labelIndex ) { |
From: <ki...@us...> - 2003-08-27 04:38:02
|
Update of /cvsroot/jcharts/krysalis-jcharts/src/java/org/krysalis/jcharts/axisChart/axis In directory sc8-pr-cvs1:/tmp/cvs-serv23576/axisChart/axis Modified Files: Axis.java YAxis.java Log Message: Integration of the Dual Y axis code that was submitted to Nathaniel by Romain SEGUY. These are new properties added to the AxisTypeProperties class ChartFont AxisTypeProperties.getScaleChartFontRight() void AxisTypeProperties.setScaleChartFontRight( ChartFont scaleChartFontRight ) void AxisTypeProperties.setShowRightAxis( boolean showRightAxis ) float AxisTypeProperties.getSecondScaleRight() void AxisTypeProperties.setSecondScaleRight(float secondScaleRight) double AxisTypeProperties.getMinRightAxis() void AxisTypeProperties.setMinRightAxis(double minRightAxis) double AxisTypeProperties.getMaxRightAxis() void AxisTypeProperties.setMaxRightAxis(double maxRightAxis) Added to Axis class TextTagGroup Axis.getAxisLabelsGroupRight() void Axis.setAxisLabelsGroupRight( TextTagGroup axisLabelsGroupRight ) There is a demonstration servlet in org\krysalis\jcharts\demo\simpleservlet called DualYAxis.java Index: Axis.java =================================================================== RCS file: /cvsroot/jcharts/krysalis-jcharts/src/java/org/krysalis/jcharts/axisChart/axis/Axis.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Axis.java 22 Jun 2003 14:12:02 -0000 1.2 --- Axis.java 27 Aug 2003 04:37:44 -0000 1.3 *************** *** 80,83 **** --- 80,88 ---- private TextTagGroup axisLabelsGroup; + // Dual Y axis changes integrated CMC 25Aug03 + // Variable to use to display the labels of the right Y axis + // the corresponding methods are also implemented + private TextTagGroup axisLabelsGroupRight; + //---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; *************** *** 138,142 **** ! public final float getTitleWidth() { return this.titleWidth; --- 143,158 ---- ! // Dual Y axis changes integrated CMC 25Aug03 ! public TextTagGroup getAxisLabelsGroupRight() ! { ! return axisLabelsGroupRight; ! } ! ! public void setAxisLabelsGroupRight( TextTagGroup axisLabelsGroupRight ) ! { ! this.axisLabelsGroupRight = axisLabelsGroupRight; ! } ! ! public final float getTitleWidth() { return this.titleWidth; Index: YAxis.java =================================================================== RCS file: /cvsroot/jcharts/krysalis-jcharts/src/java/org/krysalis/jcharts/axisChart/axis/YAxis.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** YAxis.java 22 Jun 2003 14:12:02 -0000 1.3 --- YAxis.java 27 Aug 2003 04:37:44 -0000 1.4 *************** *** 97,102 **** if( axisTypeProperties.showAxisLabels() ) { ! widthNeeded+= super.getAxisLabelsGroup().getWidestLabel(); ! } --- 97,118 ---- if( axisTypeProperties.showAxisLabels() ) { ! // Dual Y axis changes integrated CMC 25Aug03 ! //widthNeeded+= super.getAxisLabelsGroup().getWidestLabel(); ! if ( axisTypeProperties.getShowRightAxis() ) ! { ! if ( super.getAxisLabelsGroupRight().getWidestLabel()>super.getAxisLabelsGroup().getWidestLabel()) ! { ! widthNeeded+= super.getAxisLabelsGroupRight().getWidestLabel(); ! } ! else ! { ! widthNeeded+= super.getAxisLabelsGroup().getWidestLabel(); ! } ! } ! else ! { ! widthNeeded+= super.getAxisLabelsGroup().getWidestLabel(); ! } ! } *************** *** 316,319 **** --- 332,385 ---- } } + + // Dual Y axis changes integrated CMC 25Aug03 + //---if AXIS at the right---------------------------------------------------------------------- + + if (axisTypeProperties.getShowRightAxis()) + { + + line2D.x1 = super.getAxisChart().getXAxis().getOrigin() + super.getAxisChart().getXAxis().getPixelLength(); + line2D.x2 = line2D.x1; + line2D.y1 = super.getOrigin() - super.getPixelLength() - 10 ; + line2D.y2 = super.getOrigin(); + axisTypeProperties.getAxisStroke().draw( graphics2D, line2D ); + + float tickRightX1 = super.getAxisChart().getXAxis().getOrigin() + super.getAxisChart().getXAxis().getPixelLength(); + float tickRightX2 = tickRightX1 + axisTypeProperties.getAxisTickMarkPixelLength(); + line2D.y1 = super.getOrigin(); + line2D.y2 = line2D.y1; + + stringY = super.getOrigin() + ( super.getAxisLabelsGroupRight().getTallestLabel() / 4 ); + stringX = super.getAxisChart().getXAxis().getOrigin() + axisTypeProperties.getAxisTickMarkPixelLength() + + super.getAxisChart().getXAxis().getPixelLength(); + + stringX+= axisTypeProperties.getPaddingBetweenLabelsAndTicks(); + + for( int i = 0; i < super.getNumberOfScaleItems(); i++ ) + { + //---TICK MARKS at the right + if( axisTypeProperties.getShowTicks() != AxisTypeProperties.TICKS_NONE ) + { + line2D.x1 = tickRightX1; + line2D.x2 = tickRightX2; + axisTypeProperties.getTickChartStroke().draw( graphics2D, line2D ); + } + + line2D.y1 -= super.getScalePixelWidth(); + line2D.y2 = line2D.y1; + + + //---AXIS LABEL at the right + if( axisTypeProperties.showAxisLabels() ) + { + + // Font and Paint set in TextTagGroup object in 1.0 it seems CMC 25Aug03 + //graphics2D.setFont( axisTypeProperties.getScaleChartFontRight().getFont()); + //graphics2D.setPaint( axisTypeProperties.getScaleChartFontRight().getPaint() ); + super.getAxisLabelsGroupRight().render( i, graphics2D, stringX , stringY ); + } + stringY -= super.getScalePixelWidth(); + } + } } |
From: <nat...@us...> - 2003-08-27 00:32:47
|
Update of /cvsroot/jcharts/krysalis-jcharts/src/documentation/content/xdocs In directory sc8-pr-cvs1:/tmp/cvs-serv3663 Modified Files: downloads.xml Log Message: added patches CVS ---------------------------------------------------------------------- Index: downloads.xml =================================================================== RCS file: /cvsroot/jcharts/krysalis-jcharts/src/documentation/content/xdocs/downloads.xml,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** downloads.xml 7 Aug 2003 21:57:51 -0000 1.4 --- downloads.xml 27 Aug 2003 00:32:44 -0000 1.5 *************** *** 3,7 **** <document> <header> ! <title>jCharts</title> <authors> <person name="Nathaniel Auvil" email="nat...@us..."/> --- 3,7 ---- <document> <header> ! <title>Krysalis - jCharts</title> <authors> <person name="Nathaniel Auvil" email="nat...@us..."/> *************** *** 28,31 **** --- 28,38 ---- <ul> <li><link href="http://prdownloads.sourceforge.net/jcharts/jcharts0.6.0_jasperReports0.4.5.zip?download">jcharts 0.6.0 and Jasper Reports 0.4.5</link></li> + </ul> + </section> + <section> + <title>User Code Submissions</title> + <p/> + <ul> + <li><link href="http://sourceforge.net/tracker/?group_id=16161&atid=316161">Patches</link></li> </ul> </section> |
From: <nat...@us...> - 2003-08-25 04:26:21
|
Update of /cvsroot/jcharts/krysalis-jcharts/src/java/org/krysalis/jcharts In directory sc8-pr-cvs1:/tmp/cvs-serv12424 Modified Files: Legend.java Log Message: includes a bug fix for combos Index: Legend.java =================================================================== RCS file: /cvsroot/jcharts/krysalis-jcharts/src/java/org/krysalis/jcharts/Legend.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** Legend.java 8 Aug 2003 08:51:27 -0000 1.7 --- Legend.java 24 Aug 2003 14:47:59 -0000 1.8 *************** *** 331,343 **** if( (chartType == ChartType.POINT) || (chartType == ChartType.LINE) ) { ! for( int i = 0; i < numberOfLabels; i++ ) { //---get the bounds of the shape Double shapeWidthDouble = new Double( ( ( (Shape) this.shapes.get( i ) ).getBounds2D().getWidth() ) ); float shapeWidth = shapeWidthDouble.floatValue(); ! this.iconSide = Math.max(this.iconSide, shapeWidth); } ! } ! this.determineWidthAndHeight( numberOfLabels ); } --- 331,344 ---- if( (chartType == ChartType.POINT) || (chartType == ChartType.LINE) ) { ! //for( int i = 0; i < numberOfLabels; i++ ) ! for( int i = 0; i < this.shapes.size(); i++ ) { //---get the bounds of the shape Double shapeWidthDouble = new Double( ( ( (Shape) this.shapes.get( i ) ).getBounds2D().getWidth() ) ); float shapeWidth = shapeWidthDouble.floatValue(); ! this.iconSide = Math.max(this.iconSide, shapeWidth); } ! } ! this.determineWidthAndHeight( numberOfLabels ); } *************** *** 416,426 **** //---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 lineStrokes for LINE charts if( chartType == ChartType.LINE) ! { width += this.legendProperties.getIconLineStrokeLength() * 2 * this.numColumns; } --- 417,427 ---- //---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 lineStrokes for LINE charts if( chartType == ChartType.LINE) ! { width += this.legendProperties.getIconLineStrokeLength() * 2 * this.numColumns; } *************** *** 440,445 **** public void render() { ! Graphics2D g2d = this.chart.getGraphics2D(); ! //---get the bounds of the image Rectangle2D.Float rectangle = new Rectangle2D.Float( this.x, this.y, width - 1, this.height - 1 ); --- 441,446 ---- public void render() { ! Graphics2D g2d = this.chart.getGraphics2D(); ! //---get the bounds of the image Rectangle2D.Float rectangle = new Rectangle2D.Float( this.x, this.y, width - 1, this.height - 1 ); *************** *** 485,489 **** //LOOP for( int i = 0; i < this.numColumns; i++ ) ! { rectangle.x = posX; --- 486,490 ---- //LOOP for( int i = 0; i < this.numColumns; i++ ) ! { rectangle.x = posX; *************** *** 492,499 **** // only Point and Line Charts will have shapes drawn ! if( this.shapes.size() > 0 ) { Shape shape = (Shape)this.shapes.get( labelIndex); ! //---get the original transform so can reset it AffineTransform affineTransform = g2d.getTransform(); --- 493,500 ---- // only Point and Line Charts will have shapes drawn ! if( this.shapes.size() > 0 && this.shapes.size() > labelIndex ) { Shape shape = (Shape)this.shapes.get( labelIndex); ! //---get the original transform so can reset it AffineTransform affineTransform = g2d.getTransform(); *************** *** 531,537 **** double XOffset = shapeBounds.getWidth() / 2; double YOffset = shapeBounds.getHeight() / 2; ! g2d.setStroke(this.lineChartProperties.getLineStrokes()[ labelIndex]); ! Line2D.Double line = new Line2D.Double(0, YOffset, this.legendProperties.getIconLineStrokeLength(), YOffset); g2d.draw( line ); --- 532,538 ---- double XOffset = shapeBounds.getWidth() / 2; double YOffset = shapeBounds.getHeight() / 2; ! g2d.setStroke(this.lineChartProperties.getLineStrokes()[ labelIndex]); ! Line2D.Double line = new Line2D.Double(0, YOffset, this.legendProperties.getIconLineStrokeLength(), YOffset); g2d.draw( line ); |
From: <nat...@us...> - 2003-08-16 20:47:55
|
Update of /cvsroot/jcharts/krysalis-jcharts/src/documentation/content/xdocs/userGuide In directory sc8-pr-cvs1:/tmp/cvs-serv24942 Modified Files: book.xml Log Message: added anti-aliasing section Index: book.xml =================================================================== RCS file: /cvsroot/jcharts/krysalis-jcharts/src/documentation/content/xdocs/userGuide/book.xml,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** book.xml 11 Jul 2003 02:41:36 -0000 1.5 --- book.xml 16 Aug 2003 20:47:52 -0000 1.6 *************** *** 27,30 **** --- 27,31 ---- <menu-item label="Image Border" href="chartBorder.html"/> <menu-item label="Edge Padding" href="edgePadding.html"/> + <menu-item label="Anti-Aliasing" href="antiAliasing.html"/> </menu> |