Android AChartEngine : Hide tick marks in axes

2019-08-15 17:34发布

Am trying out some graphs in an Android App with AChartEngine (version 1.2.0). I want to hide the tick marks in the axes (i.e. the small lines at each label displayed on the axes). I have marked two of them in red-colored-boxes in the screenshot below:

enter image description here

how do I do it? Can someone please help? I read here (https://code.google.com/p/achartengine/issues/detail?id=336) that there is a multirenderer.setShowTickMarks(false); method. But am not getting to see that method in the XYMultipleSeries renderer API ( http://www.achartengine.org/content/javadoc/org/achartengine/renderer/XYMultipleSeriesRenderer.html ) on the Web, nor is that method recognized as defined in the IDE when I type it.

1条回答
萌系小妹纸
2楼-- · 2019-08-15 18:12

What you have to do is:

mSetRenderer.setXLabels(0);



for(int i=0;i<=14;i++)
{
  if(i==4 || i==5)
  {
       // Do nothing(this will prevent to show ticks on 4th and 5th Value of X axis)
  }
  else
  {
      mSetRenderer.addXTextLabel(i,String.valueOf(i));
  }

}
查看更多
登录 后发表回答