1

I'm using achartengine and I show a ghraph where on the x axis are putted the last 30 days starting by the current date and on the y axis some values from 15 to 0. In my code I used

      for(int i=0; i<= array of value to be inserted i++){
         .....
         aRenderer.addXTextLabel(//value I want is showd on x axis);
         .....
      }
      aRenderer.setXAxisMin(dateMin);
      aRenderer.setXAxisMax(adateMax);
      aRenderer.setXLabels(0);

Now given that I customized my x labels, when I scroll on the right and on the left, the other labesl don't appeare. So I thought of create a new class that implements PanLinstener and in the panApplied() redraw the labels when I scroll the panel. Someone has a better idea to to this?

This is what I obtain when I scroll to left from right:

enter image description here

4

2 回答 2

0

我选择实现 PanLinstener,在 panApplied() 方法中重新绘制图形。

于 2012-05-06T11:42:38.527 回答
0

在 panApplied() 方法下,您将不得不重建自定义标签。您可能需要知道 X 轴范围:renderer.getXAxixMin() 和 renderer.getXAxisMax() 并在此间隔之间添加新的自定义标签。

于 2012-05-15T12:34:31.947 回答