MPAndroidChart x軸數(shù)據(jù)重復(fù)問(wèn)題

在用MPAndroidChart 中發(fā)現(xiàn) x軸?數(shù)據(jù)會(huì)出現(xiàn)重復(fù),于是乎各種找答案,最后還是在源碼中發(fā)現(xiàn)了有一個(gè)方法

xAxis.setGranularity(1f); //設(shè)置x軸每最小刻度??

/**

* Set a minimum interval for the axis when zooming in. The axis is not allowed to go below

* that limit. This can be used to avoid label duplicating when zooming in(PS:這個(gè)是關(guān)鍵,幸好我一眼認(rèn)出了?duplicating,否則還在這個(gè)問(wèn)題上困擾著呢)

*@param granularity

*/

public void setGranularity(float granularity) {

mGranularity = granularity;

? ? // set this to true if it was disabled, as it makes no sense to call this method with granularity disabled

? ? mGranularityEnabled =true;

}

?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請(qǐng)結(jié)合常識(shí)與多方信息審慎甄別。
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡(jiǎn)書(shū)系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

  • rljs by sennchi Timeline of History Part One The Cognitiv...
    sennchi閱讀 7,871評(píng)論 0 10
  • The Inner Game of Tennis W Timothy Gallwey Jonathan Cape ...
    網(wǎng)事_79a3閱讀 12,973評(píng)論 3 20
  • 2017年6月24日是個(gè)值得紀(jì)念的日子,這一天,綿陽(yáng)市攝影協(xié)會(huì)第六期培訓(xùn)班經(jīng)過(guò)三個(gè)半月的學(xué)習(xí)和實(shí)踐,順利結(jié)業(yè)...
    四月薔薇等風(fēng)來(lái)閱讀 598評(píng)論 11 5
  • 這個(gè)周末過(guò)得有點(diǎn)手忙腳亂。周六一早就接到老板的微信,要討論年中預(yù)算的事情。自己還慶幸已經(jīng)提早對(duì)匯報(bào)材料進(jìn)行研讀和分...
    cris_gz閱讀 471評(píng)論 0 1
  • 盼學(xué)成,擁學(xué)問(wèn),困學(xué)中。有多少、負(fù)累蒼生。苦中作樂(lè),畢生心愿望達(dá)成!上安父母,盡人情、下恤孩童。 思心郁,怒心痛,...
    屹昕閱讀 254評(píng)論 0 0

友情鏈接更多精彩內(nèi)容