Android AChartEngine : Hide tick marks in axes

被刻印的时光 ゝ 提交于 2019-12-24 15:29:53

问题


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:

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:


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));
  }

}


来源:https://stackoverflow.com/questions/23856440/android-achartengine-hide-tick-marks-in-axes

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!