Reputation: 3070
I am making a application to draw hear signal chart as figure. Could you suggest to me how to implement it in android (that means which is layout in this case). Thank you so much
Upvotes: 2
Views: 373
Reputation: 1691
You can create a custom View
in which you will override onDraw(Canvas canvas)
method. In this method you can use a canvas
object to draw lines and other shapes in order to get the result you want. Take a look at methods drawLine(...)
, drawPath(...)
.
EDIT:
class HeartGraphView extends View {
float[] dataX, dataY;
@Override
public void onDraw (Canvas canvas) {
for (int i = 0; i < data.length - 1; i++) {
// apply some transformation on data in order to map it correctly
// in the coordinates of the canvas
canvas.drawLine(dataX[i], dataY[i], dataX[i+1], dataY[i+1] ... );
}
}
}
Upvotes: 7
Reputation: 906
use achartengine library and u can eaisly set up the design as u have mentioned above and manipulate your data accordingly and for more details GO TO and can be manipulated dynamically through custom list adapter
Hope it Help You
Upvotes: 3