public Axis xAxis() { Axis xAxis = new Axis(); xAxis.setAutoGenerated(false); List<AxisValue> xAxisValues = new ArrayList<AxisValue>(); GregorianCalendar now = new GregorianCalendar(); GregorianCalendar today = new GregorianCalendar( now.get(Calendar.YEAR), now.get(Calendar.MONTH), now.get(Calendar.DAY_OF_MONTH)); final java.text.DateFormat timeFormat = hourFormat(); timeFormat.setTimeZone(TimeZone.getDefault()); double start_hour_block = today.getTime().getTime(); double timeNow = new Date().getTime(); for (int l = 0; l <= 24; l++) { if ((start_hour_block + (60000 * 60 * (l))) < timeNow) { if ((start_hour_block + (60000 * 60 * (l + 1))) >= timeNow) { endHour = start_hour_block + (60000 * 60 * (l)); l = 25; } } } for (int l = 0; l <= 24; l++) { double timestamp = (endHour - (60000 * 60 * l)); xAxisValues.add( new AxisValue((long) (timestamp / FUZZER), (timeFormat.format(timestamp)).toCharArray())); } xAxis.setValues(xAxisValues); xAxis.setHasLines(true); xAxis.setTextSize(axisTextSize); return xAxis; }
public Axis yAxis() { Axis yAxis = new Axis(); yAxis.setAutoGenerated(false); List<AxisValue> axisValues = new ArrayList<AxisValue>(); // for(int j = 1; j <= 12; j += 1) { // if (doMgdl) { // axisValues.add(new AxisValue(j * 50)); // } else { // axisValues.add(new AxisValue(j*2)); // } // } axisValues.add(new AxisValue(240)); axisValues.add(new AxisValue((int) this.lowMark)); axisValues.add(new AxisValue((int) this.highMark)); yAxis.setValues(axisValues); yAxis.setHasLines(true); yAxis.setLineColor(Color.parseColor("#555555")); yAxis.setMaxLabelChars(5); yAxis.setInside(true); yAxis.setTextSize(axisTextSize); yAxis.setTextColor(Color.parseColor("#8D8D8D")); yAxis.setHasTiltedLabels(true); return yAxis; }
public Axis previewXAxis() { List<AxisValue> previewXaxisValues = new ArrayList<AxisValue>(); final java.text.DateFormat timeFormat = hourFormat(); timeFormat.setTimeZone(TimeZone.getDefault()); for (int l = 0; l <= 24; l += hoursPreviewStep) { double timestamp = (endHour - (60000 * 60 * l)); previewXaxisValues.add( new AxisValue((long) (timestamp / FUZZER), (timeFormat.format(timestamp)).toCharArray())); } Axis previewXaxis = new Axis(); previewXaxis.setValues(previewXaxisValues); previewXaxis.setHasLines(true); previewXaxis.setTextSize(previewAxisTextSize); previewXaxis.setLineColor(Color.parseColor("#555555")); previewXaxis.setTextSize(axisTextSize); return previewXaxis; }
///////// AXIS RELATED////////////// public Axis yAxis() { Axis yAxis = new Axis(); yAxis.setAutoGenerated(false); List<AxisValue> axisValues = new ArrayList<AxisValue>(); for (int j = 1; j <= 12; j += 1) { if (doMgdl) { axisValues.add(new AxisValue(j * 50)); } else { axisValues.add(new AxisValue(j * 2)); } } yAxis.setValues(axisValues); yAxis.setHasLines(true); yAxis.setMaxLabelChars(5); yAxis.setInside(true); yAxis.setTextSize(axisTextSize); return yAxis; }
public Axis chartXAxis() { Axis xAxis = xAxis(); xAxis.setTextSize(axisTextSize); return xAxis; }