private void OnRenderGraph(ZedGraphWeb zgw, Graphics g, MasterPane masterPane)
{
// Get the GraphPane so we can work with it
GraphPane myPane = masterPane[0];
// Set the title and axis labels
myPane.Title.Text = "Horizontal Bar Graph";
myPane.XAxis.Title.Text = "Performance Factor";
myPane.YAxis.Title.Text = "Grouping";
// Enter some random data values
double[] y = { 100, 100, 75, 22, 98, 40, 10 };
double[] y2 = { 90, 100, 95, 35, 80, 35, 35 };
double[] y3 = { 80, 100, 65, 15, 54, 67, 18 };
// Generate a bar with "Curve 1" in the legend
BarItem myCurve = myPane.AddBar("Curve 1", y, null, Color.Red);
// Fill the bar with a red-white-red gradient
myCurve.Bar.Fill = new Fill(Color.Red, Color.White, Color.Red, 90F);
// Generate a bar with "Curve 2" in the legend
myCurve = myPane.AddBar("Curve 2", y2, null, Color.Blue);
// Fill the bar with a blue-white-blue gradient for a 3d look
myCurve.Bar.Fill = new Fill(Color.Blue, Color.White, Color.Blue, 90F);
// Generate a bar with "Curve 3" in the legend
myCurve = myPane.AddBar("Curve 3", y3, null, Color.Green);
// Fill the bar with a Green-white-Green gradient for a 3d look
myCurve.Bar.Fill = new Fill(Color.White, Color.Green, 90F);
// Draw the X tics between the labels instead of at the labels
myPane.YAxis.MajorTic.IsBetweenLabels = true;
// Set the XAxis to an ordinal type
myPane.YAxis.Type = AxisType.Ordinal;
myPane.XAxis.Scale.Max = 100;
// draw the X axis zero line
myPane.XAxis.MajorGrid.IsZeroLine = true;
//This is the part that makes the bars horizontal
myPane.BarSettings.Base = BarBase.Y;
// Fill the axis background with a color gradient
myPane.Chart.Fill = new Fill(Color.White, Color.FromArgb(255, 255, 166), 45.0F);
masterPane.AxisChange(g);
//Create a label for each bar in the
BarItem.CreateBarLabels(myPane, false, "0");
}