Hey,
ich will 2 Kurven in einem Panel zeichnen. Dies ist mir auch schon gelungen, dass Problem ist nur, dass diese sich nicht überschneiden! Dies kann aber durchaus vorkommen und sollte dann auch zu erkennen sein!
Hat dafür irgendwer eine Lösung? Wäre super!
Ich poste meine schon entwickelten Codezeilen einfach schonmal zum Verständnis
ich will 2 Kurven in einem Panel zeichnen. Dies ist mir auch schon gelungen, dass Problem ist nur, dass diese sich nicht überschneiden! Dies kann aber durchaus vorkommen und sollte dann auch zu erkennen sein!
Hat dafür irgendwer eine Lösung? Wäre super!
Ich poste meine schon entwickelten Codezeilen einfach schonmal zum Verständnis

Code:
private void CreateGraph(ZedGraphControl zgc)
{
int x = 0;
GraphPane myPane = zgc.GraphPane;
// Set the titles and axis labels
myPane.Title.Text = "Merkur Dispenser 100";
myPane.XAxis.Title.Text = "Zeit in [s]";
myPane.YAxis.Title.Text = "Geschwindigkeit in [mm/s]";
// Make up some data points
PointPairList list = new PointPairList();
PointPairList list1 = new PointPairList();
if (Schablone_dgv != null)
{
foreach (DataGridViewRow row in (Schablone_dgv.Rows))
{
{
list.Add(x, Convert.ToInt32(row.Cells[0].Value));
x += 10;
}
}
foreach (DataGridViewRow row in (Schablone_dgv.Rows))
{
{
list1.Add(x, Convert.ToInt32(row.Cells[1].Value));
x += 10;
}
}
}
// Generate a blue curve with circle symbols, and "My Curve 1" in the legend
LineItem myCurve = myPane.AddCurve("My Curve", list, Color.Blue, SymbolType.Circle);
// Generate a red curve with circle symbols, and "My Curve 2" in the legend
LineItem myCurve2 = myPane.AddCurve("My Curve2", list1, Color.Red, SymbolType.Circle);
// Fill the area under the curve with a white-red gradient at 45 degrees
myCurve.Line.Fill = new Fill(Color.White, Color.Blue, 45F);
// Fill the area under the curve with a white-red gradient at 45 degrees
myCurve2.Line.Fill = new Fill(Color.White, Color.Red, 55F);
// Make the symbols opaque by filling them with white
myCurve.Symbol.Fill = new Fill(Color.White);
// Make the symbols opaque by filling them with white
myCurve2.Symbol.Fill = new Fill(Color.White);
// Fill the axis background with a color gradient
myPane.Chart.Fill = new Fill(Color.White, Color.LightGoldenrodYellow, 45F);
// Fill the pane background with a color gradient
myPane.Fill = new Fill(Color.White, Color.FromArgb(220, 220, 255), 45F);
// Calculate the Axis Scale Ranges
zgc.AxisChange();
}