Java Code Examples for org.jfree.data.xy.OHLCDataset#getClose()
The following examples show how to use
org.jfree.data.xy.OHLCDataset#getClose() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: TaChart.java From TAcharting with GNU Lesser General Public License v2.1 | 6 votes |
@Override public Paint getItemPaint(int row, int column) { //determine up or down candle XYDataset dataset = getPlot().getDataset(); OHLCDataset highLowData = (OHLCDataset) dataset; Number yOpen = highLowData.getOpen(row, column); Number yClose = highLowData.getClose(row, column); boolean isUpCandle = yClose.doubleValue() > yOpen.doubleValue(); //return the same color as that used to fill the candle if (isUpCandle) { return getUpPaint(); } else { return getDownPaint(); } }
Example 2
Source File: HighLowItemLabelGenerator.java From openstock with GNU General Public License v3.0 | 5 votes |
/** * 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(); }
Example 3
Source File: HighLowItemLabelGenerator.java From ccu-historian with GNU General Public License v3.0 | 5 votes |
/** * 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(); }
Example 4
Source File: HighLowItemLabelGenerator.java From SIMVA-SoS with Apache License 2.0 | 5 votes |
/** * 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(); }
Example 5
Source File: HighLowItemLabelGenerator.java From ECG-Viewer with GNU General Public License v2.0 | 5 votes |
/** * 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(); }
Example 6
Source File: HighLowItemLabelGenerator.java From buffer_bci with GNU General Public License v3.0 | 5 votes |
/** * 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(); }
Example 7
Source File: HighLowItemLabelGenerator.java From buffer_bci with GNU General Public License v3.0 | 5 votes |
/** * 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(); }
Example 8
Source File: HighLowItemLabelGenerator.java From astor with GNU General Public License v2.0 | 4 votes |
/** * 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; }
Example 9
Source File: HighLowItemLabelGenerator.java From astor with GNU General Public License v2.0 | 4 votes |
/** * 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; }
Example 10
Source File: HighLowItemLabelGenerator.java From opensim-gui with Apache License 2.0 | 4 votes |
/** * 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; }