コード例 #1
0
        public void DrawingLine(LineService lineService)
        {
            if (lineService != null)
            {
                if (lineService.LineServicesData == null)
                {
                    return;
                }
                double num2 = 18;
                double num3 = Convert.ToDouble(18) / Convert.ToDouble(10);
                for (int i = 0; i < lineService.LineServicesData.Count; i++)
                {
                    lineService.LineServicesData[i].PointX = num2 * ((lineService.LineServicesData[i].PointXDate.TimeOfDay.TotalMinutes - GanttColumnsItem[0].TimeName.TimeOfDay.TotalMinutes) / 5);
                    if (lineService.ChartLineType == ChartLineType.Number)
                    {
                        lineService.LineServicesData[i].ScreenPointY = lineService.TopItemIndex * 18;
                    }
                    else
                    {
                        lineService.LineServicesData[i].ScreenPointY = BorderChart.Height - (lineService.LineServicesData[i].PointY * num3);
                    }
                }

                Point[] array = new Point[lineService.LineServicesData.Count];
                for (int i = 0; i < lineService.LineServicesData.Count; i++)
                {
                    array[i] = new Point(lineService.LineServicesData[i].PointX, lineService.LineServicesData[i].ScreenPointY);
                }
                if ((lineService.ChartLineType == ChartLineType.BezierType) || (lineService.ChartLineType == ChartLineType.BezierKnotsType))
                {
                    BezierSpline.GetCurveControlPoints(array, out Point[] pointArray2, out Point[] pointArray3);
コード例 #2
0
 public void LoadData()
 {
     this.ConvertToGraphData();
     if (this.LineServicesData != null)
     {
         foreach (LineService curve in this.LineServicesData)
         {
             if (curve.LineServicesData == null)
             {
                 continue;
             }
             Point[] array = new Point[curve.LineServicesData.Count];
             for (int i = 0; i < curve.LineServicesData.Count; i++)
             {
                 array[i] = new Point(curve.LineServicesData[i].PointX, curve.LineServicesData[i].ScreenPointY);
             }
             if ((curve.ChartLineType == ChartLineType.BezierType) || (curve.ChartLineType == ChartLineType.BezierKnotsType))
             {
                 Point[] pointArray2;
                 Point[] pointArray3;
                 BezierSpline.GetCurveControlPoints(array, out pointArray2, out pointArray3);
                 this.DrawBezierChartData(curve.LineLegendItem.Color, array, pointArray2, pointArray3);
                 if (curve.ChartLineType == ChartLineType.BezierKnotsType)
                 {
                 }
             }
             else if ((curve.ChartLineType == ChartLineType.PolylineType) || (curve.ChartLineType == ChartLineType.PolylineKnotsType))
             {
                 this.DrawPolylineChartData(curve.LineLegendItem.Color, array);
                 if (curve.ChartLineType == ChartLineType.PolylineKnotsType)
                 {
                     DrawPolylineKnotsChartData(curve.LineLegendItem.Color, array, curve.LineLegendItem.TitleIcon);
                 }
             }
             else if (curve.ChartLineType == ChartLineType.Knots)
             {
                 DrawKnotsChartData(curve.LineLegendItem.Color, array, curve.LineLegendItem.TitleIcon);
             }
             else if (curve.ChartLineType == ChartLineType.Number)
             {
                 ObservableCollection <int> dataList = new ObservableCollection <int>();
                 foreach (var item in curve.LineServicesData)
                 {
                     dataList.Add(item.DataValue);
                 }
                 DrawPolylineNumberChartData(curve.LineLegendTopItem.Color, array, dataList);
             }
         }
     }
 }
コード例 #3
0
 public void DrawingLineList()
 {
     if (this.LineServicesData != null)
     {
         foreach (LineService info in this.LineServicesData)
         {
             if (info.LineServicesData == null)
             {
                 continue;
             }
             double num2 = 18;
             double num3 = Convert.ToDouble(18) / Convert.ToDouble(10);
             for (int i = 0; i < info.LineServicesData.Count; i++)
             {
                 info.LineServicesData[i].PointX = num2 * ((info.LineServicesData[i].PointXDate.TimeOfDay.TotalMinutes - GanttColumnsItem[0].TimeName.TimeOfDay.TotalMinutes) / 5);
                 if (info.ChartLineType == ChartLineType.Number)
                 {
                     info.LineServicesData[i].ScreenPointY = info.TopItemIndex * 18;
                 }
                 else if (info.ChartLineType == ChartLineType.Description)
                 {
                     info.LineServicesData[i].ScreenPointY = 18 + info.TopItemIndex * 18;
                 }
                 else
                 {
                     info.LineServicesData[i].ScreenPointY = BorderChart.Height - (info.LineServicesData[i].PointY * num3);
                 }
             }
         }
         foreach (LineService curve in this.LineServicesData)
         {
             if (curve.LineServicesData == null)
             {
                 continue;
             }
             Point[] array = new Point[curve.LineServicesData.Count];
             for (int i = 0; i < curve.LineServicesData.Count; i++)
             {
                 array[i] = new Point(curve.LineServicesData[i].PointX, curve.LineServicesData[i].ScreenPointY);
             }
             if ((curve.ChartLineType == ChartLineType.BezierType) || (curve.ChartLineType == ChartLineType.BezierKnotsType))
             {
                 Point[] pointArray2;
                 Point[] pointArray3;
                 BezierSpline.GetCurveControlPoints(array, out pointArray2, out pointArray3);
                 this.DrawBezierChartData(curve.LineLegendItem.Color, array, pointArray2, pointArray3);
                 if (curve.ChartLineType == ChartLineType.BezierKnotsType)
                 {
                 }
             }
             else if ((curve.ChartLineType == ChartLineType.PolylineType) || (curve.ChartLineType == ChartLineType.PolylineKnotsType))
             {
                 this.DrawPolylineChartData(array, curve);
                 if (curve.ChartLineType == ChartLineType.PolylineKnotsType)
                 {
                     DrawPolylineKnotsChartData(array, curve);
                 }
             }
             else if (curve.ChartLineType == ChartLineType.Knots)
             {
                 DrawKnotsChartData(curve.LineLegendItem.Color, array, curve.LineLegendItem.TitleIcon);
             }
             else if (curve.ChartLineType == ChartLineType.Number)
             {
                 ObservableCollection <int> dataList = new ObservableCollection <int>();
                 foreach (var item in curve.LineServicesData)
                 {
                     dataList.Add(item.DataValue);
                 }
                 DrawNumberChartData(curve.LineLegendTopItem.Color, array, dataList);
             }
             else if (curve.ChartLineType == ChartLineType.Description)
             {
                 if (curve.LineServicesData.Count > 0)
                 {
                     DrawDescriptionChartData(curve.LineLegendTopItem.Color, array, curve.LineServicesData[0].InfoDescription);
                 }
             }
         }
     }
 }