Warning: session_start(): open(/var/lib/php/sessions/sess_olbkcmp2l6rl3u1ps2d305qq0q, O_RDWR) failed: No space left on device (28) in /var/www/tb-usercake/models/config.php on line 51
Warning: session_start(): Failed to read session data: files (path: /var/lib/php/sessions) in /var/www/tb-usercake/models/config.php on line 51
sclass TickerGraphPainter extends AbstractTickerPainter is IToolTipMaker, MakesBufferedImage {
settable TickerSequence ticker;
Color shortColor = java.awt.Color.blue;
Color longColor = java.awt.Color.yellow;
public void drawOn(Graphics2D g) {
if (verticalRange == null)
verticalRange(verticalRangeForTicker(ticker));
if (horizontalRange == null)
horizontalRange(horizontalRangeForTicker(ticker));
drawPercentLines(g);
drawAdditionalObjects(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);
}
drawPositions(g);
}
public BufferedImage render() {
img = super.render();
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 spaceCombine(
ticker.market,
"Price=" + formatDouble3X(price),
"at",
formatLocalDateWithSeconds(lround(time)));
}
}