Ejemplo n.º 1
0
        public void Show()
        {
            IFunction function1 = GetFunction1Arg1Comp();
            IFunction function2 = GetFunction1Arg1Comp();
            IFunction function3 = GetFunction1Arg1Comp();

            function1[1.0] = 2.0;
            function1[2.0] = 5.0;
            function1[3.0] = 1.0;

            function2[1.0] = 20.0;
            function2[2.0] = 50.0;
            function2[3.0] = 10.0;

            function3[3.0] = 20;
            function3[4.0] = 50;

            var view = new ChartView();

            ILineChartSeries lineSeries1 = GetLineSeries(function1, view);
            ILineChartSeries lineSeries2 = GetLineSeries(function2, view);
            ILineChartSeries lineSeries3 = GetLineSeries(function3, view);

            view.Chart.Series.Add(lineSeries1);
            view.Chart.Series.Add(lineSeries2);
            view.Chart.Series.Add(lineSeries3);

            var tool = view.NewSeriesBandTool(lineSeries1, lineSeries2, Color.Green);

            WindowsFormsTestHelper.ShowModal(view);
        }
Ejemplo n.º 2
0
        public void Show()
        {
            IFunction function1 = GetFunction1Arg1Comp();
            IFunction function2 = GetFunction1Arg1Comp();
            IFunction function3 = GetFunction1Arg1Comp();

            function1[1.0] = 2.0;
            function1[2.0] = 5.0;
            function1[3.0] = 1.0;

            function2[1.0] = 20.0;
            function2[2.0] = 50.0;
            function2[3.0] = 10.0;

            function3[3.0] = 20;
            function3[4.0] = 50;

            var view = new ChartView();

            ILineChartSeries lineSeries1 = GetLineSeries(function1, view);
            ILineChartSeries lineSeries2 = GetLineSeries(function2, view);
            ILineChartSeries lineSeries3 = GetLineSeries(function3, view);

            view.Chart.Series.Add(lineSeries1);
            view.Chart.Series.Add(lineSeries2);
            view.Chart.Series.Add(lineSeries3);

            var tool = view.NewSeriesBandTool(lineSeries1, lineSeries2, Color.Green);

            WindowsFormsTestHelper.ShowModal(view);
        }
Ejemplo n.º 3
0
        public void SeriesBandToolView()
        {
            var chartView = new ChartView();

            var dataTable1 = new DataTable();
            var dataTable2 = new DataTable();

            dataTable1.Columns.AddRange(new []
            {
                new DataColumn("Y", typeof(double)),
                new DataColumn("Z", typeof(double))
            });
            dataTable2.Columns.AddRange(new[]
            {
                new DataColumn("Y", typeof(double)),
                new DataColumn("Z", typeof(double))
            });

            var ySeries1 = new[] { 0.0, 2.0, 5.0, 10.0, 13.0, 15.0 };
            var zSeries1 = new[] { 0.0, 0.0, -10.0, -10.0, 0.0, 0.0 };
            var ySeries2 = new[] { 0.0, 5.0, 5.0, 10.0, 10.0, 15.0 };
            var zSeries2 = new[] { 1.0, 1.0, -9.0, -9.0, 1.0, 1.0 };

            for (int i = 0; i < ySeries1.Length; i++)
            {
                var row = dataTable1.NewRow();
                row["Y"] = ySeries1[i];
                row["Z"] = zSeries1[i];
                dataTable1.Rows.Add(row);
            }

            for (int i = 0; i < ySeries2.Length; i++)
            {
                var row = dataTable2.NewRow();
                row["Y"] = ySeries2[i];
                row["Z"] = zSeries2[i];
                dataTable2.Rows.Add(row);
            }

            var series1 = ChartSeriesFactory.CreateLineSeries();
            var series2 = ChartSeriesFactory.CreateLineSeries();

            series1.DataSource        = dataTable1;
            series1.XValuesDataMember = "Y";
            series1.YValuesDataMember = "Z";

            series2.DataSource        = dataTable2;
            series2.XValuesDataMember = "Y";
            series2.YValuesDataMember = "Z";

            chartView.Chart.Series.AddRange(new [] { series1, series2 });

            //tool
            var tool = chartView.NewSeriesBandTool(series1, series2, Color.Yellow, HatchStyle.BackwardDiagonal, Color.Red);

            chartView.Tools.Add(tool);

            WindowsFormsTestHelper.ShowModal(chartView);
        }