How to show the latest data in achartengine of Android?
<p>I use achartengine to draw some statistics bar graph on my Android application. There will be for example 7 bars within one screen. But the total bars should be quite more. And I want to know how to show the latest 7 bars instead of showing the first 7 bars by default. Could anyone help? Thanks!</p>

<p>Complement:
e.g. I have 100 data/bars (<strong><em>they are generated one by one with date/time, 1 is the first one and 100 is the last</em></strong>) as below, but due to limitation of the phone screen size only 7 data/bar are proper to show. By default it shows the first 7 data/bars each time. But I want to let it show the last 7 data/bars so that I can see <strong><em>the latest result</em></strong> directly.</p>

<p>by default:</p>

<pre><code>1 2 3 4 5 6 7 8 9 10 11 ...95 96 97 98 99 100
-------------
</code></pre>

<p>if drag the graph:</p>

<pre><code>1 2 3 ... 33 34 35 36 37 38 39 .... 97 98 99 100
          --------------------
</code></pre>

<p>I want it be like this:</p>

<pre><code>1 2 3 4 5 6 7 8 9 10 11 ...95 96 97 98 99 100
                           ------------------
</code></pre>

<p>here ------------- means the phone screen.</p>

<p><strong>I find the answer:</strong></p>

<pre><code>// show the last 7 data/bars
        if(count &lt; 7){
            renderer.setXAxisMin(0.5);
            renderer.setXAxisMax(7.5);
        }
        else
        {           
            renderer.setXAxisMin(count-7+0.5);
            renderer.setXAxisMax(count-7+7.5);  
        }
</code></pre>
