class LineGraph implements HighChart {

    @Override
    public String toHighChartsSeries() {
        StringBuilder arrayBuilder = new StringBuilder("[");

        int size = points.size();
        Long lastX = null;
        for (int i = 0; i < size; i++) {
            Point point = points.get(i);
            Double y = point.getY();
            long date = (long) point.getX();

            if (displayGaps && lastX != null && date - lastX > TimeUnit.MINUTES.toMillis(3L)) {
                addMissingPoints(arrayBuilder, lastX, date);
            }
            lastX = date;

            arrayBuilder.append("[").append(date).append(",").append(y).append("]");
            if (i < size - 1) {
                arrayBuilder.append(",");
            }
        }

        arrayBuilder.append("]");
        return arrayBuilder.toString();
    }

    public  LineGraph(List<Point> points, boolean displayGaps);

}