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


Java OHLCDataset.getHigh方法代码示例

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


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

示例1: generateToolTip

import org.jfree.data.xy.OHLCDataset; //导入方法依赖的package包/类
/**
 * Generates a tooltip text item for a particular item within a series.
 *
 * @param dataset  the dataset.
 * @param series  the series (zero-based index).
 * @param item  the item (zero-based index).
 *
 * @return the tooltip text.
 */
public String generateToolTip(XYDataset dataset, int series, int item) {

    String result = null;

    if (dataset instanceof OHLCDataset) {
        OHLCDataset d = (OHLCDataset) dataset;
        Number high = d.getHigh(series, item);
        Number low = d.getLow(series, item);
        Number open = d.getOpen(series, item);
        Number close = d.getClose(series, item);
        Number x = d.getX(series, item);

        result = d.getSeriesName(series);

        if (x != null) {
            Date date = new Date(x.longValue());
            result = result + "--> Date=" + this.dateFormatter.format(date);
            if (high != null) {
                result = result + " High=" + this.numberFormatter.format(high.doubleValue());
            }
            if (low != null) {
                result = result + " Low=" + this.numberFormatter.format(low.doubleValue());
            }
            if (open != null) {
                result = result + " Open=" + this.numberFormatter.format(open.doubleValue());
            }
            if (close != null) {
                result = result + " Close=" + this.numberFormatter.format(close.doubleValue());
            }
        }

    }

    return result;

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

示例2: generateToolTip

import org.jfree.data.xy.OHLCDataset; //导入方法依赖的package包/类
/**
 * Generates a tooltip text item for a particular item within a series.
 *
 * @param dataset  the dataset.
 * @param series  the series (zero-based index).
 * @param item  the item (zero-based index).
 *
 * @return The tooltip text.
 */
@Override
public String generateToolTip(XYDataset dataset, int series, int item) {
    if (!(dataset instanceof OHLCDataset)) {
        return null;
    }
    StringBuilder sb = new StringBuilder();
    OHLCDataset d = (OHLCDataset) dataset;
    Number high = d.getHigh(series, item);
    Number low = d.getLow(series, item);
    Number open = d.getOpen(series, item);
    Number close = d.getClose(series, item);
    Number x = d.getX(series, item);
    sb.append(d.getSeriesKey(series).toString());
    if (x != null) {
        Date date = new Date(x.longValue());
        sb.append("--> Date=").append(this.dateFormatter.format(date));
        if (high != null) {
            sb.append(" High=");
            sb.append(this.numberFormatter.format(high.doubleValue()));
        }
        if (low != null) {
            sb.append(" Low=");
            sb.append(this.numberFormatter.format(low.doubleValue()));
        }
        if (open != null) {
            sb.append(" Open=");
            sb.append(this.numberFormatter.format(open.doubleValue()));
        }
        if (close != null) {
            sb.append(" Close=");
            sb.append(this.numberFormatter.format(close.doubleValue()));
        }
    }
    return sb.toString();
}
 
开发者ID:mdzio,项目名称:ccu-historian,代码行数:45,代码来源:HighLowItemLabelGenerator.java

示例3: generateToolTip

import org.jfree.data.xy.OHLCDataset; //导入方法依赖的package包/类
/**
 * Generates a tooltip text item for a particular item within a series.
 *
 * @param dataset  the dataset.
 * @param series  the series (zero-based index).
 * @param item  the item (zero-based index).
 *
 * @return The tooltip text.
 */
public String generateToolTip(XYDataset dataset, int series, int item) {

    String result = null;

    if (dataset instanceof OHLCDataset) {
        OHLCDataset d = (OHLCDataset) dataset;
        Number high = d.getHigh(series, item);
        Number low = d.getLow(series, item);
        Number open = d.getOpen(series, item);
        Number close = d.getClose(series, item);
        Number x = d.getX(series, item);

        result = d.getSeriesKey(series).toString();

        if (x != null) {
            Date date = new Date(x.longValue());
            result = result + "--> Date=" + this.dateFormatter.format(date);
            if (high != null) {
                result = result + " High=" 
                         + this.numberFormatter.format(high.doubleValue());
            }
            if (low != null) {
                result = result + " Low=" 
                         + this.numberFormatter.format(low.doubleValue());
            }
            if (open != null) {
                result = result + " Open=" 
                         + this.numberFormatter.format(open.doubleValue());
            }
            if (close != null) {
                result = result + " Close=" 
                         + this.numberFormatter.format(close.doubleValue());
            }
        }

    }

    return result;

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


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