コード例 #1
0
        /// <summary>
        /// Update the chart updated indicator color to green because the chart data has been updated.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        public void chartQuad_PostPaint(object sender, ChartPaintEventArgs e)
        {
            MyChart cht = sender as MyChart;

            if (isChartUpToDate[cht.I][cht.J])
            {
                if (isPlayerFolded_tsk != null && isPlayerFolded_tsk[PlayerIndexToDataDisplayFormIndex(cht.I)])
                {
                    dataUpdateStatusIndicator[cht.I][cht.J].BackColor = foldClrFaded;
                }
                else
                {
                    dataUpdateStatusIndicator[cht.I][cht.J].BackColor = foldClr;
                }
                isChartUpToDate[cht.I][cht.J] = false;
            }
        }
コード例 #2
0
        /// <summary>
        /// Initialize all the charts on the form
        /// </summary>
        /// <param name="pieChtsIn">pieChts</param>
        /// <param name="isChartUpToDateIn">isChartUpToDate</param>
        public void InitializeFormCharts(ref MyChart[][] pieChtsIn, ref bool[][] isChartUpToDateIn)
        {
            // One set of 4 charts for each of the 10 data display locations on the DataDisplayForm
            pieChtsIn = new MyChart[10][];
            pieChts_  = pieChtsIn;

            for (int i = 0; i < 10; i++)
            {
                pieChts_[i] = new MyChart[4];
            }

            // Create the 4 chart titles
            string[] chartTitles = new string[4];
            chartTitles[0] = "This Table -\nCurrent Num. Players";
            chartTitles[1] = "This Table -\nAny Num. Players";
            chartTitles[2] = "Any Table -\nCurrent Num. Players";
            chartTitles[3] = "Any Table -\nAny Num. Players";

            for (int i = 0; i < 10; i++)
            {
                for (int j = 0; j < 4; j++)
                {
                    pieChts_[i][j] = new MyChart();
                    ChartArea pieChartArea = new ChartArea();

                    pieChts_[i][j].Series.Add(chartTitles[j]);
                    pieChts_[i][j].Series[0].ChartType = SeriesChartType.Pie;
                    pieChts_[i][j].Series[0].Points.AddXY("25%", 2);
                    pieChts_[i][j].Series[0].Points.AddXY("25%", 2);
                    pieChts_[i][j].Series[0].Points.AddXY("25%", 2);
                    pieChts_[i][j].Series[0].Points.AddXY("25%", 2);
                    pieChts_[i][j].Series[0].Points[0].Color  = foldClr_;
                    pieChts_[i][j].Series[0].Points[1].Color  = checkClr_;
                    pieChts_[i][j].Series[0].Points[2].Color  = callClr_;
                    pieChts_[i][j].Series[0].Points[3].Color  = betClr_;
                    pieChts_[i][j].Series[0].Font             = chartLabelsFnt;
                    pieChts_[i][j].Series[0]["PieStartAngle"] = "270";
                    pieChts_[i][j].ChartAreas.Add(pieChartArea);
                    pieChts_[i][j].ChartAreas[0].BackColor = Color.Transparent;
                    pieChts_[i][j].Titles.Add(chartTitles[j]);
                    pieChts_[i][j].Titles[0].ForeColor     = Color.White;
                    pieChts_[i][j].Titles[0].Font          = chartTitlesFnt;
                    pieChts_[i][j].Titles[0].DockingOffset = 3;
                    pieChts_[i][j].BackColor = Color.Transparent;
                    pieChts_[i][j].I         = i;
                    pieChts_[i][j].J         = j;
                    dataPnl_.Controls.Add(pieChts_[i][j]);

                    pieChts_[i][j].PostPaint += frm.chartQuad_PostPaint;
                }
            }

            isChartUpToDateIn = new bool[10][];
            for (int i = 0; i < 10; i++)
            {
                isChartUpToDateIn[i] = new bool[4];
                for (int j = 0; j < 4; j++)
                {
                    isChartUpToDateIn[i][j] = false;
                }
            }
        }