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

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

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

XYPlot.datasetChanged介绍

[英]Receives notification of a change to the plot's dataset.

The axis ranges are updated if necessary.
[中]接收绘图数据集更改的通知。
如有必要,将更新轴范围。

代码示例

代码示例来源:origin: org.jwall/streams-plotter

public void updateChart() {
  // synchronized (plot) {
  plot.datasetChanged(new DatasetChangeEvent(this, series));
  lastUpdate = System.currentTimeMillis();
  // }
}

代码示例来源:origin: org.jwall/streams-plotter

public void reset() {
  series.removeAllSeries();
  seriesMap.clear();
  pivotValue = 0.0d;
  plot.datasetChanged(new DatasetChangeEvent(this, series));
}

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

/**
 * Maps the specified dataset to the axes in the list.  Note that the
 * conversion of data values into Java2D space is always performed using
 * the first axis in the list.
 *
 * @param index  the dataset index (zero-based).
 * @param axisIndices  the axis indices (<code>null</code> permitted).
 *
 * @since 1.0.12
 */
public void mapDatasetToRangeAxes(int index, List axisIndices) {
  if (index < 0) {
    throw new IllegalArgumentException("Requires 'index' >= 0.");
  }
  checkAxisIndices(axisIndices);
  Integer key = new Integer(index);
  this.datasetToRangeAxesMap.put(key, new ArrayList(axisIndices));
  // fake a dataset change event to update axes...
  datasetChanged(new DatasetChangeEvent(this, getDataset(index)));
}

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

/**
 * Maps the specified dataset to the axes in the list.  Note that the
 * conversion of data values into Java2D space is always performed using
 * the first axis in the list.
 *
 * @param index  the dataset index (zero-based).
 * @param axisIndices  the axis indices (<code>null</code> permitted).
 *
 * @since 1.0.12
 */
public void mapDatasetToDomainAxes(int index, List axisIndices) {
  if (index < 0) {
    throw new IllegalArgumentException("Requires 'index' >= 0.");
  }
  checkAxisIndices(axisIndices);
  Integer key = new Integer(index);
  this.datasetToDomainAxesMap.put(key, new ArrayList(axisIndices));
  // fake a dataset change event to update axes...
  datasetChanged(new DatasetChangeEvent(this, getDataset(index)));
}

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

/**
 * Maps the specified dataset to the axes in the list.  Note that the
 * conversion of data values into Java2D space is always performed using
 * the first axis in the list.
 *
 * @param index  the dataset index (zero-based).
 * @param axisIndices  the axis indices ({@code null} permitted).
 *
 * @since 1.0.12
 */
public void mapDatasetToRangeAxes(int index, List axisIndices) {
  Args.requireNonNegative(index, "index");
  checkAxisIndices(axisIndices);
  Integer key = new Integer(index);
  this.datasetToRangeAxesMap.put(key, new ArrayList(axisIndices));
  // fake a dataset change event to update axes...
  datasetChanged(new DatasetChangeEvent(this, getDataset(index)));
}

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

/**
 * Maps the specified dataset to the axes in the list.  Note that the
 * conversion of data values into Java2D space is always performed using
 * the first axis in the list.
 *
 * @param index  the dataset index (zero-based).
 * @param axisIndices  the axis indices ({@code null} permitted).
 *
 * @since 1.0.12
 */
public void mapDatasetToDomainAxes(int index, List axisIndices) {
  Args.requireNonNegative(index, "index");
  checkAxisIndices(axisIndices);
  Integer key = new Integer(index);
  this.datasetToDomainAxesMap.put(key, new ArrayList(axisIndices));
  // fake a dataset change event to update axes...
  datasetChanged(new DatasetChangeEvent(this, getDataset(index)));
}

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

/**
 * Sets a dataset for the plot and sends a change event to all registered
 * listeners.
 *
 * @param index  the dataset index (must be &gt;= 0).
 * @param dataset  the dataset ({@code null} permitted).
 *
 * @see #getDataset(int)
 */
public void setDataset(int index, XYDataset dataset) {
  XYDataset existing = getDataset(index);
  if (existing != null) {
    existing.removeChangeListener(this);
  }
  this.datasets.put(index, dataset);
  if (dataset != null) {
    dataset.addChangeListener(this);
  }
  // send a dataset change event to self...
  DatasetChangeEvent event = new DatasetChangeEvent(this, dataset);
  datasetChanged(event);
}

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

/**
 * Receives notification of a change to the plot's dataset.
 * <P>
 * The axis ranges are updated if necessary.
 *
 * @param event  information about the event (not used here).
 */
@Override
public void datasetChanged(DatasetChangeEvent event) {
  super.datasetChanged(event);
  if (this.subplots == null) {
    return;  // this can happen during plot construction
  }
  XYDataset dataset = null;
  if (event.getDataset() instanceof XYDataset) {
    dataset = (XYDataset) event.getDataset();
  }
  for (XYPlot subplot : this.subplots) {
    if (subplot.indexOf(dataset) >= 0) {
      subplot.configureRangeAxes();
    }
  }
}

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

/**
 * Sets a dataset for the plot.
 *
 * @param index  the dataset index.
 * @param dataset  the dataset (<code>null</code> permitted).
 *
 * @see #getDataset(int)
 */
public void setDataset(int index, XYDataset dataset) {
  XYDataset existing = getDataset(index);
  if (existing != null) {
    existing.removeChangeListener(this);
  }
  this.datasets.set(index, dataset);
  if (dataset != null) {
    dataset.addChangeListener(this);
  }
  // send a dataset change event to self...
  DatasetChangeEvent event = new DatasetChangeEvent(this, dataset);
  datasetChanged(event);
}

相关文章

微信公众号

最新文章

更多

XYPlot类方法