2

I have the following code:

LineGraphSeries<DataPoint> series = new LineGraphSeries<>(arr);
                graphView.addSeries(series);
                graphView.getViewport().setMaxX(31);
                graphView.getViewport().setMaxY(150);
                graphView.getViewport().setMinX(1);
                graphView.getViewport().setMinY(0);

I need to set maximal and minimal values of axises by this code, but when I run the program I have this values:

enter image description here

What's the matter?

Phantômaxx
  • 37,901
  • 21
  • 84
  • 115
Sergei Mikhailovskii
  • 2,100
  • 2
  • 21
  • 43

1 Answers1

1

From javadoc:

Make sure to set the y bounds to manual via setYAxisBoundsManual(boolean)

So you must also add

graphView.getViewport().setYAxisBoundsManual(true);
graphView.getViewport().setXAxisBoundsManual(true);
Psytho
  • 3,313
  • 2
  • 19
  • 27