2013-05-29 36 views
1

我想要的是一個線圖,在x軸上從0到15,並有垂直網格線上的每個整數從0到15.我不想要任何標籤或傳說或標題。我想顯示網格,但不使用標籤時使用AChartEngine

代碼片段:

//don't want legend showing 
mRenderer.setShowLegend(false); 

//this is the only way i can force it to have grid lines every integer (note: if i make this number 14 then the graph puts only 8 labels ie 0, 2, 4, 6, 8, 10, 12, 14) 
mRenderer.setXLabels(15); 

//this removes all labels from y axis 
mRenderer.setYLabels(0); 

//i have to do this otherwise the setShowGridY statement is worthless 
mRenderer.setShowLabels(true); 

//i do want a grid on the y-plane (not x-plane) 
mRenderer.setShowGridY(true); 

//forces x axis to span from 0 to 15  
mRenderer.setXAxisMax(15); 
mRenderer.setXAxisMin(0); 

這段代碼的作用是顯示網格線和標籤。我只想要網格線,但如果我這樣做: mRenderer.setShowLabels(false); 然後標籤消失以及網格線。

在我看來,如果啓用了標籤,則只能有網格線。

任何人都可以幫助我嗎?

感謝, 添

+0

什麼ID並與mRenderer.setShowGrid(真)取代mRenderer.setShowGridY(真),然後設置mRenderer.setShowLabels(假)和它的工作。 – theFan667

+0

它確實具有從顯示屏中刪除標題的副作用,但現在這不是問題。 – theFan667

+0

現在我該怎麼辦 - Swetha Kini回答了我的問題,但我不知道如何選擇他的答案? – theFan667

回答

1

嘗試renderer.setShowGrid(true)代替setShowGridY(true)

相關問題