MPAndroidChart icon indicating copy to clipboard operation
MPAndroidChart copied to clipboard

Dragging one LineChartItem drags all LineChartItems in ListViewMultiChartActivity

Open kefs opened this issue 11 years ago • 1 comments

Modify the example app: give the ability to drag to all LineChartItems within the getView():

holder.chart.setDragEnabled(true); //enable drag
holder.chart.setVisibleXRange(2); //added so we can drag something

Run the example app, run Multiple chart inside ListView

If you drag one of your line charts, any line chart off screen shows up dragged to the same position. It also happens to the touch points.. if you touch somewhere in a line chart within the listview and it shows the crosshairs (red in the example app), the crosshairs will be drawn in the same spot on newly drawn rows in the ListView.

kefs avatar May 19 '15 19:05 kefs

Yes, that is common ListView behaviour as the ListView recycles it's children instead of recreating them everytime you scroll over them.

If you unhiglight in every call of getView(...) and reset all scaling and dragging, this will no longer occur.

PhilJay avatar May 19 '15 19:05 PhilJay