mChart.moveViewToX();This method result in failing to draw chart
I call the mChart.moveViewToX(newData.size()) method, but the view did not be drawn, but i did't call moveViewToX(newData.size()), the view was drawn. Who help me?
show more code
The following is my codes:
mMASlipCandleStickChart.setData(combindData); final ViewPortHandler viewPortHandlerCombin = mMASlipCandleStickChart.getViewPortHandler(); viewPortHandlerCombin.setMaximumScaleX(calcMaxscale(mKChartDataModel.getXAxisVals().size())); viewPortHandlerCombin.setMinimumScaleX(7); if (mKChartDataModel.getMainChartLineType() == EnumType.MainChartLineType.AP) { float max = mKChartDataModel.getXAxisVals().size(); mMainChartAxisK.setAxisMaxValue(max + 13f); } else { float max = mKChartDataModel.getXAxisVals().size(); mMainChartAxisK.setAxisMaxValue(max + 1f); } mMASlipCandleStickChart.moveViewToX(380); mMASlipCandleStickChart.invalidate();
I just add the follow checking in file ViewPortHandler.java and resolve the issue, but I don't understand very much. if (Float.isNaN(matrixBuffer[Matrix.MTRANS_Y])) { matrixBuffer[Matrix.MTRANS_Y] = 0; }
please help me?
What you need in app?
move my chart to the one hundredth index to be shown