0

I want to set the scale the graphs related to values that I entered them to textboxes. If I don't enter any value, the graphs should be auto-scaled. Here is the codes that I was trying:
var y1 = graphPane1.AddYAxis("YAxis-1");

    var y2 = graphPane1.AddYAxis("YAxis-2");

    var y3 = graphPane1.AddYAxis("YAxis-3");


    LineItem myCurve1 = graphPane1.AddCurve(txtPlotTitle.Text, first_pointsList, Color.Blue, SymbolType.None);

    myCurve.YAxisIndex = y1;         

    graphPane1.YAxisList[y1].Scale.Min = double.Parse(textBox1.Text);
    graphPane1.YAxisList[y1].Scale.Max = double.Parse(textBox2.Text);



    LineItem myCurve2 = graphPane1.AddCurve(txtPlotTitle.Text, second_pointsList, Color.Yellow, SymbolType.None);

    myCurve2.YAxisIndex = y2;
    graphPane1.YAxisList[y2].Scale.Min = double.Parse(textBox3.Text);
    graphPane1.YAxisList[y2].Scale.Max = double.Parse(textBox4.Text);



   LineItem myCurve3 = graphPane1.AddCurve(txtPlotTitle.Text, third_pointsList, Color.Green, SymbolType.None);

    myCurve3.YAxisIndex = y3;
    graphPane1.YAxisList[y3].Scale.Min = double.Parse(textBox5.Text);
    graphPane1.YAxisList[y3].Scale.Max = double.Parse(textBox6.Text);

1 Answers1

0

When the text values are empty you will need to set the Scale.MinAuto and Scale.MaxAuto properties to true, then call GraphPane.AxisChange to scale the axis automatically.

discomurray
  • 14,411
  • 1
  • 21
  • 11