Example usage for org.jfree.data.general HeatMapDataset getYValue

List of usage examples for org.jfree.data.general HeatMapDataset getYValue

Introduction

In this page you can find the example usage for org.jfree.data.general HeatMapDataset getYValue.

Prototype

public double getYValue(int yIndex);

Source Link

Document

A convenience method that returns the y-value for the given index.

Usage

From source file:org.jfree.data.general.HeatMapUtilities.java

/**
 * Returns a dataset containing one series that holds a copy of the (y, z)
 * data from one column (x-index) of the specified dataset.
 *
 * @param dataset  the dataset (<code>null</code> not permitted).
 * @param column  the column (x) index./*from  w w w  . ja  va 2 s.  c  o m*/
 * @param seriesName  the series name (<code>null</code> not permitted).
 *
 * @return The dataset.
 */
public static XYDataset extractColumnFromHeatMapDataset(HeatMapDataset dataset, int column,
        Comparable seriesName) {
    XYSeries series = new XYSeries(seriesName);
    int rows = dataset.getYSampleCount();
    for (int r = 0; r < rows; r++) {
        series.add(dataset.getYValue(r), dataset.getZValue(column, r));
    }
    XYSeriesCollection result = new XYSeriesCollection(series);
    return result;
}