コード例 #1
0
        //-----------------------------------------------------------------------------------------------
        //Минимальные координаты точек
        public static double[] GetMinimalCoordinates(Point2D[] points)
        {
            double[] coordinatesX = PlaneManager.GetCoordinatesX(points);
            double[] coordinatesY = PlaneManager.GetCoordinatesY(points);

            double minX = coordinatesX.Min();
            double minY = coordinatesY.Min();

            double[] minimalCoordinates = new double[] { minX, minY };
            return(minimalCoordinates);
        }
        //-------------------------------------------------------------------------------------------------------
        //-------------------------------------------------------------------------------------------------------
        private static void GraphInfoCollectionChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            SwordfishXYLineChartControl chartControl        = d as SwordfishXYLineChartControl;
            IList <GraphInfo>           graphInfoCollection = (IList <GraphInfo>)e.NewValue;

            if (graphInfoCollection == null)
            {
                return;
            }

            chartControl.xyLineChart.Reset();

            for (int index = 0; index < graphInfoCollection.Count; index++)
            {
                GraphInfo graphInfo = graphInfoCollection[index];
                double[]  xValues   = PlaneManager.GetCoordinatesX(graphInfo.GraphPoints);
                double[]  yValues   = PlaneManager.GetCoordinatesY(graphInfo.GraphPoints);

                chartControl.DrawChart
                    (xValues, yValues, graphInfo.GraphColor, graphInfo.GraphName, graphInfo.LineVisibility, graphInfo.PointsVisibility, false);
            }
        }