using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Text; using System.Windows.Forms; using ZedGraph; using System.Data.OleDb; namespace Bubbler { public partial class ReadExcel : Form { public ReadExcel() { InitializeComponent(); } public void CreateGraph(ZedGraphControl BubblerGraph1, double[] Gases,string LastModified) { // get a reference to the GraphPane GraphPane myPane = BubblerGraph1.GraphPane; // Set the Titles myPane.Title.Text = "OnLine percentages of Gases"; myPane.XAxis.Title.Text = "Gas"; myPane.YAxis.Title.Text = "Percentage"; // Make up some random data points string[] labels = { "Ar(%)","SF6(%)","Isob(%)","R134A(%)" }; double[] y = Gases; // Generate a red bar with "Curve 1" in the legend BarItem myBar = myPane.AddBar("%", 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); } } }