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

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

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

XYPlot.setDomainCrosshairValue介绍

[英]Sets the domain crosshair value and sends a PlotChangeEvent to all registered listeners (provided that the domain crosshair is visible).
[中]设置域交叉线值,并向所有注册的侦听器发送PlotChangeEvent(前提是域交叉线可见)。

代码示例

代码示例来源:origin: jfree/jfreechart

/**
 * Sets the domain crosshair value and sends a {@link PlotChangeEvent} to
 * all registered listeners (provided that the domain crosshair is visible).
 *
 * @param value  the value.
 *
 * @see #getDomainCrosshairValue()
 */
public void setDomainCrosshairValue(double value) {
  setDomainCrosshairValue(value, true);
}

代码示例来源:origin: org.codehaus.jtstand/jtstand-chart

/**
 * Sets the domain crosshair value and sends a {@link PlotChangeEvent} to
 * all registered listeners (provided that the domain crosshair is visible).
 *
 * @param value  the value.
 *
 * @see #getDomainCrosshairValue()
 */
public void setDomainCrosshairValue(double value) {
  setDomainCrosshairValue(value, true);
}

代码示例来源:origin: jfree/jfreechart

/**
 * Handles a 'click' on the plot by updating the anchor values.
 *
 * @param x  the x-coordinate, where the click occurred, in Java2D space.
 * @param y  the y-coordinate, where the click occurred, in Java2D space.
 * @param info  object containing information about the plot dimensions.
 */
@Override
public void handleClick(int x, int y, PlotRenderingInfo info) {
  Rectangle2D dataArea = info.getDataArea();
  if (dataArea.contains(x, y)) {
    // set the anchor value for the horizontal axis...
    ValueAxis xaxis = getDomainAxis();
    if (xaxis != null) {
      double hvalue = xaxis.java2DToValue(x, info.getDataArea(),
          getDomainAxisEdge());
      setDomainCrosshairValue(hvalue);
    }
    // set the anchor value for the vertical axis...
    ValueAxis yaxis = getRangeAxis();
    if (yaxis != null) {
      double vvalue = yaxis.java2DToValue(y, info.getDataArea(),
          getRangeAxisEdge());
      setRangeCrosshairValue(vvalue);
    }
  }
}

代码示例来源:origin: org.codehaus.jtstand/jtstand-chart

/**
 * Handles a 'click' on the plot by updating the anchor values.
 *
 * @param x  the x-coordinate, where the click occurred, in Java2D space.
 * @param y  the y-coordinate, where the click occurred, in Java2D space.
 * @param info  object containing information about the plot dimensions.
 */
public void handleClick(int x, int y, PlotRenderingInfo info) {
  Rectangle2D dataArea = info.getDataArea();
  if (dataArea.contains(x, y)) {
    // set the anchor value for the horizontal axis...
    ValueAxis xaxis = getDomainAxis();
    if (xaxis != null) {
      double hvalue = xaxis.java2DToValue(x, info.getDataArea(),
          getDomainAxisEdge());
      setDomainCrosshairValue(hvalue);
    }
    // set the anchor value for the vertical axis...
    ValueAxis yaxis = getRangeAxis();
    if (yaxis != null) {
      double vvalue = yaxis.java2DToValue(y, info.getDataArea(),
          getRangeAxisEdge());
      setRangeCrosshairValue(vvalue);
    }
  }
}

代码示例来源:origin: jfree/jfreechart

setDomainCrosshairValue(crosshairState.getCrosshairX(), false);
if (isDomainCrosshairVisible()) {
  double x = getDomainCrosshairValue();

代码示例来源:origin: org.codehaus.jtstand/jtstand-chart

setDomainCrosshairValue(crosshairState.getCrosshairX(), false);
if (isDomainCrosshairVisible()) {
  double x = getDomainCrosshairValue();

相关文章

微信公众号

最新文章

更多

XYPlot类方法