Muhamad al-xorazmiy nomidgi toshkentaxborot texnalogiyalari universiteti nurafshon filiali



Yüklə 345,86 Kb.
səhifə3/5
tarix30.11.2022
ölçüsü345,86 Kb.
#71598
1   2   3   4   5
Shahboz G\'ayratjonov MB

Button1 tugmasini click xodissasining kodlari quyidagicha:
private: System::Void button1_Click(System::Object^ sender, System::EventArgs^ e) {
dio(); }
void dio(){
this->Text = "Grafik ma'lumotlar";
Tablitsa = gcnew DataTable();
Tablitsa->Columns->Add("Oy", String::typeid);
Tablitsa->Columns->Add("Sotib olingan max.soni",
Int64::typeid); Tablitsa->Columns->Add("Xarajatlar",
Int64::typeid);
Tablitsa->Columns->Add("Daromat", Int64::typeid);
Tablitsa->Columns->Add("Sof daromat", Int64::typeid); DataRow ^ Ryad = Tablitsa->NewRow();
Ryad["Oy"] = dataGridView1->Rows[0]->Cells[0]->Value;
Ryad["Sotib olingan max.soni"] =dataGridView1-
>Rows[0]->Cells[1]->Value;
Ryad["Xarajatlar"] =dataGridView1->Rows[0]->Cells[2]-
>Value; Ryad["Daromat"] =dataGridView1->Rows[0]-
>Cells[3]->Value;
Ryad["Sof daromat"] =Convert::ToInt64(dataGridView1-
>Rows[0]->Cells[3]->Value) -
Convert::ToInt64(dataGridView1->Rows[0]->Cells[2]-
>Value);
Tablitsa->Rows->Add(Ryad);
Ryad = Tablitsa->NewRow();
Ryad["Oy"] = dataGridView1->Rows[1]->Cells[0]->Value;
Ryad["Sotib olingan max.soni"] = dataGridView1-
>Rows[1]->Cells[1]->Value;
Ryad["Xarajatlar"] =dataGridView1->Rows[1]->Cells[2]-
>Value; Ryad["Daromat"] =dataGridView1->Rows[1]-
>Cells[3]->Value;
Ryad["Sof daromat"] =Convert::ToInt64(dataGridView1-
>Rows[1]->Cells[3]->Value) -
Convert::ToInt64(dataGridView1->Rows[1]->Cells[2]-
>Value);
Tablitsa->Rows->Add(Ryad);
Ryad = Tablitsa->NewRow();
Ryad["Oy"] = dataGridView1->Rows[2]->Cells[0]->Value;
Ryad["Sotib olingan max.soni"] = dataGridView1-
>Rows[2]->Cells[1]->Value;
Ryad["Xarajatlar"] =dataGridView1->Rows[2]->Cells[2]-
>Value; Ryad["Daromat"] =dataGridView1->Rows[2]-
>Cells[3]->Value;
Ryad["Sof daromat"] =Convert::ToInt64(dataGridView1-
>Rows[2]->Cells[3]->Value) -
Convert::ToInt64(dataGridView1->Rows[2]->Cells[2]-
>Value);
Tablitsa->Rows->Add(Ryad);
Ryad = Tablitsa->NewRow();
Ryad["Oy"] = dataGridView1->Rows[3]->Cells[0]->Value;
Ryad["Sotib olingan max.soni"] = dataGridView1-
>Rows[3]->Cells[1]->Value;
Ryad["Xarajatlar"] =dataGridView1->Rows[3]->Cells[2]-
>Value; Ryad["Daromat"] =dataGridView1->Rows[3]-
>Cells[3]->Value;
Ryad["Sof daromat"] =Convert::ToInt64(dataGridView1-
>Rows[3]->Cells[3]->Value) -
Convert::ToInt64(dataGridView1->Rows[3]->Cells[2]-
>Value);
Tablitsa->Rows->Add(Ryad);
Ryad = Tablitsa->NewRow();
Ryad["Oy"] = dataGridView1->Rows[4]->Cells[0]->Value;
Ryad["Sotib olingan max.soni"] = dataGridView1-
>Rows[4]->Cells[1]->Value;
Ryad["Xarajatlar"] =dataGridView1->Rows[4]->Cells[2]-
>Value; Ryad["Daromat"] =dataGridView1->Rows[4]-
>Cells[3]->Value;
Ryad["Sof daromat"] =Convert::ToInt64(dataGridView1-
>Rows[4]->Cells[3]->Value) -
Convert::ToInt64(dataGridView1->Rows[4]->Cells[2]-
>Value);
Tablitsa->Rows->Add(Ryad);
chart1->DataSource = Tablitsa;
chart1->Series["Series1"]->XValueMember = "Oy"; chart1->Series["Series2"]->XValueMember = "Oy";
chart1->Series["Series1"]->YValueMembers = "Sotib olingan max.soni";
chart1->Series["Series2"]->YValueMembers = "Sof daromat"; chart1->Series["Series1"]->ChartType =
System::Windows::Forms::DataVisualization::Charting:: SeriesChartType::Column;
chart1->Series["Series2"]->ChartType =
System::Windows::Forms::DataVisualization::Charting:: SeriesChartType::Column;
chart1->Series["Series1"]->Color = Color::Aqua; chart1->Series["Series2"]->Color = Color::Green; //chart1->Series["Series1"]->IsVisibleInLegend = false; chart1->DataBind();
dataGridView1->DataSource = Tablitsa;
}

Yüklə 345,86 Kb.

Dostları ilə paylaş:
1   2   3   4   5




Verilənlər bazası müəlliflik hüququ ilə müdafiə olunur ©azkurs.org 2024
rəhbərliyinə müraciət

gir | qeydiyyatdan keç
    Ana səhifə


yükləyin