mRenderer.setPanEnabled(true); time_series = new TimeSeries("test");
TimeSeriesCollection tsc = new TimeSeriesCollection(); tsc.addSeries(createSeries("Projected", 200)); tsc.addSeries(createSeries("Actual", 100)); return tsc; TimeSeries series = new TimeSeries(name); for (int i = 0; i < 6; i++) { series.add(new Year(2005 + i), Math.pow(2, i) * scale);
private XYPlot createTaskAssignmentPlot(TangoColorFactory tangoColorFactory, CheapTimeSolution solution) { OHLCSeriesCollection seriesCollection = new OHLCSeriesCollection(); Map<Machine, OHLCSeries> machineSeriesMap = new LinkedHashMap<>( solution.getMachineList().size()); renderer.setTickLength(0.0); int seriesIndex = 0; OHLCSeries unassignedProjectSeries = new OHLCSeries("Unassigned"); seriesCollection.addSeries(unassignedProjectSeries); machineSeriesMap.put(null, unassignedProjectSeries); renderer.setSeriesStroke(seriesIndex, new BasicStroke(3.0f)); seriesIndex++; for (Machine machine : solution.getMachineList()) { OHLCSeries machineSeries = new OHLCSeries(machine.getLabel()); seriesCollection.addSeries(machineSeries); machineSeriesMap.put(machine, machineSeries); renderer.setSeriesStroke(seriesIndex, new BasicStroke(3.0f)); machineSeries.add(new FixedMillisecond(pixelIndex), task.getStartPeriodRangeFrom(), startPeriod, endPeriod, task.getStartPeriodRangeTo() + task.getDuration()); pixelIndex++;
TimeSeriesCollection otherDataSet = new TimeSeriesCollection(); TimeSeries ts1 = new TimeSeries("Series 1"); otherDataSet.addSeries(ts1); TimeSeries ts2 = new TimeSeries("Series 2"); otherDataSet.addSeries(ts2); TimeSeries ts3 = new TimeSeries("Series 2"); otherDataSet.addSeries(ts3);
/** * Returns a time period that would be the next in sequence on the end of * the time series. * * @return The next time period. */ public RegularTimePeriod getNextTimePeriod() { RegularTimePeriod last = getTimePeriod(getItemCount() - 1); return last.next(); }
/** * Returns the number of items in the specified series. This method is * provided for convenience. * * @param series the series index (zero-based). * * @return The item count. */ @Override public int getItemCount(int series) { return getSeries(series).getItemCount(); }
/** * Creates a new minute. * * @param minute the minute (0-59). * @param hour the hour (0-23). * @param day the day (1-31). * @param month the month (1-12). * @param year the year (1900-9999). */ public Minute(int minute, int hour, int day, int month, int year) { this(minute, new Hour(hour, new Day(day, month, year))); }
/** * Returns the second. * * @return The second. */ public Second getSecond() { return new Second(this.second, this.minute, this.hour, this.day.getDayOfMonth(), this.day.getMonth(), this.day.getYear()); }
/** * Returns the value at the specified index. * * @param index index of a value. * * @return The value (possibly {@code null}). */ public Number getValue(int index) { return getRawDataItem(index).getValue(); }
/** * Returns the time period at the specified index. * * @param index the index of the data item. * * @return The time period. */ public RegularTimePeriod getTimePeriod(int index) { return getRawDataItem(index).getPeriod(); }
/** * Updates (changes) the value of a data item and sends a * {@link SeriesChangeEvent} to all registered listeners. * * @param index the index of the data item to update. * @param value the new value ({@code null} not permitted). */ public void update(int index, Number value) { TimePeriodValue item = getDataItem(index); item.setValue(value); fireSeriesChanged(); }
/** * Adds a new data item to the series and sends a {@link SeriesChangeEvent} * to all registered listeners. * * @param period the time period ({@code null} not permitted). * @param value the value ({@code null} permitted). */ public void add(TimePeriod period, Number value) { TimePeriodValue item = new TimePeriodValue(period, value); add(item); }
rendererSeries.setPointStyle(PointStyle.CIRCLE); timeSeries = new TimeSeries("Random"); mThread = new Thread(){ public void run(){
/** * Returns a time period that would be the next in sequence on the end of * the time series. * * @return The next time period. */ public RegularTimePeriod getNextTimePeriod() { RegularTimePeriod last = getTimePeriod(getItemCount() - 1); return last.next(); }
public synchronized static RegularTimePeriod getRtp(OfxChartTimePeriod ofxTimePeriod, Date d) { RegularTimePeriod rtp; switch(ofxTimePeriod) { case Hour: rtp = new Hour(d);break; case Day: rtp = new Day(d);break; case Month: rtp = new Month(d);break; default: rtp = new Hour(d);break; } return rtp; }