예제 #1
0
        public void refresh_dig_data()
        {
            if (runchart_is_drawing)
            {
                return;
            }

            runchart_is_drawing = true;
            string nameid = comb_name_select_r.EditValue.ToString();

            //-------------------------------------------
            BindingList <NumCensus> list_census_1 = new BindingList <NumCensus>();

            if (nameid == "热球")
            {
                get_hot_red_census(index_begin, index_end, list_census_1);
            }
            else
            {
                get_item_census(index_begin, index_end, LottoryItem.ItemCnId(comb_name_select_r.Text), list_census_1);
            }


            //平均值
            float sum   = 0;
            float count = 0;
            float aver  = 0;

            foreach (NumCensus item in list_census_1)
            {
                count += item.COUNT;
                sum   += item.NUM * item.COUNT;
            }
            aver = sum / count;
            label_average.Text = "平均值: " + aver.ToString("F2");

            //----------------------------------------------
            chart_dig_one.SeriesSerializable[0].DataSource          = list_census_1;
            chart_dig_one.SeriesSerializable[0].Name                = comb_name_select_r.Text;
            chart_dig_one.SeriesSerializable[0].ArgumentDataMember  = "NUM";
            chart_dig_one.SeriesSerializable[0].ValueDataMembers[0] = "COUNT";

            runchart_is_drawing = false;
        }
예제 #2
0
        public void refresh_runchart_data()
        {
            if (runchart_is_drawing)
            {
                return;
            }

            runchart_is_drawing = true;
            string nameid = comb_name_select_r.EditValue.ToString();

            if (nameid == "热球")
            {
                runchart_is_drawing = false;
                return;
            }
            //-------------------------------------------

            ArrayList list_data = ltData.ltSet.GetRange(index_begin, index_end - index_begin + 1);
            BindingList <LottoryItem> list_show = new BindingList <LottoryItem>();

            foreach (LottoryItem item in list_data)
            {
                list_show.Add(item);
            }

            //----------------------------------------------
            chart_line_one.DataSource = list_show;

            chart_line_one.SeriesSerializable[0].Name = comb_name_select_r.Text;
            chart_line_one.SeriesSerializable[0].ArgumentDataMember  = "ID";
            chart_line_one.SeriesSerializable[0].ValueDataMembers[0] = LottoryItem.names[LottoryItem.ItemCnId(comb_name_select_r.Text)];

            runchart_is_drawing = false;
        }