示例#1
0
        private void BuildTableButton_Click(object sender, EventArgs e)
        {
            int m1 = int.Parse(ValueM1TextBox.Text);
            int m2 = int.Parse(ValueM2TextBox.Text);

            int range = int.Parse(RangeTextBox.Text);

            IList <Point2D> pointsList = BuildTable(m1, m2, range);

            GraphInfo graphInfo = new GraphInfo("Graphic", System.Windows.Media.Colors.Green, pointsList.ToArray(), true, false);

            IList <GraphInfo> graphCollection = new List <GraphInfo>()
            {
                graphInfo
            };

            ShowGraphic(graphCollection);
        }
        //-------------------------------------------------------------------------------------------------------
        //-------------------------------------------------------------------------------------------------------
        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);
            }
        }