127
Oybek Mallayev
43.
Qator["Sof daromat"] =Convert::ToInt64(
dataGridView1->Rows[4]->Cells[3]->Value) -Convert::ToInt64(
dataGridView1->Rows[4]->Cells[2]->Value);
44.
Jadval->Rows->Add(Qator);
45.
// chart1 komponentasiga Jadvalni eksport qilish
46.
chart1->DataSource = Jadval;
47.
//chart1 komponentasidagi Serie1 ning X kordinatasiga Oy so'zini
yozish
48.
chart1->Series["Series1"]->XValueMember = "Oy";
49.
// chart1 komponentasidagi Serie1 ning X kordinatasiga Oy
so'zini yozish
50.
chart1->Series["Series2"]->XValueMember = "Oy//chart1
komponentasidagi
51.
//Serie1 ning Y kordinatasiga Sotib olingan max.soni so'zini
yozish
52.
chart1->Series["Series1"]->YValueMembers = "Sotib olingan
max.soni";
53.
// chart1 komponentasidagi Serie2 ning Y kordinatasiga Sof
daromat so'zini yozish
54.
chart1->Series["Series2"]->YValueMembers = "Sof daromat";
55.
chart1->Series["Series1"]->ChartType = System::Windows::Forms::
56.
DataVisualization::Charting::SeriesChartType::Column;
57.
chart1->Series["Series2"]->ChartType = System::Windows::Forms::
58.
DataVisualization::Charting::SeriesChartType::Column;
59.
chart1->Series["Series1"]->Color = Color::Aqua;
60.
chart1->Series["Series2"]->Color = Color::Green;
61.
//chart1->Series["Series1"]->IsVisibleInLegend = false;
62.
chart1->DataBind();
63.
//DadaGridView1 komponentasiga Jadvalni eksport qilish
64.
dataGridView1->DataSource = Jadval;
}
4-qadam. Jadvaldan kiritilgan qiymatlar natijaga darxol ta`sir
qilishi uchun
dataGridView1 ning
CellEndEdit xodisasiga
dio()
funksiyasi chaqiriladi. Ahamiyat bеrilgan bo‘lsa,
button1 ga ham
chaqirilgan edi. Ushbu kod quyidagicha:
1.
private: System::Void dataGridView1_CellEndEdit(System::Object^
2.
sender, System::Windows::Forms::DataGridViewCellEventArgs^ e) {
3.
dio();
}
5-qadam. listBox1da diagrammani ko‘rinishlarini o‘zgartirish
mumkin.
Buning
uchun
listBox
ning
SelectedIndexChanged
hodisasining kodlari quyidagicha bo‘lishi kеrak:
1.
private: System::Void
listBox1_SelectedIndexChanged(System::Object^
2.
sender, System::EventArgs^ e) {
3.
if (listBox1->Text == "Transparent") return;
4.
this->chart1->Series["Series1"]->ChartTypeName=(listBox1->Text) ;
5.
this->chart1->Series["Series2"]->ChartTypeName=(listBox1->Text) ;
}
Dasturda diagrammani ko‘rinishi quyidagicha:
128
Oybek Mallayev
3.39- rasm. Diagrammani sozlash oynasi
3.20. Veb brouzеrda HTML jadvallarni tasvirlash va shakllantirish
Bizga ma`lumki HTML tеglari yordamida vеb ilovalar yaratiladi
va bu ilovalar jamlanib, vеb sayt tashkil etiladi. Vеb ilovalarni yoki
global tarmoqga ulangan saytlarni amaliy dasturda ochish imkonini
bеruvchi komponеnta bu WebBrowser
komponеntasi hisoblanadi.
Ushbu komponеnta orqali nafaqat saytlarni ochish, balki HTML
kodlarida tеrilgan tеkst (tеg) larni ham chiqarish va tahrirlash
imkoniyatlari mavjud. Quyidagi namunada tuziladigan dasturda HTML
tеglari ishlatilgan. Masalan:
Do'stlaringiz bilan baham: