コード例 #1
0
ファイル: Barcode.cs プロジェクト: wshanshan/DDD
        public override void GetDataLists()
        {
            int numOpenFactors = 2;
            chartLabels = new List<string>[numOpenFactors];
            chartMeasureIDs = new List<int>[numOpenFactors];
            rtPMEData = new List<object>();
            InstCurValueList instDataList;
            string[,] instIDs;

            // Get the Factor Labels
            for (int i = 0; i < numOpenFactors; i++)
            {
                chartLabels[i] = new List<string>();
                chartMeasureIDs[i] = new List<int>();

                GetFactorLabels(configDisplay.DisplayFactors[i].ConfigDisplay.MeasureName, configDisplay.DisplayFactors[i].FactorName,
                    chartLabels[i], chartMeasureIDs[i]);
            }

            // Create array to store instances names in
            instIDs = new string[chartLabels[0].Count - 1, chartLabels[1].Count - 1];

            // Create the list of data arrays for the PM engine to fill in
            rtPMEData = new List<object>();

            // Loop over factors 1
            for (int x = 0; x < chartLabels[0].Count - 1; x++)
            {
                // Create a new rtPMEData structure to hold the data for this pie chart
                instDataList = new InstCurValueList();
                instDataList.instanceIDs = new List<string>();
                instDataList.dataValues = new List<double>();

                for (int y = 0; y < chartLabels[1].Count - 1; y++)
                {
                    List<string> factorLevels = new List<string>();

                    factorLevels.Add(chartLabels[0][x]);
                    factorLevels.Add(chartLabels[1][y]);

                    instIDs[x, y] = CreateRTPMEInstanceDef(configDisplay, factorLevels, null);

                    // Add this instance to the data list for this stacked histogram
                    if ((instIDs[x, y] != null) && (instIDs[x, y].Length > 0))
                    {
                        instDataList.instanceIDs.Add(instIDs[x, y]);
                        instDataList.dataValues.Add(100.0);
                    }
                }

                // Add new data object
                rtPMEData.Add(instDataList);
            }
        }
コード例 #2
0
ファイル: MultiLevelBowTie.cs プロジェクト: wshanshan/DDD
        public override void GetDataLists()
        {
            chartLabels = new List<string>[3];
            chartMeasureIDs = new List<int>[3];
            rtPMEData = new List<object>();
            InstCurValueList instDataList;
            string[, ,] instIDs;

            if (configDisplay.DisplayFactors.Count < 2)
            {
                return;
            }

            // Get the Factor Labels
            for (int i = 0; i < configDisplay.DisplayFactors.Count; i++)
            {
                chartLabels[i] = new List<string>();
                chartMeasureIDs[i] = new List<int>();

                GetFactorLabels(configDisplay.DisplayFactors[i].ConfigDisplay.MeasureName, configDisplay.DisplayFactors[i].FactorName,
                    chartLabels[i], chartMeasureIDs[i], i == 0);
            }

            int xCount = 0;
            if (configDisplay.DisplayFactors.Count == 2)
            {
                xCount = 1;
            }
            else
            {
                xCount = chartLabels[2].Count;
            }

            // Create array to store instances names in
            instIDs = new string[chartLabels[0].Count, chartLabels[1].Count, xCount];

            // Create the list of data arrays for the PM engine to fill in
            rtPMEData = new List<object>();

            // Loop over factors 1
            for (int z = 0; z < chartLabels[0].Count; z++)
            {
                // Create a new RTPMEData structure to hold the data for this pie chart
                instDataList = new InstCurValueList();
                instDataList.instanceIDs = new List<string>();
                instDataList.dataValues = new List<double>();

                for (int y = 0; y < chartLabels[1].Count; y++)
                {
                    for (int x = 0; x < xCount; x++)
                    {
                        List<string> factorLevels = new List<string>();

                        factorLevels.Add(chartLabels[0][z]);
                        factorLevels.Add(chartLabels[1][y]);
                        if (configDisplay.DisplayFactors.Count > 2)
                        {
                            factorLevels.Add(chartLabels[2][x]);
                        }

                        // Create the RT PME Instance Definition
                        instIDs[z, y, x] = CreateRTPMEInstanceDef(configDisplay, factorLevels, null);

                        // Add this instance to the data list for this stacked histogram
                        instDataList.instanceIDs.Add(instIDs[z, y, x]);
                        instDataList.dataValues.Add(100.0);
                    }
                }

                // Add new data object
                rtPMEData.Add(instDataList);
            }
        }
