Creating an AChartEngine TimeChart Using Time in Y-Axis

I have some data representing answer questions at a specific time, for example.

Question 1 was answered at 00:00:20. I am trying to use AChartEngine to represent this, but no luck. First of all, I cannot have the value Y as this format for any reason, I believe that it is not supported or needs to be configured, which until now could not find a way to achieve.

My chart should have an X-axis at the end with the values ​​1, 2, 3, 4, 5 .... and a Y-axis from 00:00:20, 00:00:15, 00:00:05, 00:00 : 10 .... The time reached in each question is stored in the "Time Object" field. I try this approach:

private void fillData() { int i = 0; for (Answer answer : getAnswers()) { i++; if (answer.getEstimatedAnswerTime() != null) { Log.d(TAG, String.valueOf(answer.getEstimatedAnswerTime())); myQuestionsTimeSeries.add(new Date(DateTimeHelper.getMillisFromTime(answer.getEstimatedAnswerTime())), i); } } } 

The first problem, cannot get the time values ​​in Y-Axis and not display correctly. See screenshot below.

enter image description here

I guess you guessed it. Thank you in advance.

+1
source share
1 answer

TimeChart displays date format labels on the x-axis. It looks like you need to do this on the y-axis.

Just create a regular LineChart and add your own Y-axis labels:

 // disable the default Y labels first renderer.setYLabels(0); // add several custom labels renderer.addYTextLabel(y, "label"); 
0
source

All Articles