示例#1
0
        private void ReadButton_Click(object sender, RoutedEventArgs e)
        {
            ResponseTotalChart.Clear();
            ChartOne.Title = "День " + inputData.Text;
            int day   = 1;
            int hour  = 0;
            int count = 0;

            day  = Convert.ToInt32(inputData.Text);
            hour = dataList[0].hour;
            foreach (Data outData in dataList)
            {
                if (day == outData.dateDay)
                {
                    if (hour == outData.hour)
                    {
                        count++;
                    }
                    else
                    {
                        ResponseTotalChart.Add(new ResponsePoint
                        {
                            x = hour,
                            y = count,
                        });
                        hour  = outData.hour;
                        count = 0;
                    }
                }
            }
            ChartOne.ItemsSource = ResponseTotalChart;
        }
示例#2
0
        private void Freq2Button_Click(object sender, RoutedEventArgs e)
        {
            ResponseTotalChart.Clear();
            ChartOne.Title = "Частота2";
            int[] number = new int[1];
            int[] count  = new int[1];
            number[0] = Convert.ToInt32(diskDataList[0].numberTwo);
            count[0]  = 1;
            bool dop = true;

            foreach (Data outData in diskDataList)
            {
                dop = true;
                for (int i = 0; i < number.Length; i++)
                {
                    if (Convert.ToInt32(outData.numberTwo) == number[i])
                    {
                        count[i]++;
                        dop = false;
                    }
                }
                if (dop)
                {
                    int temp;
                    temp = number.Length + 1;
                    Array.Resize(ref number, temp);
                    temp = count.Length + 1;
                    Array.Resize(ref count, temp);
                    number[number.Length - 1] = Convert.ToInt32(outData.numberTwo);
                    count[count.Length - 1]   = 1;
                }
            }

            for (int i = 0; i < number.Length; i++)
            {
                ResponseTotalChart.Add(new ResponsePoint
                {
                    x = number[i],
                    y = count[i],
                });
            }
            ChartOne.ItemsSource = ResponseTotalChart;
        }