コード例 #3
0
ファイル: MultiPieChart.cs プロジェクト: wshanshan/DDD
        public override void GetDataLists()
        {
            int numOpenFactors = 3;
            chartLabels = new List<string>[numOpenFactors];
            chartMeasureIDs = new List<int>[numOpenFactors];
            rtPMEData = new List<object>();
            InstCurValueList instDataList;
            string[, ,] instIDs;

            // Get the Factor Labels
            for (int i = 0; i < numOpenFactors; i++)
            {
                chartLabels[i] = new List<string>();
                chartMeasureIDs[i] = new List<int>();

                GetFactorLabels(configDisplay.DisplayFactors[i].ConfigDisplay.MeasureName, configDisplay.DisplayFactors[i].FactorName,
                    chartLabels[i], chartMeasureIDs[i]);
            }

            // Create array to store instances names in
            instIDs = new string[chartLabels[0].Count, chartLabels[1].Count, chartLabels[2].Count];

            // Create the list of data arrays for the PM engine to fill in
            rtPMEData = new List<object>();

            // Loop over factors 1 + 2 (X and Y)
            for (int x = 0; x < chartLabels[0].Count; x++)
            {
                for (int y = 0; y < chartLabels[1].Count; y++)
                {
                    // Create a new RTPMEData structure to hold the data for this pie chart
                    instDataList = new InstCurValueList();
                    instDataList.instanceIDs = new List<string>();
                    instDataList.dataValues = new List<double>();


                    for (int z = 0; z < chartLabels[2].Count; z++)
                    {
                        List<string> factorLevels = new List<string>();

                        factorLevels.Add(chartLabels[0][x]);
                        factorLevels.Add(chartLabels[1][y]);
                        factorLevels.Add(chartLabels[2][z]);

                        if (y == chartLabels[1].Count - 1)
                        {
                            // Create a Y total instance
                            List<string> listToTotal = new List<string>();

                            for (int j = 0; j < chartLabels[1].Count - 1; j++)
                            {
                                listToTotal.Add(instIDs[x, j, z]);
                            }
                            // Create a total instance
                            instIDs[x, y, z] = CreateRTPMESumInstanceDef(configDisplay, factorLevels, listToTotal, null);
                        }
                        else if (x == chartLabels[0].Count - 1)
                        {
                            // Create a X total instance
                            List<string> listToTotal = new List<string>();

                            for (int j = 0; j < chartLabels[0].Count - 1; j++)
                            {
                                listToTotal.Add(instIDs[j, y, z]);
                            }
                            // Create a total instance
                            instIDs[x, y, z] = CreateRTPMESumInstanceDef(configDisplay, factorLevels, listToTotal, null);
                        }
                        else if (z == chartLabels[2].Count - 1)
                        {
                            // Create a Z total instance
                            List<string> listToTotal = new List<string>();

                            for (int j = 0; j < chartLabels[2].Count - 1; j++)
                            {
                                listToTotal.Add(instIDs[x, y, j]);
                            }
                            // Create a total instance
                            instIDs[x, y, z] = CreateRTPMESumInstanceDef(configDisplay, factorLevels, listToTotal, null);
                        }
                        else
                        {
                            // Create a Z total instance
                            instIDs[x, y, z] = CreateRTPMEInstanceDef(configDisplay, factorLevels, null);
                        }

                        // Add this instance to the data list for this pie chart
                        if ((instIDs[x, y, z] != null) && (instIDs[x, y, z].Length > 0) &&
                            (z != chartLabels[2].Count - 1))
                        {
                            instDataList.instanceIDs.Add(instIDs[x, y, z]);
                            instDataList.dataValues.Add(100.0);
                        }
                    }

                    // Add new data object
                    rtPMEData.Add(instDataList);
                }
            }

            // Get Max instance
            string maxInstanceID = instIDs[chartLabels[0].Count - 1,
                                            chartLabels[1].Count - 1,
                                            chartLabels[2].Count - 1];

            // Generate ratio (for pie chart size) dataset
            instDataList = new InstCurValueList();
            instDataList.instanceIDs = new List<string>();
            instDataList.dataValues = new List<double>();

            for (int x = 0; x < chartLabels[0].Count; x++)
            {
                for (int y = 0; y < chartLabels[1].Count; y++)
                {
                    string dividendID = instIDs[x, y, chartLabels[2].Count - 1];
                    string ratioID = CreateRTPMERatioInstanceDef(configDisplay, dividendID, maxInstanceID);
                    if ((ratioID != null) && (ratioID.Length > 0))
                    {
                        // Add this instance to the data list for this pie chart
                        instDataList.instanceIDs.Add(ratioID);
                        instDataList.dataValues.Add(0.0);
                    }
                }
            }

            // Add new data object
            rtPMEData.Add(instDataList);

        }