using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Text; using System.Windows.Forms; using ZedGraph; namespace Daya_Bay_Princeton_2009 { public partial class Form4 : Form { private double[] DetailGraphingData; private string boardname; public Form4(double[]GraphingData,string BoardName) { DetailGraphingData = GraphingData; boardname = BoardName; InitializeComponent(); } private void Form4_Load(object sender, EventArgs e) { this.Text = boardname; CreateGraph(zedGraphControl13, DetailGraphingData,boardname); } private void CreateGraph(ZedGraphControl BubblerGraph1, double[] GraphingData, string BoardName) { // get a reference to the GraphPane GraphPane myPane = BubblerGraph1.GraphPane; // Set the Titles myPane.Title.Text = "Daya_Bay_Princeton_2009"; myPane.XAxis.Title.Text = "Channel"; myPane.YAxis.Title.Text = "Rate"; // Make up some random data points string[] labels = { "1", "2", "3", "4", "5", "6","7","8","9","10","11", "12", "13", "14", "15", "16" }; double[] y = GraphingData; // Generate a red bar with "Curve 1" in the legend BarItem myBar = myPane.AddBar(BoardName, null, y, Color.Red); myBar.Bar.Fill = new Fill(Color.Red, Color.White, Color.Red); // Draw the X tics between the labels instead of // at the labels myPane.XAxis.MajorTic.IsBetweenLabels = true; // Set the XAxis labels myPane.XAxis.Scale.TextLabels = labels; // Set the XAxis to Text type myPane.XAxis.Type = AxisType.Text; // Fill the Axis and Pane backgrounds myPane.Chart.Fill = new Fill(Color.White, Color.FromArgb(255, 255, 166), 90F); myPane.Fill = new Fill(Color.FromArgb(250, 250, 255)); // Tell ZedGraph to refigure the // axes since the data have changed //BarItem.CreateBarLabels(myPane, false, "f0"); // Create data label on bar BubblerGraph1.AxisChange(); BarItem.CreateBarLabels(myPane,false,"0.00",FontFamily.GenericSansSerif.ToString(),24.0f,Color.Black,false,false,false); } private void zedGraphControl13_Load(object sender, EventArgs e) { } } }