MPAndroidChart icon indicating copy to clipboard operation
MPAndroidChart copied to clipboard

mChart.moveViewToX();This method result in failing to draw chart

Open PeakerChen opened this issue 9 years ago • 4 comments

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?

PeakerChen avatar May 16 '17 03:05 PeakerChen

show more code

ghost avatar May 16 '17 08:05 ghost

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?

PeakerChen avatar May 22 '17 14:05 PeakerChen

What you need in app?

ghost avatar May 22 '17 15:05 ghost

move my chart to the one hundredth index to be shown

PeakerChen avatar May 23 '17 00:05 PeakerChen