Пример #1
0
        public static FrameworkElement getMonGroupChart(
            IEnumerable <DGObject> objs, double width, double height)
        {
            if (objs == null || objs.Count() == 0)
            {
                return(null);
            }
            MonGroup firstMonGroup = objs.First() as MonGroup;

            if (firstMonGroup == null ||
                firstMonGroup.monPntDict == null ||
                firstMonGroup.monPntDict.Count == 0)
            {
                return(null);
            }
            MonPoint lastMonPoint = firstMonGroup.monPntDict.Values.Last();

            if (lastMonPoint == null)
            {
                return(null);
            }

            string shape = firstMonGroup.groupShape.ToLower();

            if (shape == "line" || shape == "linear")
            {
                if (lastMonPoint.distanceZ != null &&
                    lastMonPoint.distanceZ.Value != 0)
                {
                    MonGroupChartLinearZ chart = new MonGroupChartLinearZ(width, height);
                    chart.setObjs(objs);
                    return(chart);
                }
                else
                {
                    MonGroupChartLinearX chart = new MonGroupChartLinearX(width, height);
                    chart.setObjs(objs);
                    return(chart);
                }
            }
            else if (shape == "circle" || shape == "circular")
            {
                return(getMonGroupChart_Circular(objs, width, height));
            }
            return(null);
        }
Пример #2
0
        public static FrameworkElement getMonGroupChart(
            IEnumerable<DGObject> objs, double width, double height)
        {
            if (objs == null || objs.Count() == 0)
                return null;
            MonGroup firstMonGroup = objs.First() as MonGroup;
            if (firstMonGroup == null || 
                firstMonGroup.monPntDict == null ||
                firstMonGroup.monPntDict.Count == 0)
                return null;
            MonPoint lastMonPoint = firstMonGroup.monPntDict.Values.Last();
            if (lastMonPoint == null)
                return null;

            string shape = firstMonGroup.groupShape.ToLower();
            if (shape == "line" || shape == "linear")
            {
                if (lastMonPoint.distanceZ != null &&
                    lastMonPoint.distanceZ.Value != 0)
                {
                    MonGroupChartLinearZ chart = new MonGroupChartLinearZ(width, height);
                    chart.setObjs(objs);
                    return chart;
                }
                else
                {
                    MonGroupChartLinearX chart = new MonGroupChartLinearX(width, height);
                    chart.setObjs(objs);
                    return chart;
                }
            }
            else if (shape == "circle" || shape == "circular")
            {
                return getMonGroupChart_Circular(objs, width, height);
            }
            return null;
        }