|
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)) {
|