void drawBlock(xGraphics g, stStatisticsBlock block) { int viewW = getW() - 4; uint alp = 0xa0ffffff; g.setColor(block.color & alp); g.fillRect((int)block.x, (int)block.y, (int)block.w, (int)block.h - 1); if (block.x + block.w < getW() - 4) { g.setColor(0xff202020); int x1 = (int)(block.x + block.w); g.fillRect(x1, (int)block.y, (int)(getW() - 4 - x1), (int)block.h - 1); } Font f = mContext.getFontSmallest(); g.setColor(C.COLOR_WHITE); int itemH = (int)f.GetHeight(); String s = String.Format("{0}; {1}; {2}", block.code, block.changed, block.inf); g.drawStringInRect(f, s, (int)block.x + 4, (int)block.y + 3, getW() / 2, (int)block.h, xGraphics.VCENTER); //g.drawStringInRect(f, block.inf, x, y + h / 2 - 8, w, itemH, xGraphics.HCENTER | xGraphics.TOP); //g.drawStringInRect(f, block.changed, x, y + h / 2 + 4, w, itemH, xGraphics.HCENTER | xGraphics.TOP); }
public override void render(xGraphics g) { if (isHiding()) { return; } if (getShare(3) == null) { return; } Share share = getShare(); int mX = 0; int mY = 0; if (detectShareCursorChanged()) { calcVolumeByPrice(); } int i = 0; vBlock v; double maxTotalVol = 0; // get max total volume for (i = 0; i < mBlocks.size(); i++) { v = (vBlock)mBlocks.elementAt(i); if (v.positiveVolume + v.negativeVolume > maxTotalVol) { maxTotalVol = v.positiveVolume + v.negativeVolume; } } if (maxTotalVol == 0) { return; } int w = getW() / 2; float rx = (float)(w / maxTotalVol); for (i = 0; i < mBlocks.size(); i++) { v = (vBlock)mBlocks.elementAt(i); int bottomY = priceToY(v.beginPrice); int topY = priceToY(v.endPrice); // green block g.setColor(0x4000ff00); int bw1 = (int)(v.positiveVolume * rx); g.fillRect(0, topY + 1, bw1, bottomY - topY - 2); g.setColor(0xa000ff00); //g.drawRect(0, topY + 1, bw1, bottomY - topY - 2); // red block g.setColor(0x40ff0000); int bw2 = (int)(v.negativeVolume * rx); g.fillRect(bw1, topY + 1, bw2, bottomY - topY - 2); g.setColor(0xa0ff0000); //g.drawRect(bw1, topY + 1, bw2, bottomY - topY - 2); } }
void drawMACDButton(xGraphics g) { Font f = mContext.getFontSmall(); int w = 60; int h = f.Height; int x = 2; int y = 2; if (mShouldDrawMACD) { g.setColor(0xc00080ff); } else { g.setColor(0xc0ff8000); } g.fillRect(x, y, w, h); g.setColor(C.COLOR_GRAY); g.drawRect(x, y, w, h); x += w / 2;// (w - g.getStringWidth(f, "MACD")) / 2; y += h / 2; g.setColor(C.COLOR_WHITE); g.drawString(f, "MACD", x, y, xGraphics.HCENTER | xGraphics.VCENTER); }
void drawControls(xGraphics g) { int x = 0; int y = 24; int fw = bw; int fh = bh; int sx = 0; x = getW() - 40 - fw; // delete g.setColor(C.COLOR_GRAY_LIGHT); Image img = mContext.getImage(C.IMG_DRAWER_BUTTONS); if (mButtonSel == 0) { sx = fw; } g.drawImage(img, x, y, fw, fh, sx, 0); // colors: RED/ORANGE/GREEN/PINK/WHITE x -= colors.Length * bw; sx += 2 * bw; for (int i = 0; i < colors.Length; i++) { g.setColor(colors[i]); g.fillRect(x, y, bw, bh); g.drawImage(img, x, y, fw, fh, sx, 0); x += bw; } }
override public void render(xGraphics g) { g.setColor(C.COLOR_BLACK); g.fillRect(0, 0, getW(), getH()); g.setColor(C.COLOR_GRAY_LIGHT); g.drawRect(0, 0, getW() - 1, getH() - 1); Share share = mShare; if (share == null) { return; } int x, y; x = 0; y = 0; int h = getH(); //=========================================== drawCandle(g, x, y, getW(), h); //================== }
void drawVolume(xGraphics g, int y, int h) { y += h; //================================================ int max_volume = 1; int vol; for (int i = 0; i < mCandleCnt; i++) { vol = mVolumes[i]; if (vol > max_volume) { max_volume = vol; } } float ratioY = (float)(h) / max_volume; int w = 1; g.setColor(0xff00ff00); int x = 0; // volume for (int i = 0; i < mCandleCnt; i++) { vol = mVolumes[i]; h = (int)(vol * ratioY); g.fillRect(mChartXYs[2 * i], y - h, w, h); } //Font fLabel = mContext.getFontText(); //g.setColor(C.COLOR_GRAY_LIGHT); //g.drawString(fLabel, mVolumeLabel, x + getW() - 3, 0, xGraphics.RIGHT | xGraphics.TOP); }
//============================================= protected void drawChartBar(xGraphics g, int[] _x, int[] _y, int barW, int[] barH, int cnt, int color) { g.setColor(color); for (int i = 0; i < cnt; i++) { g.fillRect(_x[i], _y[i], barW, barH[i]); } }
void drawText(xGraphics g, int x) { Font f = mContext.getFontSmall(); Font fLabel = mContext.getFontText(); // ma co phieu g.setColor(C.COLOR_WHITE); string s = "#" + mTrade.getCode(); g.drawString(mContext.getFontTextB(), s, x, 1); x += g.getStringWidth(mContext.getFontTextB(), s) + 5; // time if (mCandleCnt > 0) { g.setColor(C.COLOR_GRAY_DARK); g.fillRect(0, getH() - 12, getW(), 12); g.setColor(C.COLOR_WHITE); g.drawString(f, mTimeStart, 0 + 1, 0 + getH(), xGraphics.BOTTOM | xGraphics.LEFT); g.drawString(f, mTimeEnd, mChartXYs[2 * (mCandleCnt - 1)], 0 + getH() - 12, xGraphics.BOTTOM | xGraphics.LEFT); g.setColor(C.COLOR_WHITE); s = "KL: " + Utils.formatNumber(mTrade.getVolume(-1)); g.drawString(f, s, (getW() - Utils.getStringW(s, f)) / 2, getH(), xGraphics.BOTTOM); } g.setColor(C.GREY_LINE_COLOR); g.drawHorizontalLine(x, 0 + getH(), getW()); //=============cursor & some info======================== if (mCandleCnt > 0) { //x = getW() / 2; g.setColor(C.COLOR_GRAY_LIGHT); g.drawString(fLabel, mCurrentTrade, x, 0 + 1, xGraphics.LEFT);// xGraphics.HCENTER | xGraphics.TOP); g.setColor(C.COLOR_FADE_YELLOW0); g.drawVerticalLine(mChartXYs[2 * mCurrentTradeSel], 12, getH() - 26); //g.drawPoint(mChartXYs[2 * mCurrentTradeSel] - 2, mChartXYs[2 * mCurrentTradeSel + 1] - 4, 4); if (mChangedValue > 0) { g.setColor(C.COLOR_GREEN); } else if (mChangedValue == 0) { g.setColor(C.COLOR_YELLOW); } else { g.setColor(C.COLOR_RED); } g.drawString(fLabel, mChanged, mChartXYs[2 * mCurrentTradeSel], 26); } //===================================================== }
void test(xGraphics g) { g.setColor(C.COLOR_RED); g.drawLineDotHorizontal(10, 10, 100, 100); g.setColor(C.COLOR_MAGENTA); g.fillRect(30, 40, 15, 15); g.setColor(C.COLOR_GREEN); g.drawString(mContext.getFontText(), "This is a realtime chart", 100, 10, 0); short[] path = { 10, 20, 35, 20, 48, 30, 35, 35 }; g.setColor(C.COLOR_BLUE); g.fillShapes(path, 4); g.drawLines(path, 4); }
protected void renderCursor(xGraphics g) { if (!mShouldDrawCursor) { return; } Share share = getShare(); if (share == null) { return; } int sel = share.getCursor(); int x = candleToX(sel); g.setColor(C.COLOR_GRAY); g.drawLine(x, 0, x, getH()); // mouse title g.setColor(C.COLOR_FADE_YELLOW); g.drawLineDotHorizontal(0, mLastY, getW()); if (mMouseTitle != null && mLastY != 0 & mLastY != 0) { int y = mLastY; x = mLastX; if (y < 12) { y = mLastY + 12; x += 6; // stay away from the mouse } g.setColor(0xa0000000); int sw = Utils.getStringW(mMouseTitle, mContext.getFontSmall()); g.fillRect(x, y - 12, sw, mContext.getFontSmall().Height); g.setColor(C.COLOR_ORANGE); g.drawString(mContext.getFontSmall(), mMouseTitle, x, y - 12); } if (mShouldDrawTitle) { renderTitles(g, 2, 0); } }
void drawBlock(xGraphics g, stBubbleBlock block) { Rectangle rc = getBlockRect(block); int x = rc.X; int y = rc.Y; int w = rc.Width; int h = rc.Height; uint alp = 0xd0ffffff; g.setColor(block.color & alp); g.fillRect(x, y, w - 1, h - 1); Font f = mContext.getFontSmallest(); g.setColor(C.COLOR_BLACK); int itemH = (int)f.GetHeight(); if (h > 35) { g.drawStringInRect(f, block.code, x, y + h / 2 - 20, w, itemH, xGraphics.HCENTER | xGraphics.TOP); g.drawStringInRect(f, block.inf, x, y + h / 2 - 8, w, itemH, xGraphics.HCENTER | xGraphics.TOP); g.drawStringInRect(f, block.changed, x, y + h / 2 + 4, w, itemH, xGraphics.HCENTER | xGraphics.TOP); } else if (h > 20) { g.drawStringInRect(f, block.code, x, y + h / 2 - 12, w, itemH, xGraphics.HCENTER | xGraphics.TOP); g.drawStringInRect(f, block.inf, x, y + h / 2 - 2, w, itemH, xGraphics.HCENTER | xGraphics.TOP); } else { g.drawStringInRect(f, block.code, x, y, w, h, xGraphics.HCENTER | xGraphics.TOP); if (h > 18) { g.drawStringInRect(f, block.inf, x, y + 11, w, itemH, xGraphics.HCENTER | xGraphics.TOP); } } }
/* * override public void renderCursorCrossHair(xGraphics g) * { * g.setColor(C.COLOR_FADE_YELLOW0); * Share share = getShare(); * //g.drawVerticalLine(mMouseX, 0, getH()); * // vertical line * int sel = share.getCursor(); * int x = candleToX(sel); * g.drawLine(x, 0, x, getH()); * // horizon line * g.drawHorizontalLine(0, mMouseY, getW()); * * if (share != null && mMouseX != 0) * { * // info * StringBuilder sb = Utils.sb; * * float v = yToPrice(mMouseY); * sb.Length = 0; * * int c = (int)xToCandleIdx(mMouseX); * if (c < share.mBeginIdx || c > share.mEndIdx) * return; * int date = share.getDate(c); * // date * int sw = 0; * sb.AppendFormat("{0:D2}/{1:D2}/{2:D4}", * Utils.EXTRACT_DAY(date), * Utils.EXTRACT_MONTH(date), * Utils.EXTRACT_YEAR(date)); * * sw = Utils.getStringW(sb.ToString(), mContext.getFontSmall()); * int y = 0; * if (mOnMouseDown && !mSelecting) * y = mMouseY - 2*mContext.getFontSmall().Height - 3; * g.setColor(0xa0000000); * g.fillRect(mMouseX, y, sw, mContext.getFontSmall().Height); * g.setColor(C.COLOR_ORANGE); * g.drawString(mContext.getFontSmall(), sb.ToString(), mMouseX+2, y); * * sb.Length = 0; * sb.AppendFormat("close: {0:F1}", v); * g.setColor(0x80000000); * sw = Utils.getStringW(sb.ToString(), mContext.getFontSmall()); * x = getW() - 10 - sw; * int flag = xGraphics.LEFT; * if (mOnMouseDown && !mSelecting) * { * x = mMouseX; * if (x > getW() - 80) x = getW() - 80; * flag = xGraphics.LEFT; * } * g.fillRect(x, mMouseY - 15, sw, mContext.getFontSmall().Height); * g.setColor(C.COLOR_ORANGE); * g.drawString(mContext.getFontSmall(), sb.ToString(), x, mMouseY - 15, flag); * } * } */ override public void renderSelection(xGraphics g) { if (mSelecting && mSelectionBX >= 0 && mSelectionEX >= 0) { int min = mSelectionBX < mSelectionEX ? mSelectionBX : mSelectionEX; int max = mSelectionBX > mSelectionEX ? mSelectionBX : mSelectionEX; g.setColor(0x60803000); g.fillRect(min, 0, max - min, getH()); // info int bc = (int)xToCandleIdx(min); int ec = (int)xToCandleIdx(max); Share share = getShare(); if (share != null) { if (ec > share.mEndIdx) { ec = share.mEndIdx; } float bp = share.getClose(bc); int bd = share.getDate(bc); float ep = share.getClose(ec); int ed = share.getDate(ec); float delta = ep - bp; float percent = 0; if (bp != 0) { percent = delta * 100 / bp; } // 25/5 - 16/9 // price: +20.4 (10.1%) // vol: 45.32 tr StringBuilder sb = Utils.sb; sb.Length = 0; Font f = mContext.getFontSmall(); int x = mSelectionEX; int y = mMouseY - 50; if (x + 160 > getW()) { x = getW() - 160; } g.setColor(C.COLOR_ORANGE); // date sb.AppendFormat("ngày: {0:D2}/{1} - {2:D2}/{3} ({4})", Utils.EXTRACT_DAY(bd), Utils.EXTRACT_MONTH(bd), Utils.EXTRACT_DAY(ed), Utils.EXTRACT_MONTH(ed), ec - bc); g.drawString(f, sb.ToString(), x, y); sb.Length = 0; // price if (delta > 0) { sb.AppendFormat("price: +{0:F1} ({1:F1}%)", delta, percent); } else { sb.AppendFormat("price: {0:F1} ({1:F1}%)", delta, percent); } y += 15; g.drawString(f, sb.ToString(), x, y); // vol int totalVol = 0; for (int i = bc; i <= ec; i++) { totalVol += share.getVolume(i); } String s = Utils.formatNumber(totalVol); sb.Length = 0; sb.AppendFormat("vol: {0}", s); y += 15; g.drawString(f, sb.ToString(), x, y); } } }
void drawCandle(xGraphics g, int x, int y0, int w, int h) { Share share = mShare; int y = 0; Font f = mContext.getFontSmall(); uint color; stPriceboardState ps = mContext.mPriceboard.getPriceboard(share.getID()); if (ps == null) { return; } TradeHistory trade = mContext.getTradeHistory(share.getID()); float price = ps.getCurrentPrice(); float open = price;//ps.getRef(); // should be open - testing if (trade != null && trade.getTransactionCount() > 0) { open = trade.getPrice(0); } else { open = mContext.mPriceboard.getOpen(mShare.mID); } if (open != 0 && mContext.mPriceboard.getOpen(mShare.mID) == 0 && !share.isIndex()) { mContext.mPriceboard.setOpen(mShare.mID, (int)open); } float hi = ps.getMax(); float lo = ps.getMin(); float priceLen = hi - lo; float reference = ps.getRef(); float min = ps.getFloor() - (float)reference / 30; float max = ps.getCe() + (float)reference / 30; if (share.isIndex()) { price = trade.mClose / 10.0f; open = trade.mOpen / 10.0f; reference = trade.mPriceRef / 10.0f; hi = trade.mHighest / 10.0f; lo = trade.mLowest / 10.0f; min = reference - reference / 40; max = reference + reference / 40; if (min > lo) { min = lo; } if (max < hi) { max = hi; } priceLen = (int)(hi - lo); } if (price == 0) { return; } //if (min > ps.getMin() && ps.getMin() > 0) min = ps.getMin(); //if (max < ps.getMax()) max = ps.getMax(); float totalPrice = (max - min); //(10%); if (totalPrice < priceLen) { totalPrice = priceLen; } if (totalPrice == 0) { return; } float ry = (float)(h) / totalPrice; int totalH = (int)(ry * totalPrice); int bodyW = w / 3; StringBuilder sb = Utils.getSB(); //================frame============================= // line ref g.setColor(0x30ffff00); y = (int)(y0 + totalH - (reference - min) * ry); g.drawLineDotHorizontal(1, y, getW() - 2, y); g.setColor(0xa0ffff00); /* * if (mDrawRefLabel) * { * sb.AppendFormat("{0:F1}", (float)reference / 10); * g.drawString(f, sb.ToString(), 1, y - f.Height / 2, 0); * } */ // CE line if (!share.isIndex()) { g.setColor(0x30ff00ff); y = (int)(y0 + totalH - (ps.getCe() - min) * ry); g.drawLineDotHorizontal(1, y, getW() - 2, y); g.setColor(0xa0ff00ff); sb.Length = 0; sb.AppendFormat("{0:F1}", (float)(ps.getCe() / 10)); if (mDrawRefLabel) { g.drawString(f, sb.ToString(), 1, y, 0); } // FLOOR line g.setColor(0x3000FFFF); y = (int)(y0 + totalH - (ps.getFloor() - min) * ry); g.drawLineDotHorizontal(1, y, getW() - 2, y); g.setColor(0xa000FFFF); sb.Length = 0; sb.AppendFormat("{0:F1}", (float)(ps.getFloor() / 10)); if (mDrawRefLabel) { g.drawString(f, sb.ToString(), 1, y - f.Height, 0); } } //=================================================== color = price < open? C.COLOR_RED:C.COLOR_GREEN; if (price == open) { color = C.COLOR_WHITE; } if (price == 0) { return; } // draw shadow g.setColor(C.COLOR_WHITE); x = getW() / 2; if (share.isIndex() && hi > 0 && lo > 0) { int minY = (int)(y0 + totalH - (lo - min) * ry); int maxY = (int)(y0 + totalH - (hi - min) * ry); g.drawLine(x, maxY, x, minY); } int centerX = x + bodyW / 2; // candle's body int oY = (int)(y0 + totalH - (open - min) * ry); int cY = (int)(y0 + totalH - (price - min) * ry); y = oY < cY?oY:cY; int bodyH = Utils.ABS_INT(cY - oY); if (bodyH < 2) { bodyH = 2; } g.setColor(color); g.fillRect(x - bodyW / 2, y, bodyW, bodyH); /* * if (lo > 0 && lo != open && lo != price) * { * y = (int)(y0 + totalH - (lo - min)*ry); * g.setColor(C.COLOR_WHITE); * sb.Length = 0; * sb.AppendFormat("{0:F1}", (float)lo/10); * g.drawString(f, sb.ToString(), centerX - 44, y + 1, 0); * } * if (hi > 0 && hi != open && hi != price) * { * y = (int)(y0 + totalH - (hi - min)*ry); * g.setColor(C.COLOR_WHITE); * sb.Length = 0; * sb.AppendFormat("{0:F1}", (float)hi/10); * g.drawString(f, sb.ToString(), centerX - 44, y - f.Height, 0); * } * // 2 lines * g.setColor(C.COLOR_WHITE); * sb.Length = 0; * sb.AppendFormat("{0:F1}", (float)open/10); * * // open * if (oY < cY) * y = oY - f.Height; * else * y = oY + 1; * if (y < 0) y = 0; * if (y + f.Height > getH()) * y = getH() - f.Height; * g.drawString(f, sb.ToString(), x + bodyW / 2, y, 0); * // price * sb.Length = 0; * sb.AppendFormat("{0:F1}", (float)price/10); * if (cY < oY) * y = cY - f.Height; * else * y = cY + 1; * if (y < 0) y = 0; * if (y + f.Height > getH()) * y = getH() - f.Height; * g.drawString(f, sb.ToString(), x + bodyW / 2, y, 0); */ }
public override void render(xGraphics g) { g.setColor(0xff002000); g.fillRect(0, 0, getW(), getH()); if (_isProcessing) { g.setColor(C.COLOR_ORANGE); g.drawStringInRect(mContext.getFontSmallB(), "Đang xử lý", 0, 0, getW(), getH(), xGraphics.HCENTER | xGraphics.VCENTER); return; } g.setColor(C.COLOR_ORANGE); String sz = String.Format("MãCP (giá, thay đổi %): Tăng/Giảm index: {0:F2}/{1:F2}", totalIndexInc, totalIndexDec); g.drawString(mContext.getFontSmall(), sz, 8, 1, xGraphics.TOP); if (totalIndexInc == 0 && totalIndexDec == 0) { return; } double total = totalIndexInc + Math.Abs(totalIndexDec); float incPercent = (float)(totalIndexInc / total); float decPercent = (float)(Math.Abs(totalIndexDec) / total); if (incPercent < 0.25) { incPercent = 0.25f; decPercent = 1.0f - incPercent; } if (decPercent < 0.25) { decPercent = 0.25f; incPercent = 1.0f - decPercent; } float incW = (getW() - 4) * 0.5f; //incPercent; float decW = (getW() - 4) * 0.5f; //decPercent; int maxItems = 22; int incCnt = vChangeInc.size() > maxItems?maxItems:vChangeInc.size(); float itemH = (getH() - 20) / maxItems; int decCnt = vChangeDec.size() > maxItems?maxItems:vChangeDec.size(); int x0 = 1; int x1 = (int)(getW() - decW); float incBiggest = 0; float decBiggest = 0; ChangeIndexItem first = (ChangeIndexItem)vChangeInc.firstElement(); if (vChangeInc.size() > 0) { incBiggest = 1.1f * first.modifiedValue; } first = (ChangeIndexItem)vChangeDec.firstElement(); if (vChangeDec.size() > 0) { decBiggest = 1.1f * first.modifiedValue; } float maxBiggest = Math.Max(incBiggest, decBiggest); int titleH = 20; // increase for (int i = 0; i < incCnt; i++) { ChangeIndexItem item = (ChangeIndexItem)vChangeInc.elementAt(i); g.setColor(C.COLOR_GREEN_DARK); float y = titleH + i * itemH; float itemW = item.modifiedValue * incW / maxBiggest; g.fillRectF(x0, y, itemW, itemH - 1); g.setColor(C.COLOR_WHITE); stPriceboardState ps = mContext.mPriceboard.getPriceboard(item.shareID); sz = String.Format("{0}({1:F1}, {2:F1}%): {3:F3}", ps.code, item.price, item.modifiedPercent, item.modifiedValue); g.drawStringF(mContext.getFontSmall(), sz, x0 + 8, y + itemH / 2, xGraphics.VCENTER); item.x = x0; item.y = y; item.w = incW; item.h = itemH; } // decrease for (int i = 0; i < decCnt; i++) { ChangeIndexItem item = (ChangeIndexItem)vChangeDec.elementAt(i); g.setColor(C.COLOR_RED); float y = titleH + i * itemH; float itemW = item.modifiedValue * decW / maxBiggest; g.fillRectF(x1, y, itemW, itemH - 1); g.setColor(C.COLOR_WHITE); stPriceboardState ps = mContext.mPriceboard.getPriceboard(item.shareID); sz = String.Format("{0}({1:F1}, {2:F1%}): {3:F3}", ps.code, item.price, item.modifiedPercent, item.modifiedValue); g.drawStringF(mContext.getFontSmall(), sz, x1 + 8, y + itemH / 2, xGraphics.VCENTER); item.x = x1; item.y = y; item.w = decW; item.h = itemH; } if (currentSelected != null && currentSelected.selected) { g.setColor(C.COLOR_ORANGE); g.drawRectF(currentSelected.x, currentSelected.y, currentSelected.w, currentSelected.h); } }
public override void render(xGraphics g) { if (getID() < 0) { return; } int x = 0; int y = 2; int h = getH(); if (mCells.size() == 0) { return; } if (mIsSelected && getID() > 0) { g.setColor(C.COLOR_BUTTON_SEL); g.fillRect(0, 0, getW(), getH()); } int i; x = 0; for (i = 0; i < mCells.size(); i++) { stCell c = (stCell)mCells.elementAt(i); uint color = c.bgColor; int w = c.w; x = c.x; if (color != COLOR_NONE) { g.setColor(color); g.fillRect(x, 0, w, h); } } //---------text // printf("\n=========================================="); for (i = 0; i < mCells.size(); i++) { stCell c = (stCell)mCells.elementAt(i); if (i == mCandleColumeIdx && getID() != 0) { renderCandle(g, c); continue; } if (c.text2 == null) { g.setColor(c.textColor); if (c.text != null) { g.drawStringInRect(c.f, c.text, c.x, 0, c.w, h, xGraphics.HCENTER | xGraphics.VCENTER); } } else { g.setColor(c.textColor); g.drawStringInRect(c.f, c.text, c.x, (int)(h / 2 - c.f.GetHeight()) - 0, c.w, h / 2, xGraphics.HCENTER | xGraphics.VCENTER); g.setColor(c.textColor2); g.drawStringInRect(c.f, c.text2, c.x, h / 2 + 2, c.w, (int)(c.f.GetHeight()), xGraphics.HCENTER | xGraphics.VCENTER); } //Utils.trace("here 5:" + c.text + " x=" + c.x + " w=" + c.w + " h=" + h); } // grid g.setColor(0xff808080); for (i = 1; i < mCells.size(); i++) { stCell c = (stCell)mCells.elementAt(i); x = c.x; g.drawLine(x, y, x, y + h); } g.drawHorizontalLine(0, 0, getW()); // snapshot and volume String code = getCode(); if (code != null) { // volume stPriceboardState item = Context.getInstance().mPriceboard.getPriceboard(code); if (item != null) { renderSnapshot(3, item, g); } } }
override public void render(xGraphics g) { Utils.trace("=====render today candle"); if (mIsSelected) { g.setColor(C.COLOR_BLUE); g.fillRect(0, 0, getW(), getH()); g.setColor(C.COLOR_BLACK); g.fillRect(3, 3, getW() - 6, getH() - 6); } else { g.setColor(C.COLOR_BLACK); g.fillRect(0, 0, getW(), getH()); } g.setColor(C.COLOR_GRAY_LIGHT); g.drawRect(0, 0, getW() - 1, getH() - 1); Share share = mShare; if (share == null) { return; } int x, y; x = 0; y = 0; int h = getH(); if (mHasTitle) { Font ft = mContext.getFontTextB(); // title background if (mIsSelected) { g.setColor(C.COLOR_BLUE); } else { g.setColor(0xff204040); } //g.setColor(0xff004070); g.fillRect(1, 1, getW() - 2, 1 * ft.Height); // code g.setColor(C.COLOR_WHITE); g.drawString(ft, mShare.mCode, 1, 1); // point stPriceboardState ps = mContext.mPriceboard.getPriceboard(share.getID()); float price = ps.getCurrentPrice(); float change = price - ps.getRef(); StringBuilder sb = Utils.getSB(); if (change >= 0) { sb.AppendFormat("{0:F2} (+{1:F2})", (float)price, (float)change); } else { sb.AppendFormat("{0:F2} ({1:F2})", (float)price, (float)change); } x += g.getStringWidth(ft, mShare.mCode) + 4; uint color = mContext.valToColorF(price, ps.getCe(), ps.getRef(), ps.getFloor()); g.setColor(color); g.drawString(ft, sb.ToString(), x, 1); //=====vol g.setColor(C.COLOR_ORANGE); x = 1; ft = mContext.getFontSmall(); y = getH() - ft.Height; sb.Length = 0; if (ps.getTotalVolume() > 100000) { sb.AppendFormat("{0}K", (ps.getTotalVolume() / 1000)); } else if (ps.getTotalVolume() > 1000) { sb.AppendFormat("{0:F1}K", (float)(ps.getTotalVolume() / 1000)); } else { sb.AppendFormat("{0}", ps.getTotalVolume()); } g.drawString(ft, sb.ToString(), x, y); //========================= x = 0; h -= (int)ft.Height; y = ft.Height; } //=========================================== drawCandle(g, x, y, getW(), h); }
void drawCandle(xGraphics g, int x, int y0, int w, int h) { Share share = mShare; int y = 0; Font f = mContext.getFontSmall(); uint color; stPriceboardState ps = mContext.mPriceboard.getPriceboard(share.getID()); if (ps == null) { return; } TradeHistory trade = mContext.getTradeHistory(share.getID()); float price = ps.getCurrentPrice(); float open = mContext.mPriceboard.getOpen(ps.getID()); if (trade != null && trade.getTransactionCount() > 0) { open = trade.getPrice(0); } else { open = mContext.mPriceboard.getOpen(mShare.mID); } if (open != 0 && mContext.mPriceboard.getOpen(mShare.mID) == 0 && !share.isIndex()) { mContext.mPriceboard.setOpen(mShare.mID, (int)open); } float hi = ps.getMax(); float lo = ps.getMin(); // check hi/lo valid if ((hi == 0 || lo == 0)) { float[] hl = new float[2]; if (trade.getHiLo(hl)) { if (hi == 0) { hi = hl[0]; } if (lo == 0) { lo = hl[1]; } } } if (hi == 0) { hi = open > price ? open : price; } if (lo == 0) { lo = open < price ? open : price; } if (lo == 0) { lo = hi; } //--------------------------------------------- float priceLen = hi - lo; float reference = ps.getRef(); float min, max; if (share.isIndex()) { stPriceboardStateIndex pi = mContext.mPriceboard.getPriceboardIndexOfMarket(mShare.getMarketID()); price = pi.current_point; min = lo - price / 40; max = hi + price / 40; } else { min = ps.getFloor() - reference / 30; max = ps.getCe() + reference / 30; } if (price == 0) { return; } //if (min > ps.getMin() && ps.getMin() > 0) min = ps.getMin(); //if (max < ps.getMax()) max = ps.getMax(); float totalPrice = (max - min); //(10%); if (totalPrice < priceLen) { totalPrice = priceLen; } if (totalPrice == 0) { return; } float ry = (float)(h) / totalPrice; int totalH = (int)(ry * totalPrice); int bodyW = w / 3; StringBuilder sb = Utils.getSB(); //================frame============================= // line ref g.setColor(0x30ffff00); y = (int)(y0 + totalH - (reference - min) * ry); g.drawLineDotHorizontal(1, y, getW() - 2, y); g.setColor(0xa0ffff00); if (mDrawRefLabel) { sb.AppendFormat("{0:F2}", reference); g.drawString(f, sb.ToString(), 1, y - f.Height / 2, 0); } // CE line if (!share.isIndex()) { g.setColor(0x30ff00ff); y = (int)(y0 + totalH - (ps.getCe() - min) * ry); g.drawLineDotHorizontal(1, y, getW() - 2, y); g.setColor(0xa0ff00ff); sb.Length = 0; sb.AppendFormat("{0:F2}", ps.getCe()); if (mDrawRefLabel) { g.drawString(f, sb.ToString(), 1, y, 0); } // FLOOR line g.setColor(0x3000FFFF); y = (int)(y0 + totalH - (ps.getFloor() - min) * ry); g.drawLineDotHorizontal(1, y, getW() - 2, y); g.setColor(0xa000FFFF); sb.Length = 0; sb.AppendFormat("{0:F2}", ps.getFloor()); if (mDrawRefLabel) { g.drawString(f, sb.ToString(), 1, y - f.Height, 0); } } //=================================================== color = price < open? C.COLOR_RED:C.COLOR_GREEN; if (price == open) { color = C.COLOR_WHITE; } if (price == 0) { return; } // draw shadow g.setColor(C.COLOR_WHITE); x = getW() / 2; if (hi > 0 && lo > 0) { int minY = (int)(y0 + totalH - (lo - min) * ry); int maxY = (int)(y0 + totalH - (hi - min) * ry); g.drawLine(x, maxY, x, minY); } int centerX = x; // candle's body int oY = (int)(y0 + totalH - (open - min) * ry); int cY = (int)(y0 + totalH - (price - min) * ry); y = oY < cY?oY:cY; int bodyH = Utils.ABS_INT(cY - oY); if (bodyH < 2) { bodyH = 2; } g.setColor(color); g.fillRect(x - bodyW / 2, y, bodyW, bodyH); if (lo > 0 && lo != open && lo != price) { y = (int)(y0 + totalH - (lo - min) * ry); g.setColor(C.COLOR_YELLOW); sb.Length = 0; sb.AppendFormat("{0:F2}", lo); g.drawString(f, sb.ToString(), centerX - 10, y + 1, 0); } if (hi > 0 && hi != open && hi != price) { y = (int)(y0 + totalH - (hi - min) * ry); g.setColor(C.COLOR_YELLOW); sb.Length = 0; sb.AppendFormat("{0:F2}", hi); g.drawString(f, sb.ToString(), centerX - 10, y - f.Height, 0); } // 2 lines g.setColor(C.COLOR_WHITE); sb.Length = 0; sb.AppendFormat("{0:F2}", open); // open if (oY < cY) { y = oY - f.Height; } else { y = oY + 1; } if (y < 0) { y = 0; } if (y + f.Height > getH()) { y = getH() - f.Height; } g.drawString(f, sb.ToString(), x + bodyW / 2, y, 0); // price sb.Length = 0; sb.AppendFormat("{0:F2}", price); if (cY < oY) { y = cY - f.Height; } else { y = cY + 1; } if (y < 0) { y = 0; } if (y + f.Height > getH()) { y = getH() - f.Height; } g.drawString(f, sb.ToString(), x + bodyW / 2, y, 0); }
public override void render(xGraphics g) { if (isHiding()) { return; } if (getShare(3) == null) { return; } if (detectShareCursorChanged()) { recalcMACD(); } if (mChartLineLength == 0) { return; } if (mShouldDrawGrid) { drawGrid(g); } //mOY = getH() / 2; g.setColor(C.COLOR_FADE_YELLOW); g.drawLine(0, mOY, getW() - 34, mOY); g.setColor(C.COLOR_FADE_YELLOW0); g.drawString(mFont, "0", getW() - 8, mOY, xGraphics.VCENTER | xGraphics.RIGHT); int hisW = (int)(((float)getDrawingW() / mChartLineLength) * 2.0f / 3); for (int i = 0; i < mChartLineLength; i++) { if (mHistogramH[i] > 0) { g.setColor(0xffff0000); } else { g.setColor(0xff00ff00); } g.fillRect(mHistogramXY[2 * i], mHistogramXY[2 * i + 1], hisW, mHistogramH[i]); } g.setColor(C.COLOR_BLUE_LIGHT); g.drawLines(mLineMACD, mChartLineLength, 2.0f); g.setColor(0xffff0000); g.drawLines(mLineSignal9, mChartLineLength, 1.0f); StringBuilder sb = Utils.sb; //========================= sb.Length = 0; float v = (mOY - mLastY) / ry; sb.AppendFormat("{0:F2}", v); mMouseTitle = sb.ToString(); renderCursor(g); // bottom border g.setColor(0xffa0a0a0); g.drawHorizontalLine(0, 0, getW()); renderDrawer(g); }
override public void render(xGraphics g) { g.setColor(C.COLOR_BLACK); g.fillRect(0, 0, getW(), getH()); g.setColor(C.COLOR_GRAY_LIGHT); g.drawRect(0, 0, getW(), getH()); Share share = mShare; if (share == null) { return; } if (share.mCClose == null && share.getID() > 0) { share.loadShareFromCommonData(true); mContext.setCurrentShare(share.getID()); } else { //return; } if (share.mCClose == null || share.getID() == 0) { return; } Font f = mContext.getFontText(); int x, y; x = 0; y = 0; stPriceboardState ps = mContext.mPriceboard.getPriceboard(share.getID()); if (ps == null) { return; } StringBuilder sb = Utils.getSB(); f = mContext.getBigFont(); // current price float price = ps.getCurrentPrice(); uint color = mContext.valToColorF(price, ps.getCe(), ps.getRef(), ps.getFloor()); if (price == 0) { price = ps.getRef(); } // current price sb.AppendFormat("{0:F2}", price); //l.setFont(f); x = 10; g.setColor(color); g.drawString(f, sb.ToString(), x, y); y += f.Height; // change float change = price - ps.getRef(); float changePercent = 0; if (ps.getRef() > 0) { changePercent = (change * 100) / ps.getRef(); } sb.Length = 0; sb.AppendFormat("{0:F1} ({1:F2}%)", (float)(change), changePercent); f = mContext.getFontText(); g.setColor(color); g.drawString(f, sb.ToString(), x, y); // --------------------vol x = 4; y += f.Height + 10; int vol = ps.getTotalVolume(); int vol10 = share.getAveVolumeInDays(10); int barMax = getW() - 20; float bar0 = 0; float bar10 = 0; if (vol < vol10) { bar0 = ((float)vol / vol10) * barMax; bar10 = barMax; } else if (vol != 0) { bar0 = barMax; bar10 = ((float)vol10 / vol) * barMax; } if (bar0 < 1) { bar0 = 1; } if (bar10 < 1) { bar10 = 1; } string tmp = Utils.formatNumber(vol); sb.Length = 0; sb.AppendFormat("Vol: {0}", tmp); g.setColor(C.COLOR_WHITE); g.drawString(f, sb.ToString(), x, y); y += (int)f.Height; g.setColor(C.COLOR_ORANGE); g.fillRect(x, y, (int)bar0, 10); y += 20; // --------------------vol10 tmp = Utils.formatNumber(vol10); sb.Length = 0; sb.AppendFormat("TB 10phiên: {0}", tmp); g.setColor(C.COLOR_WHITE); g.drawString(f, sb.ToString(), x, y); y += f.Height; g.setColor(C.COLOR_ORANGE); g.fillRect(x, y, (int)bar10, 10); }
//====================================== public void render(xGraphics g) { if (!mShow) { return; } Share share = getShare(3); if (share == null) { return; } int b = share.mBeginIdx; int e = share.mEndIdx; int selSquareSide = 0; uint selSquareColor = 0xff00ff00; for (int i = 0; i < mTrends.size(); i++) { stTrendLine t = (stTrendLine)mTrends.elementAt(i); g.setColor(C.COLOR_ORANGE); // grey if (t.type != DRAW_TREND) { g.setColor(C.COLOR_FIBO_DOT_LINE2); } if (t.type == DRAW_TREND) { g.setColor(t.color); } //if (mSelectedTrend == t) //{ //g.setColor(C.COLOR_RED); //} if (t != mSelectedTrend && (t.type == DRAW_RECTANGLE || t.type == DRAW_TRIANGLE || t.type == DRAW_ANDREWS_PITCHFORK || t.type == DRAW_ABC || t.type == DRAW_OVAL)) { } else { g.setColor(t.color); g.drawLineDot(t.x[0], t.y[0], t.x[1], t.y[1], t.thickness); } if (t.type == DRAW_FIBO_PROJECTION) { g.drawLine(t.x[1], t.y[1], t.x[2], t.y[2]); } int pointRadiu = 2; if (mSelectedTrend == t) { pointRadiu = 4; selSquareSide = 60; } // draw the point if (t.x[0] >= mX) { g.setColor(0xff00ff00); g.fillRect(t.x[0] - pointRadiu, t.y[0] - pointRadiu, 2 * pointRadiu, 2 * pointRadiu); } if (t.x[1] < mX + getW()) { g.setColor(0xffff5522); g.fillRect(t.x[1] - pointRadiu, t.y[1] - pointRadiu, 2 * pointRadiu, 2 * pointRadiu); } if (t.type == DRAW_FIBO_PROJECTION || t.type == DRAW_TRIANGLE || t.type == DRAW_ANDREWS_PITCHFORK) { if (t.x[2] < mX + getW()) { g.setColor(0xffffff00); g.fillRect(t.x[2] - pointRadiu, t.y[2] - pointRadiu, 2 * pointRadiu, 2 * pointRadiu); } } // draw the dragging point if (mSelectedTrend == t) { g.setColor(C.COLOR_MAGENTA); int r = 4; int cx = (t.x[0] + t.x[1]) / 2; int cy = (t.y[0] + t.y[1]) / 2; g.drawRect(cx - 2, cy - 2, 4, 4); g.drawRect(cx - 5, cy - 5, 10, 10); } // draw fibo lines if (t.type == DRAW_TREND) { drawTrend(g, t); } if (t.type == DRAW_TREND_ARROW) { drawTrendArrow(g, t); } else if (t.type == DRAW_FIBO_RETRACEMENT) { drawFiboRetracementLines(g, t); } else if (t.type == DRAW_FIBO_PROJECTION) { drawFiboProjection(g, t); } else if (t.type == DRAW_FIBO_TIME) { drawFiboTime(g, t); } else if (t.type == DRAW_FIBO_FAN) { drawFiboFan(g, t); } else if (t.type == DRAW_FIBO_ARC) { drawFiboArc(g, t); } else if (t.type == DRAW_RECTANGLE) { drawRectangle(g, t); } else if (t.type == DRAW_TRIANGLE) { drawTriangle(g, t); } else if (t.type == DRAW_OVAL) { drawOval(g, t); } else if (t.type == DRAW_ABC) { drawAbc(g, t); } else if (t.type == DRAW_ANDREWS_PITCHFORK) { drawAndrewsPitchFork(g, t); } if (mSelectedTrend != null) { drawControls(g); } } //==================draw finger square if (mSelectedTrend != null && mSelVertex != -1) { int x = mSelectedTrend.x[0]; int y = mSelectedTrend.y[0]; if (mSelVertex == 1) { x = mSelectedTrend.x[1]; y = mSelectedTrend.y[1]; } else if (mSelVertex == 2) { x = mSelectedTrend.x[2]; y = mSelectedTrend.y[2]; } selSquareSide = 20; g.setColor(C.COLOR_YELLOW); //g.drawRect(x - selSquareSide / 2, y - selSquareSide / 2, selSquareSide, selSquareSide); //x += selSquareSide / 4; //y += selSquareSide / 4; //g.drawRect(x, y, selSquareSide / 2, selSquareSide / 2); if (mSelectedTrend.type != DRAW_FIBO_TIME && mFont != null) { //sprintf(sz, "%d", mSelVertex+1); //g.setColor(C.COLOR_WHITE); //g.drawString(mFont, "" + (mSelVertex + 1), x + 3, y - (int)mFont.GetHeight(), 0); } } }
override public void render(xGraphics g) { if (getID() < 0) { return; } int x = 0; int y = 2; int h = getH(); if (mCells.size() == 0) { return; } if (mIsSelected && getID() > 0) { g.setColor(C.COLOR_BUTTON_SEL); g.fillRect(0, 0, getW(), getH()); } int i; x = 0; for (i = 0; i < mCells.size(); i++) { stCell c = (stCell)mCells.elementAt(i); uint color = c.bgColor; int w = c.w; x = c.x; if (color != COLOR_NONE) { g.setColor(color); g.fillRect(x, 0, w, h); } } //---------text // printf("\n=========================================="); for (i = 0; i < mCells.size(); i++) { stCell c = (stCell)mCells.elementAt(i); if (i == mCandleColumeIdx && getID() != 0) { renderCandle(g, c); continue; } if (c.text2 == null) { g.setColor(c.textColor); if (c.text != null) { g.drawStringInRect(c.f, c.text, c.x, 0, c.w, h, xGraphics.HCENTER | xGraphics.VCENTER); } } else if (getH() < 36) { g.setColor(c.textColor); g.drawStringInRect(c.f, c.text, c.x, (int)(h / 2 - c.f.GetHeight()) + 3, c.w, h / 2, xGraphics.HCENTER | xGraphics.VCENTER); g.setColor(c.textColor2); g.drawStringInRect(c.f, c.text2, c.x, h / 2 + 1, c.w, (int)(c.f.GetHeight()), xGraphics.HCENTER | xGraphics.VCENTER); } else { g.setColor(c.textColor); g.drawStringInRect(c.f, c.text, c.x, (int)(h / 2 - c.f.GetHeight()) - 0, c.w, h / 2, xGraphics.HCENTER | xGraphics.VCENTER); g.setColor(c.textColor2); g.drawStringInRect(c.f, c.text2, c.x, h / 2 + 2, c.w, (int)(c.f.GetHeight()), xGraphics.HCENTER | xGraphics.VCENTER); } //Utils.trace("here 5:" + c.text + " x=" + c.x + " w=" + c.w + " h=" + h); } // grid g.setColor(0xff808080); for (i = 1; i < mCells.size(); i++) { stCell c = (stCell)mCells.elementAt(i); x = c.x; g.drawLine(x, y, x, y + h); } g.drawHorizontalLine(0, 0, getW()); /* * // history chart button * if (getID() > 0) * { * g.setColor(C.COLOR_ORANGE); * int tmp = 6; * y = getH() / 2; * x = getW() - tmp - 4; * g.drawLine(x, y - tmp, x + tmp, y); * g.drawLine(x, y + tmp, x + tmp, y); * } */ // render snapshot if (mVolumeColumn >= 0) { stPriceboardState item = getPriceboard(); renderSnapshot(11, item, g); } }
protected void renderCandle(xGraphics g, stCell c) { int x, y; x = c.x; y = 0; uint color; object o = getUserData(); String code; if (o is String) { code = (String)o; } else { stGainloss gainloss = (stGainloss)o; code = gainloss.code; } if (code == null) { return; } stPriceboardState ps = Context.getInstance().mPriceboard.getPriceboard(code); if (ps == null) { return; } Context ctx = Context.getInstance(); float price = ps.getCurrentPrice(); float open = ctx.mPriceboard.getOpen(ps.getID()); if (open == 0) { open = price; } float hi = ps.getMax(); float lo = ps.getMin(); // check hi/lo valid if ((hi == 0 || lo == 0)) { TradeHistory trade = Context.getInstance().getTradeHistory(ps.getID()); float[] hl = new float[2]; if (trade != null && trade.getHiLo(hl)) { if (hi == 0) { hi = hl[0]; } if (lo == 0) { lo = hl[1]; } } } if (hi == lo) { hi = price; } if (hi == 0) { hi = open > price ? open : price; } if (lo == 0) { lo = open < price ? open : price; } if (lo == 0) { lo = hi; } //--------------------------------------------- float priceLen = (float)(hi - lo); int y0 = 0; float min = ps.getRef() - (ps.getRef() / 13); // +-7% (7*13==100) float max = ps.getRef() + (ps.getRef() / 13); if (ps.getMarketID() == 1) { min = ps.getRef() - (ps.getRef() / 19); // +-5% max = ps.getRef() + (ps.getRef() / 19); } if (min > lo && lo > 0) { min = (float)lo; } if (max < hi) { max = (float)hi; } float totalPrice = (max - min); //(10%); if (totalPrice < priceLen) { totalPrice = priceLen; } if (totalPrice == 0) { return; } float ry = (float)(getH() - 2 * y0) / totalPrice; int totalH = (int)(ry * totalPrice); int bodyW = c.w / 2; //================frame============================= // line _ref g.setColor(0x70ffff00); y = (int)(y0 + totalH - (ps.getRef() - min) * ry); g.drawLineDotHorizontal(c.x + 1, y, c.w - 2); //=================================================== if (price == 0) { return; // khong co giao dich } color = price < open ? C.COLOR_RED : C.COLOR_GREEN; if (price == open) { color = C.COLOR_WHITE; } // draw shadow g.setColor(C.COLOR_WHITE); x = c.x + c.w / 2; if (lo > 0 && hi > 0) { int minY = (int)(y0 + totalH - (lo - min) * ry); int maxY = (int)(y0 + totalH - (hi - min) * ry); g.drawLine(x, maxY, x, minY); } int centerX = x + bodyW / 2; // candle's body int oY = (int)(y0 + totalH - (open - min) * ry); int cY = (int)(y0 + totalH - (price - min) * ry); y = oY < cY ? oY : cY; int bodyH = Utils.ABS_INT(cY - oY); if (bodyH < 2) { bodyH = 2; } g.setColor(color); g.fillRect(x - bodyW / 2, y, bodyW, bodyH); }
override public void render(xGraphics g) { g.setColor(C.COLOR_BLACK); g.clear(); // title xVector v = getMoneyVolumeArray(); if (v == null || v.size() == 0) { return; } int biggest = 0; int i = 0; for (i = 0; i < v.size(); i++) { MoneyVol mv = (MoneyVol)v.elementAt(i); if (mv.volume > biggest) { biggest = mv.volume; } } float rx; StringBuilder sb = Utils.sb; uint color; int itemH = (getH() - 18) / v.size() - 4; int y = 4; int x = 60; stPriceboardState ps = mContext.mPriceboard.getPriceboard(mShareID); if (ps == null) { return; } Font f = mContext.getFontSmall(); int x1 = g.getStringWidth(f, "444.44") + 2; int w0 = getW() - x1; string s; g.setColor(C.COLOR_GRAY_DARK); g.fillRect(0, 0, x1, 14); g.setColor(C.COLOR_WHITE); g.drawString(f, "Giá", 2, 0); g.setColor(C.COLOR_GRAY_DARK); g.fillRect(x1 + 2, 0, getW() - x1 - 5, 14); g.setColor(C.COLOR_WHITE); g.drawString(f, "Khối lượng", x1 + 4, 0); y = 18; for (i = 0; i < v.size(); i++) { MoneyVol mv = (MoneyVol)v.elementAt(i); sb.Length = 0; sb.AppendFormat("{0:F2}", (float)mv.price); // gia g.setColor(C.COLOR_GRAY_DARK); g.fillRect(0, y, x1, itemH); g.setColor(0xffffffff); g.drawString(f, sb.ToString(), 2, y); if (x1 == 0) { x1 = g.getStringWidth(f, sb.ToString()); } // column color = mContext.valToColorF(mv.price, ps.getCe(), ps.getRef(), ps.getFloor()); g.setColor(color); float w = ((float)mv.volume / biggest) * (w0 - 10); g.fillRect(2 + x1, y, (int)w, itemH); // volume s = Utils.formatNumber(mv.volume); sb.Length = 0; sb.AppendFormat("kl={0:}", s); s = sb.ToString(); int w2 = g.getStringWidth(f, s) + 2; g.setColor(C.COLOR_GRAY_DARK); g.fillRect(4 + x1, y, w2, 14); g.setColor(C.COLOR_ORANGE); g.drawString(f, s, 5 + x1, y); y += itemH + 3; } }