Index: /ether_megapoli/trunk/service/implementation/com/ether/BouchonHelper.java
===================================================================
--- /ether_megapoli/trunk/service/implementation/com/ether/BouchonHelper.java	(revision 186)
+++ /ether_megapoli/trunk/service/implementation/com/ether/BouchonHelper.java	(revision 187)
@@ -259,5 +259,5 @@
         for( int i = 0; i < size; i++ )
         {
-            values[i] = (double) i * Math.random();
+            values[i] = (double) i * Math.random() * delta;
             cal.set( Calendar.MINUTE, (int) ( 2 + i + ( Math.random() * 8 ) ) );
             dates[i] = cal.getTime();
Index: /ether_megapoli/trunk/service/implementation/com/ether/EtherPlotContentServiceImpl.java
===================================================================
--- /ether_megapoli/trunk/service/implementation/com/ether/EtherPlotContentServiceImpl.java	(revision 186)
+++ /ether_megapoli/trunk/service/implementation/com/ether/EtherPlotContentServiceImpl.java	(revision 187)
@@ -85,22 +85,28 @@
         final List<Pair> pIdPIdListForSecondAxis = listPairOfPIdPIdForTwoAxes.getSecondValue();
 
-
-        /** *********** FIRST Y-AXIS ************ **/
-        final List<SimpleLine> lines = createLines( pIdPIdListForFirstAxis, megapoliPlot.getBeginDate(), megapoliPlot.getEndDate() );
+        final List<SimpleLine> lines = createLines( pIdPIdListForFirstAxis, megapoliPlot.getBeginDate(), megapoliPlot.getEndDate(), 1 );
+        final List<SimpleLine> linesForSecondAxis = createLines( pIdPIdListForSecondAxis, megapoliPlot.getBeginDate(), megapoliPlot.getEndDate(), 10 );
         final SimpleLine firstLine = lines.get( 0 );
 
+        /** *********** RANGES ************ **/
         final SoTRange xnRange = firstLine.getXRange();
         final SoTRange yRange = firstLine.getYRange();
         for( final SimpleLine line : lines )
+        {
             yRange.add( line.getYRange() );
+            xnRange.add( line.getXRange() );
+        }
+
+        for( final SimpleLine line : linesForSecondAxis )
+            xnRange.add( line.getXRange() );
 
         // TODO : automatiser le nb d'intervalles en fonction des valeurs de y
-        final Integer intervalsNumber = 10;
-        final SoTRange ynRange = Graph.computeRange( yRange, intervalsNumber );
+        final SoTRange ynRange = Graph.computeRange( yRange, _intervalsNumber );
 
         // Origin point
         final SoTPoint originPoint = new SoTPoint( ynRange.getStart(), xnRange.getStart() );
 
-        // Create the time axis, set its range in user units and its origin.
+
+        /** ************ X-AXIS ********** **/
         // Time axis is the same for the two y-axis
         final TimeAxis xbot = new TimeAxis( "X-Axis", TimeAxis.AUTO );
@@ -108,16 +114,9 @@
         xbot.setLocationU( originPoint );
         xbot.setLabelFont( _axisFont );
-//        xbot.setMinorLabelInterval( 1 );
+        xbot.setLabelHeightP( _heightAxisFont );
+        xbot.setMajorLabelFormat( "yyyy-MM-dd HH:mm:ss" );
 
         // Create the vertical axis, set its range in user units and its origin. Create the axis title.
-        final PlainAxis yleft = new PlainAxis( "Y-Axis" );
-        yleft.setRangeU( ynRange );
-        yleft.setLocationU( originPoint );
-        yleft.setLabelFont( _axisFont );
-        final String yLabel = firstLine.getYMetaData().getName() + " (" + firstLine.getYMetaData().getUnits() + ")";
-        final SGLabel ytitle = new SGLabel( "Y-Axis Title", yLabel, new Point2D.Double( 0.0, 0.0 ) );
-        ytitle.setFont( _axisFont );
-        ytitle.setHeightP( _heightAxisFont );
-        yleft.setTitle( ytitle );
+        final PlainAxis yleft = createYAxis( firstLine, ynRange, originPoint, null );
 
         /** ************ GRAPH ********** **/
@@ -133,9 +132,8 @@
 
         SimpleLine firstLineForSecondAxis = null;
-        List<SimpleLine> linesForSecondAxis = new ArrayList<SimpleLine>();
+
         LinearTransform ytForSecondAxis = null;
         if( !pIdPIdListForSecondAxis.isEmpty() )
         {
-            linesForSecondAxis = createLines( pIdPIdListForSecondAxis, megapoliPlot.getBeginDate(), megapoliPlot.getEndDate() );
             firstLineForSecondAxis = linesForSecondAxis.get( 0 );
 
@@ -144,20 +142,12 @@
                 yRangeForSecondAxis.add( line.getYRange() );
 
-            final SoTRange ynRangeForSecondAxis = Graph.computeRange( yRangeForSecondAxis, intervalsNumber );
+            final SoTRange ynRangeForSecondAxis = Graph.computeRange( yRangeForSecondAxis, _intervalsNumber );
             final SoTPoint endPointForSecondAxis = new SoTPoint( ynRangeForSecondAxis.getStart(), xnRange.getEnd() );
 
-            final PlainAxis yleftForSecondAxis = new PlainAxis( "YY-Axis" );
-            yleftForSecondAxis.setRangeU( yRangeForSecondAxis );
-            yleftForSecondAxis.setLocationU( endPointForSecondAxis );
-            yleftForSecondAxis.setLabelFont( _axisFont );
-            yleftForSecondAxis.setLabelPosition( Axis.POSITIVE_SIDE );
-            final String yLabelForSecondAxis = firstLineForSecondAxis.getYMetaData().getName() + " (" + firstLineForSecondAxis.getYMetaData().getUnits() + ")";
-            final SGLabel ytitleForSecondAxis = new SGLabel( "Y-Axis Title", yLabelForSecondAxis, new Point2D.Double( 0.0, 0.0 ) );
-            ytitleForSecondAxis.setFont( _axisFont );
-            ytitleForSecondAxis.setHeightP( _heightAxisFont );
-            yleftForSecondAxis.setTitle( ytitleForSecondAxis );
+            final PlainAxis yleftForSecondAxis = createYAxis( firstLineForSecondAxis, ynRangeForSecondAxis, endPointForSecondAxis, Axis.POSITIVE_SIDE );
 
             ytForSecondAxis = new LinearTransform( new Range2D( ystart, yend ), ynRangeForSecondAxis );
-            graph.setYTransform( ytForSecondAxis );
+            if( ytForSecondAxis.getRangeU().end > yt.getRangeU().end )
+                graph.setYTransform( ytForSecondAxis );
             graph.addYAxis( yleftForSecondAxis );
         }
@@ -167,10 +157,4 @@
         final LineAttribute lineAttribute = createRandomLineAttrbute( megapoliPlot.getAxeType() );
         graph.setData( firstLine, lineAttribute );
-
-//        if( !pIdPIdListForSecondAxis.isEmpty() )
-//        {
-//            final LineAttribute attrForSecondAxis = createRandomLineAttrbute( megapoliPlot.getAxeType() );
-//            graph.setData( firstLineForSecondAxis, attrForSecondAxis );
-//        }
 
         /** *********** LEGEND ********* **/
@@ -185,69 +169,59 @@
         }
 
