0

I have a working app using Graphview in Android Studio. API 18 using com.jjoe64:graphview:3.1.3 When I try to add data that has (x(I+1) b- x(I)) < 0 the app crashes with "Unfortunately. app has stopped. Is this a bug or are negative deltaX not allowed? Here is a sample

GraphViewSeries exampleSeries = new GraphViewSeries(new GraphViewData[] {
 new GraphViewData(1, 40)
 , new GraphViewData(2, 12)
 , new GraphViewData(3, 7)
 , new GraphViewData(2, 8) //note negative delta x
 , new GraphViewData(4, 10)
        });
reggaeguitar
  • 1,795
  • 1
  • 27
  • 48
dnlblack
  • 3
  • 2
  • I got a trick to work. In this case there were always 5 data points to make 4 line segments. So I broke the one graph of 4 segments into 4 graphs of 1 segment. With 4 graphseries if any of the delta Xi were negative then flip the X and Y values for that graphseries.To redraw graph add 4 graphseries to a graphview . I'm moving the graph segments to set the position of a robotic arm. – dnlblack Jan 09 '15 at 23:37

1 Answers1

0

It's not allowed - that's how it's documented to work:

values - the values must be in the correct order! x-value has to be ASC.

th65
  • 188
  • 2
  • 11
  • Thank you. When I went back and read the documentation more slowly, I found that info. So I came up with a work around mentioned above. – dnlblack Jan 09 '15 at 23:49