1

I want to implement draggable line chart for android.

This is exactly i want to

I have referred many charts library like mpandroid, android-plot, hz-graphview among all line charts are static.

P.S I'm not asking anyone to implement this all i need is guidelines or any open source library will be appreciated.

Aks4125
  • 4,522
  • 4
  • 32
  • 48

3 Answers3

3

I would recommend you to start with trying out this sample from Android developers-site to get started with drawing in canvas if you haven't done so before. Then start to modify the sample to use onTouchEvent for dragging the objects, and take it from there.

Read more: Drag Shape On Canvas in android

Community
  • 1
  • 1
timbillstrom
  • 1,176
  • 16
  • 33
1

It seems MPAndroidChart has dragging feature. Check it out. BTW I haven't tried it yet. https://github.com/PhilJay/MPAndroidChart/blob/master/README.md

ugur
  • 3,604
  • 3
  • 26
  • 57
-1

A library is now available with the same feature mentioned.

source

Achieved same functionality with this library with minor modification.

Aks4125
  • 4,522
  • 4
  • 32
  • 48
  • 1
    how did you implement it with minor modification? I also need a curves like graph same as google snapseed app for image editing. What i want is to show line graph and then drag when user taps on the point on line graph – Nouman Bhatti Apr 02 '18 at 12:03
  • 1
    I tried to achieve this change using inheritance, it's not minor at all. And I'm stucked to the state where I cannot modify the dataset points, so I think I'll need to fork the library – Livio Nov 13 '18 at 11:03
  • @Livio exactly, you need to do custom modification for the similar requirement. – Aks4125 Nov 13 '18 at 17:37