public static String[] generateXLabels(DataRange r) {
        String labels[];
        int days;

        switch (r) {
            case ONEDAY:
                days = 1;
                break;
                
            case FIVEDAYS:
                days = 5;
                break;

            case TENDAYS:
                days = 10;
                break;

            case ONEMONTH:
                days = 23;
                break;
            case THREEMONTH:
                days = 65;
                break;

            default:
                days = 0;
                break;

        }

        labels = new String[days];

        SimpleDateFormat formatter = new SimpleDateFormat("dd-MM-YYYY");
        Calendar cal = Calendar.getInstance();
        cal.add(Calendar.DATE, -(days + 1));

        for (int i = 0; i < days; i++) {
            cal.add(Calendar.DATE, +1);
            labels[i] = formatter.format(cal.getTime());
        }

        return labels;
    }