当前位置: 首页>>代码示例>>Java>>正文


Java NumberAxis.setLowerMargin方法代码示例

本文整理汇总了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.
  }
 
开发者ID:lead4good,项目名称:open-java-trade-manager,代码行数:27,代码来源:ChartJDialog.java

示例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;
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:32,代码来源:VectorPlotDemo1.java

示例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;        
}
 
开发者ID:lead4good,项目名称:open-java-trade-manager,代码行数:32,代码来源:ChartJDialog.java


注:本文中的org.jfree.chart.axis.NumberAxis.setLowerMargin方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。