Plotting Datapoints in MS Chart Control

Hi!


private
: System::Void button1_Click(System::Object^ sender, System::EventArgs^ e) {
double^ XValue;
double^ YValue;
chart1->Series->Add(
"Series1");
chart1->Series[
"Series1"]->Color = Color::Green;
chart1->Series[
"Series1"]->ChartType = System::Windows::Forms::DataVisualization::Charting::SeriesChartType::Line;
XValue = Convert::ToDouble(chart1->Series[
"Series1"]->Points->AddXY("X",0));
YValue = Convert::ToDouble(chart1->Series[
"Series1"]->Points->AddXY(0,"Y"));
XValue = Convert::ToDouble(textBox2->Text);
YValue = Convert::ToDouble(textBox5->Text);
textBox3->Text = XValue->ToString();
textBox4->Text = YValue->ToString();}

I am having trouble with graphing arbitrary points from a text box. This is the code I have so far. Can anyone help?


Topic archived. No new replies allowed.