Ejemplo n.º 1
1
        /// <summary>
        /// Defines the entry point of the application.
        /// </summary>
        private static void Main()
        {
            Application.Init();

            var window = new Window("GtkSharpDemo");
            var plotModel = new PlotModel
                         {
                             Title = "Trigonometric functions",
                             Subtitle = "Example using the FunctionSeries",
                             PlotType = PlotType.Cartesian,
                             Background = OxyColors.White
                         };
            plotModel.Series.Add(new FunctionSeries(Math.Sin, -10, 10, 0.1, "sin(x)") { Color = OxyColors.Black });
            plotModel.Series.Add(new FunctionSeries(Math.Cos, -10, 10, 0.1, "cos(x)") { Color = OxyColors.Green });
            plotModel.Series.Add(new FunctionSeries(t => 5 * Math.Cos(t), t => 5 * Math.Sin(t), 0, 2 * Math.PI, 0.1, "cos(t),sin(t)") { Color = OxyColors.Yellow });
            
            var plotView = new OxyPlot.GtkSharp.PlotView { Model = plotModel };
            plotView.SetSizeRequest(400, 400);
            plotView.Visible = true;

            window.SetSizeRequest(600, 600);
            window.Add(plotView);
            window.Focus = plotView;
            window.Show();
            window.DeleteEvent += (s, a) =>
                {
                    Application.Quit();
                    a.RetVal = true;
                };

            Application.Run();
        }
Ejemplo n.º 2
0
		public Gtk.Widget GetPlotView() {

			var plotView = new OxyPlot.GtkSharp.PlotView { Model = plotModel, Visible = true };

			plotView.SetSizeRequest(500, 400);

			return plotView;
		}
Ejemplo n.º 3
0
        public Gtk.Widget GetPlotView()
        {
            var plotView = new OxyPlot.GtkSharp.PlotView {
                Model = plotModel, Visible = true
            };

            plotView.SetSizeRequest(500, 400);

            return(plotView);
        }
Ejemplo n.º 4
0
		public Gtk.Widget GetPlotView() {

//			plotModel.Series.Add(new FunctionSeries(Math.Sin, -10, 10, 0.1, "sin(x)"));
//			plotModel.Series.Add(new FunctionSeries(Math.Cos, -10, 10, 0.1, "cos(x)"));
//			plotModel.Series.Add(new FunctionSeries(t => 5 * Math.Cos(t), t => 5 * Math.Sin(t), 0, 2 * Math.PI, 0.1,"cos(t),sin(t)"));

			var plotView = new OxyPlot.GtkSharp.PlotView { Model = plotModel, Visible = true };

			plotView.SetSizeRequest(500, 400);

			return plotView;
		}
Ejemplo n.º 5
0
        public Gtk.Widget GetPlotView()
        {
//			plotModel.Series.Add(new FunctionSeries(Math.Sin, -10, 10, 0.1, "sin(x)"));
//			plotModel.Series.Add(new FunctionSeries(Math.Cos, -10, 10, 0.1, "cos(x)"));
//			plotModel.Series.Add(new FunctionSeries(t => 5 * Math.Cos(t), t => 5 * Math.Sin(t), 0, 2 * Math.PI, 0.1,"cos(t),sin(t)"));

            var plotView = new OxyPlot.GtkSharp.PlotView {
                Model = plotModel, Visible = true
            };

            plotView.SetSizeRequest(500, 400);

            return(plotView);
        }
Ejemplo n.º 6
0
        /// <summary>
        /// Defines the entry point of the application.
        /// </summary>
        private static void Main()
        {
            Application.Init();

            var window    = new Window("helloworld");
            var plotModel = new PlotModel
            {
                Title      = "Trigonometric functions",
                Subtitle   = "Example using the FunctionSeries",
                PlotType   = PlotType.Cartesian,
                Background = OxyColors.White
            };

            plotModel.Series.Add(new FunctionSeries(Math.Sin, -10, 10, 0.1, "sin(x)")
            {
                Color = OxyColors.Black
            });
            plotModel.Series.Add(new FunctionSeries(Math.Cos, -10, 10, 0.1, "cos(x)")
            {
                Color = OxyColors.Green
            });
            plotModel.Series.Add(new FunctionSeries(t => 5 * Math.Cos(t), t => 5 * Math.Sin(t), 0, 2 * Math.PI, 0.1, "cos(t),sin(t)")
            {
                Color = OxyColors.Yellow
            });

            var plotView = new OxyPlot.GtkSharp.PlotView {
                Model = plotModel
            };

            plotView.SetSizeRequest(400, 400);
            plotView.Visible = true;

            window.SetSizeRequest(600, 600);
            window.Add(plotView);
            window.Focus = plotView;
            window.Show();
            window.DeleteEvent += (s, a) =>
            {
                Application.Quit();
                a.RetVal = true;
            };

            Application.Run();
        }