Sergei Mikhailovskii
Sergei Mikhailovskii

Reputation: 2465

Maximal values of axes in a GraphView

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?

Upvotes: 2

Views: 267

Answers (1)

Psytho
Psytho

Reputation: 3384

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);

Upvotes: 1

Related Questions