You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you set graph.getViewport().setXAxisBoundsManual(true); for both the X and Y axes but then only supply a minimum for both (0 for each), the X axis will increase automatically with data while the Y axis is initiated at 1 on the graph and will not move. How do you get around this? In an older version of the code I'm running, this bug didn't happen.
Note: the data I have is coming in VIA bluetooth and being appended to a series in real time, so I cannot set a maximum value to begin with.
The text was updated successfully, but these errors were encountered:
In my example, I am streaming data VIA bluetooth. Using an app like the one below, I set up two phones next to each other and send an number from one phone to the next, where I would like it to be graphed.
As you can see, before any numbers are received, the window is automatically 0 to 1 on the y-axis and 0 to 0.75+ on the x-axis. My code for this uses a GraphView object named graph and the viewport is set as follows:
graph.getViewport().setXAxisBoundsManual(true); // set manual X bounds
graph.getViewport().setMinX(0);
graph.getViewport().setMaxX(count);
graph.getViewport().setYAxisBoundsManual(true); // set manual Y bounds
graph.getViewport().setMinY(0);
where count is an integer variable that increases by one for each integer received from the other phone. Count is initialized to 0.
When running this code, while the x axis increases as count increases, the y-axis never moves from the initial 0 to 1 position seen here.
Additionally, as you can see in the picture the "Vertical" is being covered by the 0.5. When the viewport is NOT specified, the spacing between the axis label and the axis numbering is automatically done. When the viewport is specified, this issues occurs. (This is not my primary issue but it is another I encountered with the viewport, FYI).
If you set graph.getViewport().setXAxisBoundsManual(true); for both the X and Y axes but then only supply a minimum for both (0 for each), the X axis will increase automatically with data while the Y axis is initiated at 1 on the graph and will not move. How do you get around this? In an older version of the code I'm running, this bug didn't happen.
Note: the data I have is coming in VIA bluetooth and being appended to a series in real time, so I cannot set a maximum value to begin with.
The text was updated successfully, but these errors were encountered: