Android GraphView Library - Zoom and scroll not working in small X increments (seconds)

I am using the GraphView library (see https://github.com/jjoe64/GraphView or http://www.jjoe64.com/p/graphview-library.html ). Working with GraphView-Demos-master, I am modifying the "public DateAsXAxis .." class to slightly increment the date in seconds rather than days. Scaling and scrolling do not work with seconds increments in the X-axis.

Calendar calendar = Calendar.getInstance();
Date d1 = calendar.getTime();
DataPoint[] datos = new DataPoint[50];
        for (int i=0; i<50; i++){
            datos[i]= new DataPoint(d1,i%4);
//            d1.setTime(d1.getTime() + 86400000); // 1 day works ok, but with some jumps in scale
            d1.setTime(d1.getTime() + 60000); // 1 min doesn't work scrolling not scaling.
        }
        LineGraphSeries<DataPoint> series = new LineGraphSeries<DataPoint>(datos);

            graph.addSeries(series);
    // set date label formatter
    graph.getGridLabelRenderer().setLabelFormatter(new DateAsXAxisLabelFormatter(getActivity()));
    graph.getGridLabelRenderer().setNumHorizontalLabels(3); // only 4 because of the space

    // set manual x bounds to have nice steps
    graph.getViewport().setMinX(datos[0].getX());
    graph.getViewport().setMaxX(datos[3].getX());
    graph.getViewport().setXAxisBoundsManual(true);
    graph.getViewport().setScalable(true);

      

+3
android android-graphview


source to share


No one has answered this question yet

Check out similar questions:

nine
Using dates in the Graphview library
2
Wrong x-axis graphic widget
1
How to format the x-axis scale to logarithmic scale in android library?
1
Periodic Function Difficulty with Android Graphics Library
1
Android Application Development - android-graphview library
1
Get Date object from DatePickerFragment in Android
0
android - how to clear series and label in GraphView .. library?
0
Android like combo graph using GraphView library
0
When scrolling horizontally the GraphView shortcuts
0
Android Android Graphics Library in Android



All Articles
Loading...
X
Show
Funny
Dev
Pics