ChartBase createSubChart(int chartID) { ChartBase c = null; Font f = Context.getInstance().getFontSmall(); if (chartID == ChartBase.CHART_THUYPS) { c = new ChartLine(f); c.setChartType(ChartBase.CHART_THUYPS); c.mShouldDrawCursor = true; } if (chartID == ChartBase.CHART_TRIX) { c = new ChartLine(f); c.setChartType(ChartBase.CHART_TRIX); c.mShouldDrawCursor = true; } if (chartID == ChartBase.CHART_OBV) { c = new ChartOBV(f); c.mShouldDrawCursor = true; } if (chartID == ChartBase.CHART_MACD) { c = new ChartMACD(f); c.mShouldDrawCursor = true; } if (chartID == ChartBase.CHART_MCDX) { c = new ChartMCDX(f); c.mShouldDrawCursor = true; } if (chartID == ChartBase.CHART_MFI) { c = new ChartLine(f); c.setChartType(ChartLine.CHART_MFI); // ChartLine.CHART_THUYPS);// c.mShouldDrawCursor = true; } if (chartID == ChartBase.CHART_RSI) { c = new ChartLine(f); c.setChartType(ChartLine.CHART_RSI); c.mShouldDrawCursor = true; } if (chartID == ChartBase.CHART_ADX) { c = new ChartADX(f); c.mShouldDrawCursor = true; } if (chartID == ChartBase.CHART_STOCHASTIC_FAST) { c = new ChartStochastic(f, true); c.mShouldDrawCursor = true; } if (chartID == ChartBase.CHART_STOCHASTIC_SLOW) { c = new ChartStochastic(f, false); c.mShouldDrawCursor = true; } if (chartID == ChartBase.CHART_ADL) { c = new ChartLine(f); c.setChartType(ChartBase.CHART_ADL); c.mShouldDrawCursor = true; } if (chartID == ChartBase.CHART_CHAIKIN) { c = new ChartLine(f); c.setChartType(ChartBase.CHART_CHAIKIN); c.mShouldDrawCursor = true; } if (chartID == ChartBase.CHART_ROC) { c = new ChartLine(f); c.setChartType(ChartBase.CHART_ROC); c.mShouldDrawCursor = true; } if (chartID == ChartBase.CHART_STOCHRSI) { c = new ChartStochRSI(f); c.setChartType(ChartBase.CHART_STOCHRSI); c.mShouldDrawCursor = true; } if (chartID == ChartBase.CHART_WILLIAMR) { c = new ChartWilliamR(f); c.mShouldDrawCursor = true; } if (chartID == ChartBase.CHART_NVI) { c = new ChartLine(f); c.setChartType(ChartBase.CHART_NVI); c.mShouldDrawCursor = true; } if (chartID == ChartBase.CHART_PVI) { c = new ChartLine(f); c.setChartType(ChartBase.CHART_PVI); c.mShouldDrawCursor = true; } else if (chartID == ChartBase.CHART_PVT) { c = new ChartLine(f); c.setChartType(ChartBase.CHART_PVT); c.mShouldDrawCursor = true; } else if (chartID == ChartBase.CHART_CCI) { c = new ChartLine(f); c.setChartType(ChartBase.CHART_CCI); c.mShouldDrawCursor = true; } else if (chartID == ChartBase.CHART_MASSINDEX) { c = new ChartLine(f); c.setChartType(ChartBase.CHART_MASSINDEX); c.mShouldDrawCursor = true; } else if (chartID == ChartBase.CHART_AROON) { c = new ChartAroon(f, ChartBase.CHART_AROON); c.setChartType(ChartBase.CHART_AROON); c.mShouldDrawCursor = true; } else if (chartID == ChartBase.CHART_AROON_OSCILLATOR) { c = new ChartAroon(f, ChartBase.CHART_AROON_OSCILLATOR); c.setChartType(ChartBase.CHART_AROON_OSCILLATOR); c.mShouldDrawCursor = true; } else if (chartID == ChartBase.CHART_CFM) { c = new ChartCFM(f); c.setChartType(ChartBase.CHART_CFM); c.mShouldDrawCursor = true; } else if (chartID == ChartBase.CHART_ATR) { c = new ChartLine(f); c.setChartType(ChartBase.CHART_ATR); c.mShouldDrawCursor = true; } else if (chartID == ChartBase.CHART_CRS_RATIO) { c = new ChartComparativeRS(chartID, f); ((ChartComparativeRS)c).setBaseSymbol("^VNINDEX", 5, 20); c.mShouldDrawCursor = true; } else if (chartID == ChartBase.CHART_COMPARING_SECOND_SHARE) { c = new ChartMasterSimple(f); c.setChartType(chartID); c.mShouldDrawCursor = true; ((ChartMasterSimple)c).setShareCode("^VNINDEX"); //((ChartLine)c).compareToShare("^VNINDEX"); } else if (chartID == ChartBase.CHART_CRS_PERCENT) { c = new ChartComparativeRS(chartID, f); ((ChartComparativeRS)c).setBaseSymbol("^VNINDEX", 5, 20); c.mShouldDrawCursor = true; } if (c == null) { c = new ChartVolume(f); c.setListener(this); c.mShouldDrawCursor = true; } c.setHasDrawer(true); c.setShare(mShare); c.setRefChart(mChartMaster); return(c); }