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


Java XYDataset.getX方法代码示例

本文整理汇总了Java中org.jfree.data.xy.XYDataset.getX方法的典型用法代码示例。如果您正苦于以下问题:Java XYDataset.getX方法的具体用法?Java XYDataset.getX怎么用?Java XYDataset.getX使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.jfree.data.xy.XYDataset的用法示例。


在下文中一共展示了XYDataset.getX方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: createItemArray

import org.jfree.data.xy.XYDataset; //导入方法依赖的package包/类
/**
 * Creates the array of items that can be passed to the {@link MessageFormat} class
 * for creating labels.
 *
 * @param dataset  the dataset (<code>null</code> not permitted).
 * @param series  the series (zero-based index).
 * @param item  the item (zero-based index).
 *
 * @return the items (never <code>null</code>).
 */
protected Object[] createItemArray(XYDataset dataset, int series, int item) {
    Object[] result = new Object[8];
    result[0] = dataset.getSeriesName(series);
    Number x = dataset.getX(series, item);
    if (getXDateFormat() != null) {
        result[1] = getXDateFormat().format(new Date(x.longValue()));   
    }
    else {
        result[1] = getXFormat().format(x);
    }
    NumberFormat formatter = getYFormat();
    
    if (dataset instanceof BoxAndWhiskerXYDataset) {
        BoxAndWhiskerXYDataset d = (BoxAndWhiskerXYDataset) dataset;
        result[2] = formatter.format(d.getMeanValue(series, item));
        result[3] = formatter.format(d.getMedianValue(series, item));
        result[4] = formatter.format(d.getMinRegularValue(series, item));
        result[5] = formatter.format(d.getMaxRegularValue(series, item));
        result[6] = formatter.format(d.getQ1Value(series, item));
        result[7] = formatter.format(d.getQ3Value(series, item));
    }
    return result;
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:34,代码来源:BoxAndWhiskerXYToolTipGenerator.java

示例2: createItemArray

import org.jfree.data.xy.XYDataset; //导入方法依赖的package包/类
/**
 * Creates the array of items that can be passed to the {@link MessageFormat} class
 * for creating labels.
 *
 * @param dataset  the dataset (<code>null</code> not permitted).
 * @param series  the series (zero-based index).
 * @param item  the item (zero-based index).
 *
 * @return The items (never <code>null</code>).
 */
protected Object[] createItemArray(XYDataset dataset, int series, int item) {
    Object[] result = new Object[3];
    result[0] = dataset.getSeriesName(series);
    Number x = dataset.getX(series, item);
    if (this.xDateFormat != null) {
        result[1] = this.xDateFormat.format(x);   
    }
    else {
        result[1] = this.xFormat.format(x);
    }
    Number y = dataset.getY(series, item);
    if (this.yDateFormat != null) {
        result[2] = this.yDateFormat.format(y);   
    }
    else {
        result[2] = this.yFormat.format(y);
    }
    return result;
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:30,代码来源:AbstractXYItemLabelGenerator.java

示例3: createItemArray

import org.jfree.data.xy.XYDataset; //导入方法依赖的package包/类
/**
 * Creates the array of items that can be passed to the 
 * {@link MessageFormat} class for creating labels.
 *
 * @param dataset  the dataset (<code>null</code> not permitted).
 * @param series  the series (zero-based index).
 * @param item  the item (zero-based index).
 *
 * @return The items (never <code>null</code>).
 */
protected Object[] createItemArray(XYDataset dataset, int series, 
                                   int item) {
    Object[] result = new Object[8];
    result[0] = dataset.getSeriesKey(series).toString();
    Number x = dataset.getX(series, item);
    if (getXDateFormat() != null) {
        result[1] = getXDateFormat().format(new Date(x.longValue()));   
    }
    else {
        result[1] = getXFormat().format(x);
    }
    NumberFormat formatter = getYFormat();
    
    if (dataset instanceof BoxAndWhiskerXYDataset) {
        BoxAndWhiskerXYDataset d = (BoxAndWhiskerXYDataset) dataset;
        result[2] = formatter.format(d.getMeanValue(series, item));
        result[3] = formatter.format(d.getMedianValue(series, item));
        result[4] = formatter.format(d.getMinRegularValue(series, item));
        result[5] = formatter.format(d.getMaxRegularValue(series, item));
        result[6] = formatter.format(d.getQ1Value(series, item));
        result[7] = formatter.format(d.getQ3Value(series, item));
    }
    return result;
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:35,代码来源:BoxAndWhiskerXYToolTipGenerator.java

示例4: drawItem

import org.jfree.data.xy.XYDataset; //导入方法依赖的package包/类
/**
 * Draws the visual representation of a single data item.
 *
 * @param g2  the graphics device.
 * @param state  the renderer state.
 * @param dataArea  the area within which the data is being drawn.
 * @param info  collects information about the drawing.
 * @param plot  the plot (can be used to obtain standard color information etc).
 * @param domainAxis  the domain (horizontal) axis.
 * @param rangeAxis  the range (vertical) axis.
 * @param dataset  the dataset.
 * @param series  the series index (zero-based).
 * @param item  the item index (zero-based).
 * @param crosshairState  crosshair information for the plot (<code>null</code> permitted).
 * @param pass  the pass index.
 */
public void drawItem(Graphics2D g2,
                     XYItemRendererState state,
                     Rectangle2D dataArea,
                     PlotRenderingInfo info,
                     XYPlot plot,
                     ValueAxis domainAxis,
                     ValueAxis rangeAxis,
                     XYDataset dataset,
                     int series,
                     int item,
                     CrosshairState crosshairState,
                     int pass) {

    // get the data point...
    Number xn = dataset.getX(series, item);
    Number yn = dataset.getY(series, item);
    if (yn != null) {
        double x = xn.doubleValue();
        double y = yn.doubleValue();
        RectangleEdge xAxisLocation = plot.getDomainAxisEdge();
        RectangleEdge yAxisLocation = plot.getRangeAxisEdge();
        double transX = domainAxis.valueToJava2D(x, dataArea, xAxisLocation);
        double transY = rangeAxis.valueToJava2D(y, dataArea, yAxisLocation);

        g2.setPaint(this.getItemPaint(series, item));
        PlotOrientation orientation = plot.getOrientation();
        if (orientation == PlotOrientation.HORIZONTAL) {
            g2.drawRect((int) transY, (int) transX, 1, 1);
        }
        else if (orientation == PlotOrientation.VERTICAL) {
            g2.drawRect((int) transX, (int) transY, 1, 1);
        }

        updateCrosshairValues(crosshairState, x, y, transX, transY, orientation);
    }

}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:54,代码来源:XYDotRenderer.java

示例5: createItemArray

import org.jfree.data.xy.XYDataset; //导入方法依赖的package包/类
/**
 * Creates the array of items that can be passed to the 
 * {@link MessageFormat} class for creating labels.
 *
 * @param dataset  the dataset (<code>null</code> not permitted).
 * @param series  the series (zero-based index).
 * @param item  the item (zero-based index).
 *
 * @return An array of three items from the dataset formatted as
 *         <code>String</code> objects (never <code>null</code>).
 */
protected Object[] createItemArray(XYDataset dataset, int series, 
                                   int item) {
    Object[] result = new Object[3];
    result[0] = dataset.getSeriesKey(series).toString();
    
    double x = dataset.getXValue(series, item);
    if (Double.isNaN(x) && dataset.getX(series, item) == null) {
        result[1] = this.nullXString;
    }
    else {
        if (this.xDateFormat != null) {
            result[1] = this.xDateFormat.format(new Date((long) x));   
        }
        else {
            result[1] = this.xFormat.format(x);
        }
    }
    
    double y = dataset.getYValue(series, item);
    if (Double.isNaN(y) && dataset.getY(series, item) == null) {
        result[2] = this.nullYString;
    }
    else {
        if (this.yDateFormat != null) {
            result[2] = this.yDateFormat.format(new Date((long) y));   
        }
        else {
            result[2] = this.yFormat.format(y);
        }
    }
    return result;
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:44,代码来源:AbstractXYItemLabelGenerator.java


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