本文整理汇总了Java中org.jfree.chart.axis.NumberAxis.getRange方法的典型用法代码示例。如果您正苦于以下问题:Java NumberAxis.getRange方法的具体用法?Java NumberAxis.getRange怎么用?Java NumberAxis.getRange使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.jfree.chart.axis.NumberAxis
的用法示例。
在下文中一共展示了NumberAxis.getRange方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testFindDomainBounds
import org.jfree.chart.axis.NumberAxis; //导入方法依赖的package包/类
/**
* Check that the renderer is calculating the domain bounds correctly.
*/
public void testFindDomainBounds() {
TableXYDataset dataset
= RendererXYPackageTests.createTestTableXYDataset();
JFreeChart chart = ChartFactory.createStackedXYAreaChart(
"Test Chart", "X", "Y", dataset,
PlotOrientation.VERTICAL, false, false, false);
XYPlot plot = (XYPlot) chart.getPlot();
plot.setRenderer(new StackedXYBarRenderer());
NumberAxis domainAxis = (NumberAxis) plot.getDomainAxis();
domainAxis.setAutoRangeIncludesZero(false);
Range bounds = domainAxis.getRange();
assertFalse(bounds.contains(0.3));
assertTrue(bounds.contains(0.5));
assertTrue(bounds.contains(2.5));
assertFalse(bounds.contains(2.8));
}
示例2: testFindRangeBounds
import org.jfree.chart.axis.NumberAxis; //导入方法依赖的package包/类
/**
* Check that the renderer is calculating the range bounds correctly.
*/
public void testFindRangeBounds() {
TableXYDataset dataset
= RendererXYPackageTests.createTestTableXYDataset();
JFreeChart chart = ChartFactory.createStackedXYAreaChart(
"Test Chart", "X", "Y", dataset, PlotOrientation.VERTICAL,
false, false, false);
XYPlot plot = (XYPlot) chart.getPlot();
StackedXYAreaRenderer2 renderer = new StackedXYAreaRenderer2();
plot.setRenderer(renderer);
NumberAxis rangeAxis = (NumberAxis) plot.getRangeAxis();
Range bounds = rangeAxis.getRange();
assertTrue(bounds.contains(6.0));
assertTrue(bounds.contains(8.0));
// try null argument
assertNull(renderer.findRangeBounds(null));
// try empty dataset
assertNull(renderer.findRangeBounds(new DefaultTableXYDataset()));
}
示例3: testFindDomainBounds
import org.jfree.chart.axis.NumberAxis; //导入方法依赖的package包/类
/**
* Check that the renderer is calculating the domain bounds correctly.
*/
public void testFindDomainBounds() {
XYSeriesCollection dataset
= RendererXYPackageTests.createTestXYSeriesCollection();
JFreeChart chart = ChartFactory.createXYBarChart(
"Test Chart", "X", false, "Y", dataset,
PlotOrientation.VERTICAL, false, false, false
);
XYPlot plot = (XYPlot) chart.getPlot();
NumberAxis domainAxis = (NumberAxis) plot.getDomainAxis();
domainAxis.setAutoRangeIncludesZero(false);
Range bounds = domainAxis.getRange();
assertFalse(bounds.contains(0.3));
assertTrue(bounds.contains(0.5));
assertTrue(bounds.contains(2.5));
assertFalse(bounds.contains(2.8));
}
示例4: testFindDomainBounds
import org.jfree.chart.axis.NumberAxis; //导入方法依赖的package包/类
/**
* Check that the renderer is calculating the domain bounds correctly.
*/
public void testFindDomainBounds() {
XYSeriesCollection dataset
= RendererXYPackageTests.createTestXYSeriesCollection();
JFreeChart chart = ChartFactory.createXYLineChart(
"Test Chart", "X", "Y", dataset, PlotOrientation.VERTICAL,
false, false, false);
XYPlot plot = (XYPlot) chart.getPlot();
NumberAxis domainAxis = (NumberAxis) plot.getDomainAxis();
domainAxis.setAutoRangeIncludesZero(false);
Range bounds = domainAxis.getRange();
assertFalse(bounds.contains(0.9));
assertTrue(bounds.contains(1.0));
assertTrue(bounds.contains(2.0));
assertFalse(bounds.contains(2.10));
}
示例5: testFindRangeBounds
import org.jfree.chart.axis.NumberAxis; //导入方法依赖的package包/类
/**
* Check that the renderer is calculating the range bounds correctly.
*/
public void testFindRangeBounds() {
TableXYDataset dataset
= RendererXYPackageTests.createTestTableXYDataset();
JFreeChart chart = ChartFactory.createXYLineChart(
"Test Chart", "X", "Y", dataset, PlotOrientation.VERTICAL,
false, false, false);
XYPlot plot = (XYPlot) chart.getPlot();
NumberAxis rangeAxis = (NumberAxis) plot.getRangeAxis();
rangeAxis.setAutoRangeIncludesZero(false);
Range bounds = rangeAxis.getRange();
assertFalse(bounds.contains(1.0));
assertTrue(bounds.contains(2.0));
assertTrue(bounds.contains(5.0));
assertFalse(bounds.contains(6.0));
}
示例6: testFindRangeBounds
import org.jfree.chart.axis.NumberAxis; //导入方法依赖的package包/类
/**
* Check that the renderer is calculating the range bounds correctly.
*/
public void testFindRangeBounds() {
TableXYDataset dataset
= RendererXYPackageTests.createTestTableXYDataset();
JFreeChart chart = ChartFactory.createStackedXYAreaChart(
"Test Chart", "X", "Y", dataset,
PlotOrientation.VERTICAL, false, false, false);
XYPlot plot = (XYPlot) chart.getPlot();
plot.setRenderer(new StackedXYBarRenderer());
NumberAxis rangeAxis = (NumberAxis) plot.getRangeAxis();
Range bounds = rangeAxis.getRange();
assertTrue(bounds.contains(6.0));
assertTrue(bounds.contains(8.0));
}
示例7: testFindRangeBounds
import org.jfree.chart.axis.NumberAxis; //导入方法依赖的package包/类
/**
* Check that the renderer is calculating the range bounds correctly.
*/
public void testFindRangeBounds() {
TableXYDataset dataset
= RendererXYPackageTests.createTestTableXYDataset();
JFreeChart chart = ChartFactory.createStackedXYAreaChart(
"Test Chart", "X", "Y", dataset, PlotOrientation.VERTICAL,
false, false, false);
XYPlot plot = (XYPlot) chart.getPlot();
NumberAxis rangeAxis = (NumberAxis) plot.getRangeAxis();
Range bounds = rangeAxis.getRange();
assertTrue(bounds.contains(6.0));
assertTrue(bounds.contains(8.0));
}