org.jfree.chart.plot.XYPlot.getDomainAxis()方法的使用及代码示例

x33g5p2x  于2022-02-02 转载在 其他  
字(7.4k)|赞(0)|评价(0)|浏览(180)

本文整理了Java中org.jfree.chart.plot.XYPlot.getDomainAxis()方法的一些代码示例,展示了XYPlot.getDomainAxis()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。XYPlot.getDomainAxis()方法的具体详情如下:
包路径:org.jfree.chart.plot.XYPlot
类名称:XYPlot
方法名:getDomainAxis

XYPlot.getDomainAxis介绍

[英]Returns the domain axis with index 0. If the domain axis for this plot is null, then the method will return the parent plot's domain axis (if there is a parent plot).
[中]返回索引为0的域轴。如果此绘图的域轴为空,则该方法将返回父绘图的域轴(如果存在父绘图)。

代码示例

代码示例来源:origin: stackoverflow.com

TITLE, "hh:mm:ss", "milliVolts", dataset, true, true, false);
final XYPlot plot = result.getXYPlot();
ValueAxis domain = plot.getDomainAxis();
domain.setAutoRange(true);
ValueAxis range = plot.getRangeAxis();

代码示例来源:origin: stackoverflow.com

Point2D p = chartPanel.translateScreenToJava2D(mouseChartEvent.getTrigger().getPoint());
Rectangle2D plotArea = chartPanel.getScreenDataArea();
XYPlot plot = (XYPlot) chart.getPlot(); // your plot
double chartX = plot.getDomainAxis().java2DToValue(p.getX(), plotArea, plot.getDomainAxisEdge());
double chartY = plot.getRangeAxis().java2DToValue(p.getY(), plotArea, plot.getRangeAxisEdge());

代码示例来源:origin: stackoverflow.com

XYItemRenderer renderer = xyPlot.getRenderer();
renderer.setSeriesPaint(0, Color.blue);
NumberAxis domain = (NumberAxis) xyPlot.getDomainAxis();
domain.setRange(0.00, 1.00);
domain.setTickUnit(new NumberTickUnit(0.1));

代码示例来源:origin: stackoverflow.com

final XYPlot plot = getChart().getXYPlot();
final ValueAxis domainAxis = plot.getDomainAxis();
final ValueAxis rangeAxis = plot.getRangeAxis();
final Rectangle2D plotRectangle = SWTUtils.toAwtRectangle(getScreenDataArea());
final double chartX = domainAxis.java2DToValue(relativeX, plotRectangle, plot.getDomainAxisEdge());
final double chartY = rangeAxis.java2DToValue(relativeY, plotRectangle, plot.getRangeAxisEdge());

代码示例来源:origin: stackoverflow.com

XYPlot xyPlot = jfreechart.getXYPlot();
ValueAxis domainAxis = xyPlot.getDomainAxis();
ValueAxis rangeAxis = xyPlot.getRangeAxis();

domainAxis.setRange(0.0, 1.0);
domainAxis.setTickUnit(new NumberTickUnit(0.1));
rangeAxis.setRange(0.0, 1.0);
rangeAxis.setTickUnit(new NumberTickUnit(0.05));

代码示例来源:origin: net.preibisch/multiview-reconstruction

public static int getChartXLocation( final Point point, final ChartPanel panel )
{
  final Point2D p = panel.translateScreenToJava2D( point );
  final Rectangle2D plotArea = panel.getScreenDataArea();
  final XYPlot plot = (XYPlot) panel.getChart().getPlot();
  final double chartX = plot.getDomainAxis().java2DToValue( p.getX(), plotArea, plot.getDomainAxisEdge() );
  //final double chartY = plot.getRangeAxis().java2DToValue( p.getY(), plotArea, plot.getRangeAxisEdge() );
  
  return (int)Math.round( chartX );			
}

代码示例来源:origin: com.hazelcast.simulator/visualizer

@Override
  public void stateChanged(ChangeEvent e) {
    int value = mainHorizontalSlider.getValue();
    plot.getDomainAxis().setUpperBound(value);
    plot.getDomainAxis().setLowerBound(0);
    fineHorizontalSlider.setMaximum(value);
    fineHorizontalSlider.setValue(value);
  }
});

代码示例来源:origin: net.preibisch/multiview-reconstruction

public static int getChartXLocation( final Point point, final ChartPanel panel )
{
  final Point2D p = panel.translateScreenToJava2D( point );
  final Rectangle2D plotArea = panel.getScreenDataArea();
  final XYPlot plot = (XYPlot) panel.getChart().getPlot();
  final double chartX = plot.getDomainAxis().java2DToValue( p.getX(), plotArea, plot.getDomainAxisEdge() );
  //final double chartY = plot.getRangeAxis().java2DToValue( p.getY(), plotArea, plot.getRangeAxisEdge() );
  return (int)Math.round( chartX );
}

代码示例来源:origin: org.codehaus.mojo/chronos-report-maven-plugin

public static XYPlot setUpperBound( JFreeChart chart, double max )
{
  XYPlot plot = chart.getXYPlot();
  ValueAxis axis = plot.getDomainAxis();
  axis.setUpperBound( max );
  return plot;
}

代码示例来源:origin: stackoverflow.com

XYPlot plot = (XYPlot) chart.getPlot();
ValueAxis axis = plot.getDomainAxis();
axis.setLowerBound(0);
XYBarRenderer r = (XYBarRenderer) plot.getRenderer();
r.setBarPainter(new StandardXYBarPainter());
r.setSeriesPaint(0, Color.blue);

