本文整理汇总了Java中org.jfree.chart.axis.NumberAxis.setLowerMargin方法的典型用法代码示例。如果您正苦于以下问题:Java NumberAxis.setLowerMargin方法的具体用法?Java NumberAxis.setLowerMargin怎么用?Java NumberAxis.setLowerMargin使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.jfree.chart.axis.NumberAxis
的用法示例。
在下文中一共展示了NumberAxis.setLowerMargin方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: plotSeperate
import org.jfree.chart.axis.NumberAxis; //导入方法依赖的package包/类
private void plotSeperate(XYDataset dataset, String p)
{
NumberAxis rangeAxis1 = new NumberAxis(p);
rangeAxis1.setAutoRangeIncludesZero(false); // override default
rangeAxis1.setLowerMargin(0.40); // to leave room for volume bars
DecimalFormat format = new DecimalFormat("0");
rangeAxis1.setNumberFormatOverride(format);
final ValueAxis timeAxis = new DateAxis("Date");
timeAxis.setLowerMargin(0.02); // reduce the default margins
timeAxis.setUpperMargin(0.02);
XYPlot plot = new XYPlot(dataset, timeAxis, rangeAxis1, null);
XYItemRenderer renderer1 = new XYLineAndShapeRenderer(true, false);
renderer1.setBaseToolTipGenerator(
new StandardXYToolTipGenerator(
StandardXYToolTipGenerator.DEFAULT_TOOL_TIP_FORMAT,
new SimpleDateFormat("d-MMM-yyyy"), new DecimalFormat("0.00#")
)
);
plot.setRenderer(0, renderer1);
final CombinedDomainXYPlot cplot1 = (CombinedDomainXYPlot)this.candlestickChart.getPlot();
if (plot != null) cplot1.add(plot, 1); // weight is 1.
}
示例2: createChart
import org.jfree.chart.axis.NumberAxis; //导入方法依赖的package包/类
/**
* Creates a sample chart.
*
* @param dataset the dataset.
*
* @return A sample chart.
*/
private static JFreeChart createChart(VectorXYDataset dataset) {
NumberAxis xAxis = new NumberAxis("X");
xAxis.setStandardTickUnits(NumberAxis.createIntegerTickUnits());
xAxis.setLowerMargin(0.01);
xAxis.setUpperMargin(0.01);
xAxis.setAutoRangeIncludesZero(false);
NumberAxis yAxis = new NumberAxis("Y");
yAxis.setStandardTickUnits(NumberAxis.createIntegerTickUnits());
yAxis.setLowerMargin(0.01);
yAxis.setUpperMargin(0.01);
yAxis.setAutoRangeIncludesZero(false);
VectorRenderer renderer = new VectorRenderer();
renderer.setSeriesPaint(0, Color.blue);
XYPlot plot = new XYPlot(dataset, xAxis, yAxis, renderer);
plot.setBackgroundPaint(Color.lightGray);
plot.setDomainGridlinePaint(Color.white);
plot.setRangeGridlinePaint(Color.white);
plot.setAxisOffset(new RectangleInsets(5, 5, 5, 5));
plot.setOutlinePaint(Color.black);
JFreeChart chart = new JFreeChart("Vector Plot Demo 1", plot);
chart.setBackgroundPaint(Color.white);
return chart;
}
示例3: createCandlestickChart
import org.jfree.chart.axis.NumberAxis; //导入方法依赖的package包/类
private JFreeChart createCandlestickChart(OHLCDataset priceOHLCDataset) {
final String title = "Chart";
final ValueAxis timeAxis = new DateAxis("Date");
final NumberAxis valueAxis = new NumberAxis("Price");
valueAxis.setAutoRangeIncludesZero(false);
valueAxis.setUpperMargin(0.0);
valueAxis.setLowerMargin(0.0);
XYPlot plot = new XYPlot(priceOHLCDataset, timeAxis, valueAxis, null);
final CandlestickRenderer candlestickRenderer = new CandlestickRenderer();
plot.setRenderer(candlestickRenderer);
//plot.getRangeAxis().setAutoRange(true);
// Give good width when zoom in, but too slow in calculation.
((CandlestickRenderer)plot.getRenderer()).setAutoWidthMethod(CandlestickRenderer.WIDTHMETHOD_SMALLEST);
CombinedDomainXYPlot cplot = new CombinedDomainXYPlot(timeAxis);
cplot.add(plot, 3);
cplot.setGap(8.0);
JFreeChart chart = new JFreeChart(title, JFreeChart.DEFAULT_TITLE_FONT, cplot, true);
applyChartTheme(chart);
// Handle zooming event.
chart.addChangeListener(this.getChartChangeListner());
return chart;
}