-        /** ********************************** **/
         /** *********** OTHER LAYERS ********* **/
-        /** ********************************** **/
-        for( final SimpleLine line : lines.subList( 1, lines.size() ) )
+        addOtherLinesForOneAxis( megapoliPlot.getAxeType(), mainPane, xsize, ysize, lines, xt, yt, lkey, 1 );
+
+        if( !pIdPIdListForSecondAxis.isEmpty() )
+            addOtherLinesForOneAxis( megapoliPlot.getAxeType(), mainPane, xsize, ysize, linesForSecondAxis, xt, ytForSecondAxis, lkey, 0 );
+
+        return mainPane;
+    }
+
+    /**
+     * This method adds layers corresponding to the other lines to display
+     *
+     * @param axeType
+     * @param mainPane
+     * @param xsize
+     * @param ysize
+     * @param lines
+     * @param xt
+     * @param yt
+     * @param lkey
+     * @param indexLineToBegin
+     */
+    private void addOtherLinesForOneAxis( @NotNull final String axeType, @NotNull final JPane mainPane, final double xsize, final double ysize, @NotNull final List<SimpleLine> lines, @NotNull final LinearTransform xt, @NotNull final LinearTransform yt, @NotNull final LineKey lkey, @NotNull final Integer indexLineToBegin )
+    {
+        for( final SimpleLine line : lines.subList( indexLineToBegin, lines.size() ) )
         {
             final Layer otherLayer = new Layer( "Other Layer", new Dimension2D( xsize, ysize ) );
             mainPane.add( otherLayer );
-            final CartesianGraph otherGraph = new CartesianGraph( "Second Graph", xt, yt );
+            final CartesianGraph otherGraph = new CartesianGraph( "Other Graph", xt, yt );
             otherLayer.setGraph( otherGraph );
 
-            final LineAttribute otherLineAttribute = createRandomLineAttrbute( megapoliPlot.getAxeType() );
+            final LineAttribute otherLineAttribute = createRandomLineAttrbute( axeType );
             otherGraph.setData( line, otherLineAttribute );
             lkey.addLineGraph( (LineCartesianRenderer) otherGraph.getRenderer(), line.getKeyTitle() );
         }
-
-        /** *********** SECOND Y-AXIS (optional) ************ **/
-        if( !pIdPIdListForSecondAxis.isEmpty() )
-        {
-//            final Layer layerForSecondAxis = new Layer( "First Layer", new Dimension2D( xsize, ysize ) );
-//            mainPane.add( layerForSecondAxis );
-//
-//            final List<SimpleLine> linesForSecondAxis = createLines( pIdPIdListForSecondAxis, megapoliPlot.getBeginDate(), megapoliPlot.getEndDate() );
-//            final SimpleLine firstLineForSecondAxis = linesForSecondAxis.get( 0 );
-
-//            final SoTRange yRangeForSecondAxis = firstLineForSecondAxis.getYRange();
-//            for( final SimpleLine line : linesForSecondAxis )
-//                yRangeForSecondAxis.add( line.getYRange() );
-//
-//            final SoTRange ynRangeForSecondAxis = Graph.computeRange( yRangeForSecondAxis, intervalsNumber );
-//            final SoTPoint endPointForSecondAxis = new SoTPoint( ynRangeForSecondAxis.getStart(), xnRange.getEnd() );
-//
-//            final PlainAxis yleftForSecondAxis = new PlainAxis( "YY-Axis" );
-//            yleftForSecondAxis.setRangeU( yRangeForSecondAxis );
-//            yleftForSecondAxis.setLocationU( endPointForSecondAxis );
-//            yleftForSecondAxis.setLabelFont( _axisFont );
-//            yleftForSecondAxis.setLabelPosition( Axis.POSITIVE_SIDE );
-//            final String yLabelForSecondAxis = firstLineForSecondAxis.getYMetaData().getName() + " (" + firstLineForSecondAxis.getYMetaData().getUnits() + ")";
-//            final SGLabel ytitleForSecondAxis = new SGLabel( "Y-Axis Title", yLabelForSecondAxis, new Point2D.Double( 0.0, 0.0 ) );
-//            ytitleForSecondAxis.setFont( _axisFont );
-//            ytitleForSecondAxis.setHeightP( _heightAxisFont );
-//            yleftForSecondAxis.setTitle( ytitleForSecondAxis );
-
-            /** ************ GRAPH ********** **/
-//            final CartesianGraph graphForSecondAxis = new CartesianGraph( "First Graph" );
-//            final LinearTransform ytForSecondAxis = new LinearTransform( new Range2D( ystart, yend ), ynRangeForSecondAxis );
-//            graphForSecondAxis.setYTransform( ytForSecondAxis );
-//            graphForSecondAxis.addYAxis( yleftForSecondAxis );
-//            layerForSecondAxis.setGraph( graphForSecondAxis );
-
-
-            for( final SimpleLine line : linesForSecondAxis.subList( 0, linesForSecondAxis.size() ) )
-            {
-                final Layer otherLayerForSecondAxis = new Layer( "Other Layer 2", new Dimension2D( xsize, ysize ) );
-                mainPane.add( otherLayerForSecondAxis );
-                final CartesianGraph otherGraphForSecondAxis = new CartesianGraph( "Second Graph 2", xt, ytForSecondAxis );
-                otherLayerForSecondAxis.setGraph( otherGraphForSecondAxis );
-
-                final LineAttribute otherLineAttribute = createRandomLineAttrbute( megapoliPlot.getAxeType() );
-                otherGraphForSecondAxis.setData( line, otherLineAttribute );
-                lkey.addLineGraph( (LineCartesianRenderer) otherGraphForSecondAxis.getRenderer(), line.getKeyTitle() );
-            }
-        }
-
-        return mainPane;
-    }
+    }
+
+    @NotNull
+    private PlainAxis createYAxis( final SimpleLine line, final SoTRange ynRange, final SoTPoint originPoint, @Nullable final Integer labelPosition )
+    {
+        final PlainAxis yleft = new PlainAxis( "Y-Axis" );
+        yleft.setRangeU( ynRange );
+        yleft.setLocationU( originPoint );
+        yleft.setLabelFont( _axisFont );
+        if( null != labelPosition )
+            yleft.setLabelPosition( labelPosition );
+
+        final String yLabel = line.getYMetaData().getName() + " (" + line.getYMetaData().getUnits() + ")";
+        final SGLabel ytitle = new SGLabel( "Y-Axis Title", yLabel, new Point2D.Double( 0.0, 0.0 ) );
+        ytitle.setFont( _axisFont );
+        ytitle.setHeightP( _heightAxisFont );
+        yleft.setTitle( ytitle );
+        return yleft;
+    }
+
 
     /**
@@ -311,5 +285,5 @@
      */
     @NotNull
