コード例 #1
0
        public void GenericDataRowConvert()
        {
            LagTestDataList lagTestDataList = new LagTestDataList();

            lagTestDataList.Populate();

            var x = "m/d";
        }
コード例 #2
0
        public void AddLagTestData(DataTable dt, string chartTitle)
        {
            ChartData chartData = new ChartData();

            chartData.chartTitle = chartTitle;
            chartData.datasets   = new List <ChartDataSet>();

            //get the data
            LagTestDataList lagData = new LagTestDataList();

            lagData.Populate();

            //split the labels out
            var labels = lagData.list.GroupBy(x => x.numberMinutes).Select(y => y.First()).ToList();

            labels.ForEach(x => chartData.labels.Add(x.numberMinutes.ToString()));

            //one set of data each for sync/async and memory combinations
            var syncList  = lagData.list.Where(x => !x.asynchronous).ToList();
            var asyncList = lagData.list.Where(x => x.asynchronous).ToList();

            var memoryList = lagData.list.GroupBy(x => x.memoryGb).Select(y => y.First().memoryGb.ToString()).ToList();

            //get the different data types
            int count = 0;

            foreach (String memory in memoryList)
            {
                var sync  = syncList.Where(x => x.memoryGb.ToString().Equals(memory));
                var async = asyncList.Where(x => x.memoryGb.ToString().Equals(memory));

                var syncDataSet = new ChartDataSet();
                syncDataSet.label = "Sync " + memory + "GB";
                syncDataSet.AssignColours(count);
                count++;

                var asyncDataSet = new ChartDataSet();
                asyncDataSet.label = "ASync " + memory + "GB";
                asyncDataSet.AssignColours(count);
                count++;

                foreach (LagTestData data in sync)
                {
                    syncDataSet.data.Add(data.detectionSeconds);
                }

                foreach (LagTestData data in async)
                {
                    asyncDataSet.data.Add(data.detectionSeconds);
                }

                if (memory == "16")
                {
                    chartData.datasets.Add(syncDataSet);
                }
                chartData.datasets.Add(asyncDataSet);
            }

            //add the base line (processing same as minutes to play) for comparision purposes on the graph
            var controlSet = new ChartDataSet();

            controlSet.label = "Realtime";
            controlSet.AssignColours("control");
            chartData.labels.ForEach(x => controlSet.data.Add(x.StringToDec()));
            chartData.datasets.Add(controlSet);

            list.Add(chartData);
        } //AddLagTestData