1. Are you ready for the Galaxy S20? Here is everything we know so far!

Android GraphView show double

Discussion in 'Android Development' started by Akamecyan, Jun 30, 2020.

  1. Akamecyan

    Akamecyan Lurker
    Thread Starter

    Hello guys, i trying to show in graph view double data in Y axis and when i put for example 4.65 in graph i see only 65 like integer.
    the following commands i tryed.
    Double Voltage = cursor.getDouble( cursor.getColumnIndex("Voltage") );
    series.appendData(new DataPoint(xLastVlue, Voltage * 10d), true, 40);
    series.appendData(new DataPoint(xLastVlue, Voltage), true, 40);

    Thanks you alot.
     


  2. wseng92

    wseng92 Android Enthusiast

    which line is Y-axis?
     
  3. Akamecyan

    Akamecyan Lurker
    Thread Starter

    private void startTimer() {
    handler = new Handler();
    handler.postDelayed(timer = new Runnable() {
    @override
    public void run() {
    Cursor cursor = databaseHelper.GetLastParameters();
    cursor.moveToLast();
    try {
    xLastVlue++;
    Double Voltage = cursor.getDouble( cursor.getColumnIndex("Voltage") );
    Double Current = cursor.getDouble(cursor.getColumnIndex("FlowCurrent"));
    series.appendData(new DataPoint(xLastVlue, Voltage * 10d), true, 40);
    series2.appendData(new DataPoint(xLastVlue, Current * 10d), true, 40);

    } catch (Exception e) {
    e.printStackTrace();
    }

    handler.postDelayed(this, Delay_Timer);



    }
    }, Delay_Timer);
    }
     
Loading...
Similar Threads - Android GraphView show
  1. Gleis
    Replies:
    0
    Views:
    44
  2. angrypidgeon
    Replies:
    1
    Views:
    64
  3. coyote2
    Replies:
    2
    Views:
    136
  4. chinnar
    Replies:
    0
    Views:
    157
  5. Jennifer catron
    Replies:
    0
    Views:
    158
  6. Jennifer catron
    Replies:
    2
    Views:
    254
  7. sariDon2
    Replies:
    0
    Views:
    141
  8. jamstewonline
    Replies:
    1
    Views:
    118
  9. Sunshining
    Replies:
    2
    Views:
    350
  10. username988
    Replies:
    0
    Views:
    144

Share This Page

Loading...