-    private List<SimpleLine> createLines( @NotNull final List<Pair> pIdPIdList, @Nullable final Date beginDate, @Nullable final Date endDate )
+    private List<SimpleLine> createLines( @NotNull final List<Pair> pIdPIdList, @Nullable final Date beginDate, @Nullable final Date endDate, final Integer delta )
             throws ServiceException
     {
@@ -333,5 +307,5 @@
 
 //            final Data valuesLists = _etherService.getListsByPlateformByParameterByPeriodForTimeSerie( plateformId, parameterId, beginDate, endDate );
-            final Data valuesLists = BouchonHelper.createValuesForTimeSerie( 50, 5 );
+            final Data valuesLists = BouchonHelper.createValuesForTimeSerie( 50, delta );
 
             final double[] dataArray = (double[]) valuesLists.getFirstArray();
@@ -889,7 +863,9 @@
     protected static final int ERROR_FONT_SIZE = 10;
 
-    protected static final Font _axisFont = new Font( "Helvetica", Font.PLAIN, 12 );
-    protected static final double _heightAxisFont = 0.2;
+    protected static final Font _axisFont = new Font( "Helvetica", Font.PLAIN, 6 );
+    protected static final double _heightAxisFont = 0.14;
     protected static final double _markHeight = 0.1;
+    // Number of intervals on a Y-Axis
+    protected Integer _intervalsNumber = 10;
 
     private EtherService _etherService;
