Ejemplo n.º 1
0
        private CChartPanel CreateChart(string symbol, CandlePeriod p)
        {
            if (!chartsDic[symbol].ContainsKey(p))
            {
                chartsDic[symbol][p] = new CChartPanel(symbolsOn.Single(kv => kv.Key == symbol), (int)p);
                chartsDic[symbol][p].AfterDisplay       -= OnAfterDisplay;
                chartsDic[symbol][p].AfterDisplay       += OnAfterDisplay;
                chartsDic[symbol][p].EmbededInMultiChart = true;
                chartsDic[symbol][p].ParentCZoom         = toolStripTBZoom;
            }

            return(chartsDic[symbol][p]);
        }
Ejemplo n.º 2
0
        private TableLayoutPanel CreateChartsPanel(int cnt)
        {
            int rcnt = 1, ccnt = 1, chart_no = 0;

            if (cnt < 3)
            {
                ccnt = cnt;
            }
            else
            {
                rcnt = 2;
                ccnt = (int)((cnt + 1) / 2);
            }

            TableLayoutPanel cpanel = new TableLayoutPanel();

            cpanel.ColumnCount = ccnt;
            for (int i = 0; i < ccnt; i++)
            {
                cpanel.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, (float)100.0 / ccnt));
            }
            cpanel.RowCount = rcnt;
            for (int i = 0; i < rcnt; i++)
            {
                cpanel.RowStyles.Add(new RowStyle(SizeType.Percent, (float)100.0 / rcnt));
            }

            Dictionary <CandlePeriod, CChartPanel> dic = chartsDic[symbolOnDisplay];

            foreach (CandlePeriod p in periodDic.Keys)
            {
                if (periodDic[p])
                {
                    CChartPanel panel = dic[p];
                    cpanel.Controls.Add(panel, chart_no % ccnt, chart_no / ccnt);
                    panel.Dock = DockStyle.Fill;
                    chart_no++;
                }
            }

            if (chartsPanelFlag == 0)
            {
                busy_loading = false;
            }
            return(cpanel);
        }