... SimpleDateFormat dfMin = new SimpleDateFormat("mm"); dfMin.setTimeZone(tz); // Setting timezone PeriodAxisLabelInfo aperiodaxislabelinfo[] = new PeriodAxisLabelInfo[2]; aperiodaxislabelinfo[0] = new PeriodAxisLabelInfo( org.jfree.data.time.Minute.class, dfMin); SimpleDateFormat dfHour = new SimpleDateFormat("mm"); dfHour.setTimeZone(tz); // Setting timezone aperiodaxislabelinfo[1] = new PeriodAxisLabelInfo( org.jfree.data.time.Hour.class, dfHour); periodaxis.setLabelInfo(aperiodaxislabelinfo); ...
setAutoRange(true); this.labelInfo = new PeriodAxisLabelInfo[2]; this.labelInfo[0] = new PeriodAxisLabelInfo(Month.class, new SimpleDateFormat("MMM", locale)); this.labelInfo[1] = new PeriodAxisLabelInfo(Year.class, new SimpleDateFormat("yyyy", locale));
SimpleDateFormat df0 = new SimpleDateFormat("MMM", locale); df0.setTimeZone(timeZone); this.labelInfo[0] = new PeriodAxisLabelInfo(Month.class, df0); SimpleDateFormat df1 = new SimpleDateFormat("yyyy", locale); df1.setTimeZone(timeZone); this.labelInfo[1] = new PeriodAxisLabelInfo(Year.class, df1);
if(StatsManager.CHARTTIMESERIES_WEEKDAY.equals(timePeriod)) { aperiodaxislabelinfo = new PeriodAxisLabelInfo[2]; aperiodaxislabelinfo[0] = new PeriodAxisLabelInfo(org.jfree.data.time.Day.class, new SimpleDateFormat("E", locale)); aperiodaxislabelinfo[1] = new PeriodAxisLabelInfo(org.jfree.data.time.Day.class, new SimpleDateFormat("d", locale)); }else if(StatsManager.CHARTTIMESERIES_DAY.equals(timePeriod)) { aperiodaxislabelinfo = new PeriodAxisLabelInfo[3]; aperiodaxislabelinfo[0] = new PeriodAxisLabelInfo(org.jfree.data.time.Day.class, new SimpleDateFormat("d", locale)); aperiodaxislabelinfo[1] = new PeriodAxisLabelInfo(org.jfree.data.time.Month.class, new SimpleDateFormat("MMM", locale)); aperiodaxislabelinfo[2] = new PeriodAxisLabelInfo(org.jfree.data.time.Year.class, new SimpleDateFormat("yyyy", locale)); }else if(StatsManager.CHARTTIMESERIES_MONTH.equals(timePeriod)) { aperiodaxislabelinfo = new PeriodAxisLabelInfo[2]; aperiodaxislabelinfo[0] = new PeriodAxisLabelInfo(org.jfree.data.time.Month.class, new SimpleDateFormat("MMM", locale)); aperiodaxislabelinfo[1] = new PeriodAxisLabelInfo(org.jfree.data.time.Year.class, new SimpleDateFormat("yyyy", locale)); }else if(StatsManager.CHARTTIMESERIES_YEAR.equals(timePeriod)) { aperiodaxislabelinfo = new PeriodAxisLabelInfo[1]; aperiodaxislabelinfo[0] = new PeriodAxisLabelInfo(org.jfree.data.time.Year.class, new SimpleDateFormat("yyyy", locale));
switch(ofxTp) case Hour: info[i] = new PeriodAxisLabelInfo(Hour.class,sdf);break; case Day: info[i] = new PeriodAxisLabelInfo(Day.class,sdf);break; case Month: info[i] = new PeriodAxisLabelInfo(Month.class,sdf);break; case Year: info[i] = new PeriodAxisLabelInfo(Year.class,sdf);break;
/** * Applies the attributes for this theme to a {@link PeriodAxis}. * * @param axis the axis ({@code null} not permitted). */ protected void applyToPeriodAxis(PeriodAxis axis) { PeriodAxisLabelInfo[] info = axis.getLabelInfo(); for (int i = 0; i < info.length; i++) { PeriodAxisLabelInfo e = info[i]; PeriodAxisLabelInfo n = new PeriodAxisLabelInfo(e.getPeriodClass(), e.getDateFormat(), e.getPadding(), this.regularFont, this.tickLabelPaint, e.getDrawDividers(), e.getDividerStroke(), e.getDividerPaint()); info[i] = n; } axis.setLabelInfo(info); }
/** * Applies the attributes for this theme to a {@link PeriodAxis}. * * @param axis the axis (<code>null</code> not permitted). */ protected void applyToPeriodAxis(PeriodAxis axis) { PeriodAxisLabelInfo[] info = axis.getLabelInfo(); for (int i = 0; i < info.length; i++) { PeriodAxisLabelInfo e = info[i]; PeriodAxisLabelInfo n = new PeriodAxisLabelInfo(e.getPeriodClass(), e.getDateFormat(), e.getPadding(), this.regularFont, this.tickLabelPaint, e.getDrawDividers(), e.getDividerStroke(), e.getDividerPaint()); info[i] = n; } axis.setLabelInfo(info); }