本文整理汇总了Java中org.jfree.chart.axis.Timeline类的典型用法代码示例。如果您正苦于以下问题:Java Timeline类的具体用法?Java Timeline怎么用?Java Timeline使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Timeline类属于org.jfree.chart.axis包,在下文中一共展示了Timeline类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createHighLowChart
import org.jfree.chart.axis.Timeline; //导入依赖的package包/类
/**
* Creates and returns a default instance of a high-low-open-close chart with
* a special timeline. This timeline can be a {@link org.jfree.chart.axis.SegmentedTimeline}
* such as the Monday trough Friday timeline that will remove Saturdays and Sundays from
* the axis.
*
* @param title the chart title (<code>null</code> permitted).
* @param timeAxisLabel a label for the time axis (<code>null</code> permitted).
* @param valueAxisLabel a label for the value axis (<code>null</code> permitted).
* @param dataset the dataset for the chart (<code>null</code> permitted).
* @param timeline the timeline.
* @param legend a flag specifying whether or not a legend is required.
*
* @return a high-low-open-close chart.
*/
public static JFreeChart createHighLowChart(String title,
String timeAxisLabel,
String valueAxisLabel,
OHLCDataset dataset,
Timeline timeline,
boolean legend) {
DateAxis timeAxis = new DateAxis(timeAxisLabel);
timeAxis.setTimeline(timeline);
NumberAxis valueAxis = new NumberAxis(valueAxisLabel);
HighLowRenderer renderer = new HighLowRenderer();
renderer.setToolTipGenerator(new HighLowItemLabelGenerator());
XYPlot plot = new XYPlot(dataset, timeAxis, valueAxis, renderer);
JFreeChart chart = new JFreeChart(title, JFreeChart.DEFAULT_TITLE_FONT, plot, legend);
return chart;
}
示例2: createHighLowChart
import org.jfree.chart.axis.Timeline; //导入依赖的package包/类
/**
* Creates and returns a default instance of a high-low-open-close chart
* with a special timeline. This timeline can be a
* {@link org.jfree.chart.axis.SegmentedTimeline} such as the Monday
* through Friday timeline that will remove Saturdays and Sundays from
* the axis.
*
* @param title the chart title (<code>null</code> permitted).
* @param timeAxisLabel a label for the time axis (<code>null</code>
* permitted).
* @param valueAxisLabel a label for the value axis (<code>null</code>
* permitted).
* @param dataset the dataset for the chart (<code>null</code> permitted).
* @param timeline the timeline.
* @param legend a flag specifying whether or not a legend is required.
*
* @return A high-low-open-close chart.
*/
public static JFreeChart createHighLowChart(String title,
String timeAxisLabel,
String valueAxisLabel,
OHLCDataset dataset,
Timeline timeline,
boolean legend) {
DateAxis timeAxis = new DateAxis(timeAxisLabel);
timeAxis.setTimeline(timeline);
NumberAxis valueAxis = new NumberAxis(valueAxisLabel);
HighLowRenderer renderer = new HighLowRenderer();
renderer.setBaseToolTipGenerator(new HighLowItemLabelGenerator());
XYPlot plot = new XYPlot(dataset, timeAxis, valueAxis, renderer);
JFreeChart chart = new JFreeChart(title, JFreeChart.DEFAULT_TITLE_FONT,
plot, legend);
return chart;
}
示例3: createHighLowChart
import org.jfree.chart.axis.Timeline; //导入依赖的package包/类
/**
* Creates and returns a default instance of a high-low-open-close chart
* with a special timeline. This timeline can be a
* {@link org.jfree.chart.axis.SegmentedTimeline} such as the Monday
* through Friday timeline that will remove Saturdays and Sundays from
* the axis.
*
* @param title the chart title (<code>null</code> permitted).
* @param timeAxisLabel a label for the time axis (<code>null</code>
* permitted).
* @param valueAxisLabel a label for the value axis (<code>null</code>
* permitted).
* @param dataset the dataset for the chart (<code>null</code> permitted).
* @param timeline the timeline.
* @param legend a flag specifying whether or not a legend is required.
*
* @return A high-low-open-close chart.
*/
public static JFreeChart createHighLowChart(String title,
String timeAxisLabel,
String valueAxisLabel,
OHLCDataset dataset,
Timeline timeline,
boolean legend) {
DateAxis timeAxis = new DateAxis(timeAxisLabel);
timeAxis.setTimeline(timeline);
NumberAxis valueAxis = new NumberAxis(valueAxisLabel);
HighLowRenderer renderer = new HighLowRenderer();
renderer.setBaseToolTipGenerator(new HighLowItemLabelGenerator());
XYPlot plot = new XYPlot(dataset, timeAxis, valueAxis, renderer);
JFreeChart chart = new JFreeChart(title, JFreeChart.DEFAULT_TITLE_FONT,
plot, legend);
currentTheme.apply(chart);
return chart;
}
示例4: adjustmentValueChanged
import org.jfree.chart.axis.Timeline; //导入依赖的package包/类
/**
* Notification when the scrollbar's model changes.
*
* @param event
*/
public void adjustmentValueChanged(AdjustmentEvent event) {
if (mUpdating) {
return;
}
mUpdating = true;
double start = getValue() / mRatio + mDataRangeMin;
double end = start + mViewLength;
if (end > start) {
Timeline tl = ((DateAxis) mDomainAxis).getTimeline();
start = tl.toMillisecond((long) start);
end = tl.toMillisecond((long) end);
mDomainAxis.setRange(start, end);
//System.out.println(String.format("start=%f end=%f", start, end));
}
mUpdating = false;
}
示例5: createHighLowChart
import org.jfree.chart.axis.Timeline; //导入依赖的package包/类
/**
* Creates and returns a default instance of a high-low-open-close chart
* with a special timeline. This timeline can be a
* {@link org.jfree.chart.axis.SegmentedTimeline} such as the Monday
* through Friday timeline that will remove Saturdays and Sundays from
* the axis.
*
* @param title the chart title (<code>null</code> permitted).
* @param timeAxisLabel a label for the time axis (<code>null</code>
* permitted).
* @param valueAxisLabel a label for the value axis (<code>null</code>
* permitted).
* @param dataset the dataset for the chart (<code>null</code> permitted).
* @param timeline the timeline.
* @param legend a flag specifying whether or not a legend is required.
*
* @return A high-low-open-close chart.
*/
public static JFreeChart createHighLowChart(String title,
String timeAxisLabel, String valueAxisLabel, OHLCDataset dataset,
Timeline timeline, boolean legend) {
DateAxis timeAxis = new DateAxis(timeAxisLabel);
timeAxis.setTimeline(timeline);
NumberAxis valueAxis = new NumberAxis(valueAxisLabel);
HighLowRenderer renderer = new HighLowRenderer();
renderer.setBaseToolTipGenerator(new HighLowItemLabelGenerator());
XYPlot plot = new XYPlot(dataset, timeAxis, valueAxis, renderer);
JFreeChart chart = new JFreeChart(title, JFreeChart.DEFAULT_TITLE_FONT,
plot, legend);
currentTheme.apply(chart);
return chart;
}
示例6: updateAxis
import org.jfree.chart.axis.Timeline; //导入依赖的package包/类
private void updateAxis() {
if (mUpdating) {
return;
}
mUpdating = true;
double viewMin = 0;
double viewMax = 0;
Range dataRange = mPlot.getDataRange(mDomainAxis);
if (dataRange != null) {
mDataRangeMin = dataRange.getLowerBound();
mDataRangeMax = dataRange.getUpperBound();
if (mFirstTime) {
mDomainAxis.setAutoRange(false);
mDomainAxis.setRange(mDataRangeMin, mDataRangeMin + mPageSizeMillis); // 30s
}
viewMin = mDomainAxis.getLowerBound();
viewMax = mDomainAxis.getUpperBound();
Timeline tl = mDomainAxis.getTimeline();
mDataRangeMin = tl.toTimelineValue((long) mDataRangeMin);
mDataRangeMax = tl.toTimelineValue((long) mDataRangeMax);
viewMin = tl.toTimelineValue((long) viewMin);
viewMax = tl.toTimelineValue((long) viewMax);
mViewLength = viewMax - viewMin;
mRatio = STEPS / (mDataRangeMax - mDataRangeMin);
if (mFirstTime) {
// Must do this to support page scrolling when
// clicking in the scrollbar "gutter". Make the
// blockIncrement somewhat smaller than the view size
// so teh user sees the old value when page scrolling.
int blockIncrement = (int) (mPageSizeMillis * 0.9 * STEPS / mViewLength);
setBlockIncrement(blockIncrement);
setUnitIncrement(blockIncrement / 20);
mFirstTime = false;
setVisible(true);
}
} else {
mDataRangeMin = 0;
mDataRangeMax = 0;
mViewLength = 0;
mRatio = 1;
}
int newMin = 0;
int newMax = STEPS;
int newExtent = (int) (mViewLength * mRatio);
int newValue = (int) ((viewMin - mDataRangeMin) * mRatio);
setValues(newValue, newExtent, newMin, newMax);
mUpdating = false;
}
示例7: createHighLowChart
import org.jfree.chart.axis.Timeline; //导入依赖的package包/类
/**
* Creates and returns a default instance of a high-low-open-close chart
* with a special timeline. This timeline can be a
* {@link org.jfree.chart.axis.SegmentedTimeline} such as the Monday
* through Friday timeline that will remove Saturdays and Sundays from
* the axis.
*
* @param title the chart title (<code>null</code> permitted).
* @param timeAxisLabel a label for the time axis (<code>null</code>
* permitted).
* @param valueAxisLabel a label for the value axis (<code>null</code>
* permitted).
* @param dataset the dataset for the chart (<code>null</code> permitted).
* @param timeline the timeline.
* @param legend a flag specifying whether or not a legend is required.
*
* @return A high-low-open-close chart.
*/
public static JFreeChart createHighLowChart(String title,
String timeAxisLabel, String valueAxisLabel,
OHLCDataset dataset, Timeline timeline, boolean legend) {
DateAxis timeAxis = new DateAxis(timeAxisLabel);
timeAxis.setTimeline(timeline);
NumberAxis valueAxis = new NumberAxis(valueAxisLabel);
HighLowRenderer renderer = new HighLowRenderer();
renderer.setBaseToolTipGenerator(new HighLowItemLabelGenerator());
XYPlot plot = new XYPlot(dataset, timeAxis, valueAxis, renderer);
JFreeChart chart = new JFreeChart(title, JFreeChart.DEFAULT_TITLE_FONT,
plot, legend);
currentTheme.apply(chart);
return chart;
}
示例8: getTimeline
import org.jfree.chart.axis.Timeline; //导入依赖的package包/类
/**
* Getter for property timeline.
* @return Value of property timeline.
*/
public Timeline getTimeline() {
return this.timeline;
}
示例9: setTimeline
import org.jfree.chart.axis.Timeline; //导入依赖的package包/类
/**
* Setter for property timeline.
* @param timeline New value of property timeline.
*/
public void setTimeline(Timeline timeline) {
this.timeline = timeline;
}