代码示例来源:origin: org.n52.series-api/io

private void configureDomainAxis(XYPlot plot) {
  ValueAxis domainAxis = plot.getDomainAxis();
  domainAxis.setTickLabelFont(LabelConstants.FONT_LABEL);
  domainAxis.setLabelFont(LabelConstants.FONT_LABEL);
  domainAxis.setTickLabelPaint(LabelConstants.COLOR);
  domainAxis.setLabelPaint(LabelConstants.COLOR);
}

代码示例来源:origin: stackoverflow.com

XYPlot plot = chart.getXYPlot();
NumberAxis xAxis = (NumberAxis) plot.getDomainAxis();
xAxis.setTickUnit(new NumberTickUnit(10));

NumberAxis yAxis = (NumberAxis) plot.getRangeAxis();
yAxis.setTickUnit(new NumberTickUnit(1));

代码示例来源:origin: org.zkoss.zk/zkex

private void setupDateAxis(JFreeChart jchart, Chart chart) {
  final Plot plot = jchart.getPlot();
  final DateAxis axisX = (DateAxis) ((XYPlot)plot).getDomainAxis();
  final TimeZone zone = chart.getTimeZone();
  if (zone != null) {
    axisX.setTimeZone(zone);
  }
  if (chart.getDateFormat() != null) {
    axisX.setDateFormatOverride(_dateFormat);
  }
}

代码示例来源:origin: ca.umontreal.iro/ssj

protected void initAxis(){
 XAxis = new Axis((NumberAxis)((XYPlot)chart.getPlot()).getDomainAxis(),
          Axis.ORIENTATION_HORIZONTAL);
 YAxis = new Axis((NumberAxis)((XYPlot)chart.getPlot()).getRangeAxis(),
          Axis.ORIENTATION_VERTICAL);
 setAutoRange(true, true);
}

代码示例来源:origin: ca.umontreal.iro/ssj

protected void initAxis(){
 XAxis = new Axis((NumberAxis)((XYPlot)chart.getPlot()).getDomainAxis(),
          Axis.ORIENTATION_HORIZONTAL);
 YAxis = new Axis((NumberAxis)((XYPlot)chart.getPlot()).getRangeAxis(),
          Axis.ORIENTATION_VERTICAL);
 setAutoRange(true, true);
}

代码示例来源:origin: stackoverflow.com

XYPlot plot = chart.getXYPlot();
final ValueAxis domain = plot.getDomainAxis();

domain.setAutoRange(true);

NumberAxis axis = new NumberAxis();
axis.setTickUnit(new NumberTickUnit(100));

ValueAxis range = plot.getRangeAxis();
range.setRange(0, 100);

代码示例来源:origin: stackoverflow.com

XYPlot plot = chart.getXYPlot();
final NumberAxis domain = (NumberAxis)plot.getDomainAxis();

domain.setAutoRange(false);

domain.setRange(0,1000);
domain.setTickUnit(new NumberTickUnit(100));

NumberAxis range = (NumberAxis)plot.getRangeAxis(); 
range.setRange(0,100);

代码示例来源:origin: com.atlassian.jira/jira-api

public static void setupPlot(XYPlot plot)
{
  plot.setBackgroundPaint(ChartDefaults.transparent);
  plot.setOutlinePaint(ChartDefaults.transparent);
  plot.setRangeGridlinePaint(ChartDefaults.gridLineColor);
  plot.setRangeGridlineStroke(new BasicStroke(0.5f));
  plot.setRangeGridlinesVisible(true);
  plot.setRangeAxisLocation(ChartDefaults.rangeAxisLocation);
  plot.setDomainGridlinesVisible(true);
  ChartUtil.setupRangeAxis(plot.getRangeAxis());
  ChartUtil.setupDomainAxis(plot.getDomainAxis());
}

代码示例来源:origin: org.n52.sensorweb/timeseries-io

private void configureTimeAxis(XYPlot xyPlot) {
  DateAxis timeAxis = (DateAxis) xyPlot.getDomainAxis();
  timeAxis.setRange(getStartTime(getTimespan()), getEndTime(getTimespan()));
  String timeformat = "yyyy-MM-dd, HH:mm";
  if (getChartStyleDefinitions().containsParameter("timeformat")) {
    timeformat = getChartStyleDefinitions().getAsString("timeformat");
  }
  DateFormat requestTimeFormat = new SimpleDateFormat(timeformat, i18n.getLocale());
  requestTimeFormat.setTimeZone(getTimezone().toTimeZone());
  timeAxis.setDateFormatOverride(requestTimeFormat);
  timeAxis.setTimeZone(getTimezone().toTimeZone());
}

代码示例来源:origin: de.tudarmstadt.ukp.dkpro.tc/de.tudarmstadt.ukp.dkpro.tc.weka-gpl

@Override
  public void write(OutputStream aStream)
    throws IOException
  {
    JFreeChart chart = ChartFactory.createXYLineChart(null, "Recall", "Precision", dataset,
        PlotOrientation.VERTICAL, false, false, false);
    chart.getXYPlot().setRenderer(new XYSplineRenderer());
    chart.getXYPlot().getRangeAxis().setRange(0.0, 1.0);
    chart.getXYPlot().getDomainAxis().setRange(0.0, 1.0);
    ChartUtil.writeChartAsSVG(aStream, chart, 400, 400);
  }
}

相关文章

微信公众号

最新文章

更多

XYPlot类方法