sclass TickerGraphPainter extends AbstractTickerPainter is IToolTipMaker { settable TickerSequence ticker; Color shortColor = java.awt.Color.blue; Color longColor = java.awt.Color.yellow; BufferedImage render() { verticalRange(doubleRange(ticker.minPrice(), ticker.maxPrice())); var timeRange = ticker.timeRange(); horizontalRange(doubleRange(timeRange.startTime().unixDate(), timeRange.endTime().unixDate())); // Make black image var img = blackImage(w, h); var g = img.createGraphics(); drawPercentLines(g); // Draw ticker graph var xRange = roundToIntRange(xRange()); for (int x = xRange.start; x < xRange.end; x++) { int idx1 = ticker.indexOfTimestamp(xFromScreen(x)); int idx2 = ticker.indexOfTimestamp(xFromScreen(x+1)); var seq = ticker.subSequence(idx1, idx2+1); int y1 = iround(yToScreen(seq.maxPrice())); int y2 = iround(yToScreen(seq.minPrice())); drawLine(g, x, y1, x, y2, Color.white); } var img2 = cloneBufferedImageWithMeta(img); metaSet(img2, IToolTipMaker, this); ret img2; } public S getToolTip(Pt p) { double time = xFromScreen(p.x); double price = ticker.priceAtTimestamp(time); ret formatLocalDateWithSeconds(time) + ": " + formatDouble3X(price); } }