public My_Diet_Graph()<br/>
{<br/>
InitializeComponent();<br/>
CreateGraph(my_starting_point_weight);<br/>
}
public double CreateGraph(double start_point_weight)<br/>
{<br/>
GraphPane myPane = zedGraphControl1.GraphPane; // thats it.. i see its like i wanted to create new control or something insterad using the on e existed.ok<br/>
// MessageBox.Show("test" + start_point_weight);<br/>
my_starting_point_weight = start_point_weight;<br/>
myPane.Title.Text = "My Diet Tracking Graph";<br/>
myPane.XAxis.Title.Text = "Date/Time";<br/>
myPane.YAxis.Title.Text = "Weight";<br/>
double[] list1 = {a };<br/>
double[] list2 = {i };<br/>
LineItem myCurve = myPane.AddCurve("Porsche",list1, list2 ,Color.Red, SymbolType.Diamond);<br/>
myCurve.AddPoint(my_starting_point_weight, my_starting_point_weight);<br/>
myPane.Chart.Fill = new Fill(Color.White, Color.LightGoldenrodYellow, 45F);<br/>
myPane.Fill = new Fill(Color.White, Color.FromArgb(220, 220, 255), 45F);<br/>
myPane.AxisChange();<br/>
return start_point_weight;<br/>
}
In form1 i set a number and if its larger then 0 its returning the value to public double CreateGraph(double start_point_weight)<br/>
The return start_point_weight;
I used breakpoint there and its realy returning the number i selecet in form1
The problem is this is a control where the value is returning and i need to use the CreateGraph in the construstor here to make the changes display on the designer.
But now the function is returning a value and i cant just put in the constructor CreateGraph(); its asking for a value inside.
So i tried to make CreateGraph(my_starting_point_weight); but the value of my_starting_point_weight is allways 0.0
What can i do?
Thanks.
<hr class="sig danieli
View the full article
{<br/>
InitializeComponent();<br/>
CreateGraph(my_starting_point_weight);<br/>
}
public double CreateGraph(double start_point_weight)<br/>
{<br/>
GraphPane myPane = zedGraphControl1.GraphPane; // thats it.. i see its like i wanted to create new control or something insterad using the on e existed.ok<br/>
// MessageBox.Show("test" + start_point_weight);<br/>
my_starting_point_weight = start_point_weight;<br/>
myPane.Title.Text = "My Diet Tracking Graph";<br/>
myPane.XAxis.Title.Text = "Date/Time";<br/>
myPane.YAxis.Title.Text = "Weight";<br/>
double[] list1 = {a };<br/>
double[] list2 = {i };<br/>
LineItem myCurve = myPane.AddCurve("Porsche",list1, list2 ,Color.Red, SymbolType.Diamond);<br/>
myCurve.AddPoint(my_starting_point_weight, my_starting_point_weight);<br/>
myPane.Chart.Fill = new Fill(Color.White, Color.LightGoldenrodYellow, 45F);<br/>
myPane.Fill = new Fill(Color.White, Color.FromArgb(220, 220, 255), 45F);<br/>
myPane.AxisChange();<br/>
return start_point_weight;<br/>
}
In form1 i set a number and if its larger then 0 its returning the value to public double CreateGraph(double start_point_weight)<br/>
The return start_point_weight;
I used breakpoint there and its realy returning the number i selecet in form1
The problem is this is a control where the value is returning and i need to use the CreateGraph in the construstor here to make the changes display on the designer.
But now the function is returning a value and i cant just put in the constructor CreateGraph(); its asking for a value inside.
So i tried to make CreateGraph(my_starting_point_weight); but the value of my_starting_point_weight is allways 0.0
What can i do?
Thanks.
<hr class="sig danieli
View the full article