title: AChartEngine 1.1.0 (Android)
body: <p>I used the AChartEngine 1.0.0 plugin to generate a linegraph like this:</p>
  
  <p><img src="https://i.stack.imgur.com/br8kR.png" alt="enter image description here"></p>
  
  <p>The problem with this is that the y-valyes need to be aligned to the left...
  When i looked on the internet i found a solution: using the 1.1.0 plugin instead to have
  the method: setYLabelsPadding(10) for the rendering, now i can set the padding correctly but for some reason this happens;</p>
  
  <p><img src="https://i.stack.imgur.com/IQMHe.png" alt="enter image description here"></p>
  
  <pre><code>package com.example.driveinstructor.tabactivity.fragments;
  
  import java.util.Random;
  
  import com.example.driveinstructor.R;
  import org.achartengine.ChartFactory;
  import org.achartengine.GraphicalView;
  import org.achartengine.chart.PointStyle;
  import org.achartengine.model.XYMultipleSeriesDataset;
  import org.achartengine.model.XYSeries;
  import org.achartengine.renderer.XYMultipleSeriesRenderer;
  import org.achartengine.renderer.XYSeriesRenderer;
  
  import android.app.Fragment;
  import android.graphics.Color;
  import android.graphics.Paint.Align;
  import android.os.AsyncTask;
  import android.os.Bundle;
  import android.view.LayoutInflater;
  import android.view.Menu;
  import android.view.View;
  import android.view.ViewGroup;
  import android.widget.LinearLayout;
  
  public class GraphFragment extends Fragment
  {
  private GraphicalView mChart;
  
  private XYSeries visitsSeries ;
  private XYMultipleSeriesDataset dataset;
  
  private XYSeriesRenderer visitsRenderer;
  private XYMultipleSeriesRenderer multiRenderer;
  
  private String[]graphValues = new String[11];//11 want op 0 moet ook een punt staan
  private View v;
  
  @Override
  public View onCreateView(LayoutInflater inflater, ViewGroup container,
          Bundle savedInstanceState)
  {
       super.onCreate(savedInstanceState);
  
       v= inflater.inflate(R.layout.fragment_graph,container,false);
  
          // Setting up chart
          setupChart();
  
          // Start plotting chart
          new ChartTask().execute();
  
      return v;
  }
  
   private void setupChart(){
  
          // Creating an  XYSeries for Visits
          visitsSeries = new XYSeries("Unique Visitors");
  
  
          // Creating a dataset to hold each series
          dataset = new XYMultipleSeriesDataset();
          // Adding Visits Series to the dataset
          dataset.addSeries(visitsSeries);        
  
  
          // Creating XYSeriesRenderer to customize visitsSeries
          visitsRenderer = new XYSeriesRenderer();
          visitsRenderer.setColor(Color.WHITE);
          visitsRenderer.setPointStyle(PointStyle.CIRCLE);
          visitsRenderer.setFillPoints(true);
          visitsRenderer.setLineWidth(2);
          //visitsRenderer.setDisplayChartValues(true);
          visitsRenderer.setColor(Color.parseColor("#FF8800"));//kleur vd lijn
  
  
          // Creating a XYMultipleSeriesRenderer to customize the whole chart
          multiRenderer = new XYMultipleSeriesRenderer();
  
      //  multiRenderer.setChartTitle("Visits Chart");
      //  multiRenderer.setXTitle("Seconds");
      //  multiRenderer.setYTitle("Count");
          multiRenderer.setZoomButtonsVisible(false);
  
          multiRenderer.setXAxisMin(0);
          multiRenderer.setXAxisMax(10);
  
          multiRenderer.setYAxisMin(0);
          multiRenderer.setYAxisMax(3000);
          multiRenderer.setYLabels(7);
          multiRenderer.setXLabels(10);
          multiRenderer.setBarSpacing(2);
  
          multiRenderer.setShowLegend(false);
          multiRenderer.addSeriesRenderer(visitsRenderer);
          multiRenderer.setMargins(new int[] {20,58, 0, 40});  // top, left, bottom, right.
          multiRenderer.setMarginsColor(Color.argb(0x00, 0xff, 0x00, 0x00));
  
          // Getting a reference to LinearLayout of the MainActivity Layout
          LinearLayout chartContainer = (LinearLayout) v.findViewById(R.id.graph1);
  
  
          multiRenderer.setYLabelsPadding(10);
          multiRenderer.setShowGridX(true);
          multiRenderer.setShowGridY(true);
  
          mChart = (GraphicalView) ChartFactory.getLineChartView(getActivity(), dataset, multiRenderer);
  
  
          // Adding the Line Chart to the LinearLayout
          chartContainer.addView(mChart);
  
      }
  
  
      private class ChartTask extends AsyncTask&lt;Void, String, Void&gt;{
  
          // Generates dummy data in a non-ui thread
  
  
          @Override
          protected Void doInBackground(Void... params)
          {
              int i = 0;
              try{
  
                  do{
                      String [] values = new String[2];
                      Random r = new Random();
                      int visits = r.nextInt(3000);
                      System.out.println("index i= " + String.valueOf(i));
                      System.out.println(String.valueOf(visits));
  
                      graphValues[0] = Integer.toString(visits); //bijhorende waarde y-as
  
  
  
                      publishProgress(graphValues);                   
                      Thread.sleep(1000);
                      i++;
  
                      if (i&gt;10)
                      {
                          i=10;
                      }
  
                      for(int j=i; j&gt;0; j--)
                      {
                      //System.out.println("j" +j);
                      graphValues[j]=graphValues[j-1];
  
                      }
  
  
  
  
                  }while(i&lt;=20);
              }catch(Exception e){ }
              return null;
          }
  
          // Plotting generated data in the graph
          @Override
          protected void onProgressUpdate(String... values)
          {
  
              int a = 0;
              for(String s: values)
              {
                  if(s!=null)
                  {
          //  System.out.println("test " + s);
              visitsSeries.add(a, Integer.parseInt(values[a]));       
              a++;
                  }
                  else
                  {
                      break;
                  }
              }
              mChart.repaint();
  
              //visitsSeries.add(Integer.parseInt(values[0]), Integer.parseInt(values[1]));
              //mChart.repaint();
          }
  
      }    
  
  
  }
  </code></pre>