答案 0 :(得分:0)
试试这个:
graph.getViewport().setYAxisBoundsManual(true);
graph.getViewport().setMinY(minValueY);
graph.getViewport().setMaxY(maxValueY);
graph.getViewport().setXAxisBoundsManual(true);
graph.getViewport().setMinX(minValueX);
graph.getViewport().setMaxX(maxValueX);
graph.getGridLabelRenderer().setNumVerticalLabels(2);
graph.getGridLabelRenderer().setNumHorizontalLabels(2);