// Path: 10000sentencesapp/src/main/java/info/puzz/a10000sentences/models/SentenceHistory.java
// @Data
// @Accessors(chain = true)
// @ToString
// @Table(name = "sentence_history")
// public class SentenceHistory extends Model {
// 
//     @Column(name = "sentence_id", index = true)
//     public String sentenceId;
// 
//     @Column(name = "collection_id")
//     public String collectionId;
// 
//     /** New status */
//     @Column(name = "status")
//     public int status;
// 
//     @Column(name = "previous_status")
//     public int previousStatus;
// 
//     /**
//      * Time spend on this quiz
//      */
//     @Column(name = "time")
//     public int time;
// 
//     @Column(name = "todo_count")
//     public int todoCount;
// 
//     @Column(name = "repeat_count")
//     public int repeatCount;
// 
//     @Column(name = "done_count")
//     public int doneCount;
// 
//     @Column(name = "ignore_count")
//     public int ignoreCount;
// 
//     @Column(name = "created", index = true)
//     public long created;
// }


import com.activeandroid.query.Select;
import com.jjoe64.graphview.series.DataPointInterface;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.TimeUnit;
import info.puzz.a10000sentences.models.SentenceHistory;
            Iterator<List<DataPoint>> i = donePerDay.values().iterator();
            while (i.hasNext()) {
                List<DataPoint> values = i.next();
                double minValue = Double.MAX_VALUE;
                for (DataPoint value : values) {
                    if (value.y < minValue) {
                        minValue = value.y;
                    }
                }

                if (minValue == Double.MAX_VALUE) {
                    minValue = 0;
                }

                for (DataPoint value : values) {
                    value.y -= minValue;
                }
            }
            return donePerDay;
        }
    }

    public StatsService() {
    }

    public Stats getStats(int daysAgo) {
        Calendar cal = Calendar.getInstance();
        cal.add(Calendar.DATE, -daysAgo);
        cal.set(Calendar.HOUR_OF_DAY, 0);
        cal.set(Calendar.MINUTE, 0);
// Path: 10000sentencesapp/src/main/java/info/puzz/a10000sentences/models/SentenceHistory.java
// @Data
// @Accessors(chain = true)
// @ToString
// @Table(name = "sentence_history")
// public class SentenceHistory extends Model {
// 
//     @Column(name = "sentence_id", index = true)
//     public String sentenceId;
// 
//     @Column(name = "collection_id")
//     public String collectionId;
// 
//     /** New status */
//     @Column(name = "status")
//     public int status;
// 
//     @Column(name = "previous_status")
//     public int previousStatus;
// 
//     /**
//      * Time spend on this quiz
//      */
//     @Column(name = "time")
//     public int time;
// 
//     @Column(name = "todo_count")
//     public int todoCount;
// 
//     @Column(name = "repeat_count")
//     public int repeatCount;
// 
//     @Column(name = "done_count")
//     public int doneCount;
// 
//     @Column(name = "ignore_count")
//     public int ignoreCount;
// 
//     @Column(name = "created", index = true)
//     public long created;
// }


// Path: 10000sentencesapp/src/main/java/info/puzz/a10000sentences/logic/StatsService.java
import com.activeandroid.query.Select;
import com.jjoe64.graphview.series.DataPointInterface;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.TimeUnit;
import info.puzz.a10000sentences.models.SentenceHistory;

            Iterator<List<DataPoint>> i = donePerDay.values().iterator();
            while (i.hasNext()) {
                List<DataPoint> values = i.next();
                double minValue = Double.MAX_VALUE;
                for (DataPoint value : values) {
                    if (value.y < minValue) {
                        minValue = value.y;
                    }
                }

                if (minValue == Double.MAX_VALUE) {
                    minValue = 0;
                }

                for (DataPoint value : values) {
                    value.y -= minValue;
                }
            }
            return donePerDay;
        }
    }

    public StatsService() {
    }

    public Stats getStats(int daysAgo) {
        Calendar cal = Calendar.getInstance();
        cal.add(Calendar.DATE, -daysAgo);
        cal.set(Calendar.HOUR_OF_DAY, 0);
        cal.set(Calendar.MINUTE, 0);
        List<SentenceHistory> history = new Select()