Ejemplo n.º 1
0
        private void btn_Accept_Click(object sender, EventArgs e)
        {
            GraphWindow graphWindow = gwBuilder.Build();
            GraphForm   newForm     = new GraphForm(graphWindow, this, sFactory, sData);

            newForm.Show();
            this.Hide();
        }
Ejemplo n.º 2
0
        private void ProcessFile(String inFilename, String gphFilename, String pdfFilename)
        {
            Debug.WriteLine("------------------------------------------------------");
            Debug.WriteLine("Processing:");
            Debug.WriteLine(inFilename);
            Debug.WriteLine(gphFilename);
            Debug.WriteLine(pdfFilename);

            String graphType = GetGraphType(gphFilename);

            if (graphType != null)
            {
                GraphForm graph = CreateGraphForm(graphType);

                if (graph != null)
                {
                    graph.Show();

                    if (System.IO.Path.GetExtension(inFilename) == "xlsx")
                    {
                        graph.LoadExcelFile(inFilename);
                    }
                    else
                    {
                        graph.LoadDataFile(inFilename);
                    }
                    graph.LoadGphFile(gphFilename);

                    FileStream fos = new FileStream(pdfFilename, FileMode.Create, FileAccess.ReadWrite, FileShare.None);

                    graph.CreatePdfStream(fos);

                    fos.Close();

                    graph.Close();
                }
                else
                {
                    Debug.WriteLine("CreateGraphForm Failed!!");
                }
            }
            else
            {
                Debug.WriteLine("Unsupported!!");
            }
        }
Ejemplo n.º 3
0
		private void ShowSingleGraph(params double[][] data)
		{
			GraphForm form = new GraphForm();

			double labelMax;
			double[] label = GetLabel(out labelMax);

			for(int i=0; i<data.Length; ++i)
			{
				int k = i % pens.Length;
				form.Graph.AddEntry(label, data[i], pens[k]);
			}

			form.Graph.SetXAxis(0, labelMax, 4, font, brush);
			if(this.checkYAxisAuto.Checked)
			{
				form.Graph.SetYAxis(0, 0, 5, font, brush);
				form.Graph.AutoScaleY();
			}
			else
			{
				double min = double.Parse(this.textYMin.Text);
				double max = double.Parse(this.textYMax.Text);
				form.Graph.SetYAxis(min, max, 5, font, brush);
			}

			form.Text = this.Text;
			form.MdiParent = this.MdiParent;
			form.Show();
		}