Android的AChartEngine:在轴隐藏刻度线 [英] Android AChartEngine : Hide tick marks in axes
问题描述
我试图出Android应用一些图表与AChartEngine(1.2.0版本)。我想隐藏在轴上的刻度线(即小线在坐标轴上显示的每个标签)。
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:
我该怎么办呢?是否有人可以帮忙吗?
我读到这里(的https://$c$c.google ?.COM / p / achartengine /问题/细节ID = 336 ),有一个multirenderer.setShowTickMarks(假);方法。但我没有得到看XYMultipleSeries渲染API中的方法(<一个href=\"http://www.achartengine.org/content/javadoc/org/achartengine/renderer/XYMultipleSeriesRenderer.html\" rel=\"nofollow\">http://www.achartengine.org/content/javadoc/org/achartengine/renderer/XYMultipleSeriesRenderer.html )在网络上,也不是在IDE中定义的,当我键入它认识到方法。
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.
推荐答案
您所要做的是:
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));
}
}
这篇关于Android的AChartEngine:在轴隐藏刻度线的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!