title: Achartengine - How to use the same scale for two series?
body: <p>I am trying to do a a graph with 3 series, based on MultipleTemperatureChart.
  - The 3 series have the same x values.
  - The 3 Y-axis have different values, but I am using only 2 Y-axis, and painting one with black color, to it does not show up. </p>
  
  <p>I would like use the same scale for TWO, if I use "addXYSeries(dataset, new String[] { "Temperatura" }, x, y, Z);" * Z= scale , with the right scale, this is "3th" serie, so I use 3 as scale. everything is fine, but the scale is different.
  BUT If I use 0 as a scale, so that my 3th serie has the same scale as 1st one has, O got some problem:
  The graph show up OK, just like I want, but when I try to move the graph with the mouse in the AVD it stop !!!</p>
  
  <p>Some one could help me ? 
  Thanks.</p>
  
  <p>Cláudio</p>
  
  <pre><code>public Intent getIntent(Context context) {
      String[] titles = new String[] { "Corrente" };
      List&lt;double[]&gt; x = new ArrayList&lt;double[]&gt;();
      List&lt;double[]&gt; y = new ArrayList&lt;double[]&gt;();
  
  
      x.add(new double[] { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12 });
      y.add(new double[] { 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24 });
  
      int[] colors = new int[] { Color.BLUE, Color.RED, Color.GREEN };
      PointStyle[] styles = new PointStyle[] { PointStyle.POINT, PointStyle.POINT, PointStyle.POINT };
  
      XYMultipleSeriesRenderer renderer = new XYMultipleSeriesRenderer(3);
      renderer.setAxisTitleTextSize(16);
      renderer.setChartTitleTextSize(20);
      renderer.setLabelsTextSize(15);
      renderer.setLegendTextSize(15);
      renderer.setPointSize(5f);
      renderer.setMargins(new int[] { 20, 30, 15, 20 });
      int length = colors.length;  //length é o total de series
      for (int i = 0; i &lt; length; i++) {
         XYSeriesRenderer r = new XYSeriesRenderer();
         r.setColor(colors[i]);
         r.setPointStyle(styles[i]);
         renderer.addSeriesRenderer(r);
      }
      for (int i = 0; i &lt; length; i++) {
        XYSeriesRenderer r = (XYSeriesRenderer) renderer.getSeriesRendererAt(i);
        r.setLineWidth(2f);
      }
      //titulo do gráfico
      renderer.setChartTitle("Curva 1");
      renderer.setXTitle("Tempo/hrs");
      renderer.setYTitle("Amperes/Graus °C" );
      renderer.setAxesColor(Color.LTGRAY);
      renderer.setLabelsColor(Color.LTGRAY); 
      renderer.setXLabelsColor(Color.LTGRAY);
      renderer.setYLabelsColor(0, colors[0]);
      renderer.setYLabelsColor(1, colors[1]);
     // renderer.setYLabelsColor(2, Color.BLACK);
      renderer.setYTitle("volts", 1);
      renderer.setYAxisAlign(Align.RIGHT, 1);
      renderer.setYLabelsAlign(Align.LEFT, 1);
      //quantia de valores "ticks"
      //renderer.setXLabels(24);                  
      //renderer.setYLabels(10);      
      renderer.setXAxisMin(0);
      renderer.setXAxisMax(12);
      renderer.setYAxisMin(0);
      renderer.setYAxisMax(32);
      renderer.setXLabelsAlign(Align.RIGHT);
      renderer.setYLabelsAlign(Align.RIGHT);
      renderer.setZoomButtonsVisible(true);
      renderer.setPanLimits(new double[] { 0, 200, 0, 200 });
      renderer.setZoomLimits(new double[] { 0, 200, 0, 200 });
      renderer.setZoomRate(1.05f);
      renderer.setShowGrid(true);
  
      XYMultipleSeriesDataset dataset = buildDataset(titles, x, y);
  
      //---- gráfico de tensão
      y.clear();
      y.add(new double[] { 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1 });
      addXYSeries(dataset, new String[] { "Tensão" }, x, y, 1);
      // ----- gráfico de temperatura
      y.clear();
      y.add(new double[] { 0, 11, 10, 10, 11, 10, 10, 10, 9, 10, 10, 10 });
      addXYSeries(dataset, new String[] { "Temperatura" }, x, y, 0);
  
      for (int i = 0; i &lt; length; i++) {
          XYSeriesRenderer seriesRenderer = (XYSeriesRenderer) renderer.getSeriesRendererAt(i);
          // ---- seleciona qual gráfico preencher
          if (i == length - 1) {
            FillOutsideLine fill = new FillOutsideLine(FillOutsideLine.Type.NONE); //NONE mostra valores sobre o gráfico
            fill.setColor(Color.GREEN);
            seriesRenderer.addFillOutsideLine(fill);
          }
          seriesRenderer.setLineWidth(2.5f);
          seriesRenderer.setDisplayChartValues(true);
          seriesRenderer.setChartValuesTextSize(10f);
        }
  
      Intent intent = ChartFactory.getCubicLineChartIntent(context, dataset, renderer, 0.3f,
          "Average temperature");
      return intent;
  
  }
  
  public Intent execute(Context context) {
      // TODO Auto-generated method stub
      return null;
  }
  </code></pre>
  
  <p>}</p>
  
  <p>Here the Log Error:</p>
  
  <p>11-01 18:31:20.154: D/dalvikvm(9567): GC_EXTERNAL_ALLOC freed 731 objects / 52992 bytes in 92ms
  11-01 18:31:25.794: D/dalvikvm(9567): GC_FOR_MALLOC freed 6115 objects / 363864 bytes in 59ms
  11-01 18:31:26.154: D/dalvikvm(9567): GC_FOR_MALLOC freed 8229 objects / 498936 bytes in 57ms
  11-01 18:31:26.264: D/dalvikvm(9567): GetFieldID: unable to find field Ljava/util/HashMap;.loadFactor:F
  11-01 18:31:26.264: D/dalvikvm(9567): GetFieldID: unable to find field Ljava/util/HashMap;.loadFactor:F
  11-01 18:31:26.384: D/dalvikvm(9567): GetFieldID: unable to find field Ljava/util/HashMap;.loadFactor:F
  11-01 18:31:26.404: D/dalvikvm(9567): GetFieldID: unable to find field Ljava/util/HashMap;.loadFactor:F
  11-01 18:31:26.416: D/dalvikvm(9567): GetFieldID: unable to find field Ljava/util/HashMap;.loadFactor:F
  11-01 18:31:26.416: D/dalvikvm(9567): GetFieldID: unable to find field Ljava/util/HashMap;.loadFactor:F
  11-01 18:31:26.416: D/dalvikvm(9567): GetFieldID: unable to find field Ljava/util/HashMap;.loadFactor:F
  11-01 18:31:26.424: D/dalvikvm(9567): GetFieldID: unable to find field Ljava/util/HashMap;.loadFactor:F
  11-01 18:31:26.436: D/dalvikvm(9567): GetFieldID: unable to find field Ljava/util/HashMap;.loadFactor:F
  11-01 18:31:26.436: D/dalvikvm(9567): GetFieldID: unable to find field Ljava/util/HashMap;.loadFactor:F
  11-01 18:31:26.614: D/dalvikvm(9567): GC_FOR_MALLOC freed 6683 objects / 465000 bytes in 60ms</p>
  
  <p>HERE the problem comes up.</p>
  
  <p>11-01 18:31:30.658: D/AndroidRuntime(9567): Shutting down VM
  11-01 18:31:30.658: W/dalvikvm(9567): threadid=1: thread exiting with uncaught exception (group=0x4001d800)
  11-01 18:31:30.678: E/AndroidRuntime(9567): FATAL EXCEPTION: main
  11-01 18:31:30.678: E/AndroidRuntime(9567): java.lang.NullPointerException
  11-01 18:31:30.678: E/AndroidRuntime(9567):     at org.achartengine.chart.XYChart.toRealPoint(XYChart.java:877)
  11-01 18:31:30.678: E/AndroidRuntime(9567):     at org.achartengine.tools.Pan.apply(Pan.java:74)
  11-01 18:31:30.678: E/AndroidRuntime(9567):     at org.achartengine.TouchHandler.handleTouch(TouchHandler.java:119)
  11-01 18:31:30.678: E/AndroidRuntime(9567):     at org.achartengine.GraphicalView.onTouchEvent(GraphicalView.java:300)
  11-01 18:31:30.678: E/AndroidRuntime(9567):     at android.view.View.dispatchTouchEvent(View.java:3766)
  11-01 18:31:30.678: E/AndroidRuntime(9567):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:936)
  11-01 18:31:30.678: E/AndroidRuntime(9567):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:936)
  11-01 18:31:30.678: E/AndroidRuntime(9567):     at com.android.internal.policy.impl.PhoneWindow$DecorView.superDispatchTouchEvent(PhoneWindow.java:1671)
  11-01 18:31:30.678: E/AndroidRuntime(9567):     at com.android.internal.policy.impl.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1107)
  11-01 18:31:30.678: E/AndroidRuntime(9567):     at android.app.Activity.dispatchTouchEvent(Activity.java:2086)
  11-01 18:31:30.678: E/AndroidRuntime(9567):     at com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchTouchEvent(PhoneWindow.java:1655)
  11-01 18:31:30.678: E/AndroidRuntime(9567):     at android.view.ViewRoot.handleMessage(ViewRoot.java:1785)
  11-01 18:31:30.678: E/AndroidRuntime(9567):     at android.os.Handler.dispatchMessage(Handler.java:99)
  11-01 18:31:30.678: E/AndroidRuntime(9567):     at android.os.Looper.loop(Looper.java:123)
  11-01 18:31:30.678: E/AndroidRuntime(9567):     at android.app.ActivityThread.main(ActivityThread.java:4627)
  11-01 18:31:30.678: E/AndroidRuntime(9567):     at java.lang.reflect.Method.invokeNative(Native Method)
  11-01 18:31:30.678: E/AndroidRuntime(9567):     at java.lang.reflect.Method.invoke(Method.java:521)
  11-01 18:31:30.678: E/AndroidRuntime(9567):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
  11-01 18:31:30.678: E/AndroidRuntime(9567):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
  11-01 18:31:30.678: E/AndroidRuntime(9567):     at dalvik.system.NativeStart.main(Native Method)</p>