Windows 10 Home, Pro, Enterprise, Education, S или IoT Core — выберите вариант, соответствующий вашим задачам.
Независимо от того, хотите вы обновиться до Windows 10, приобрести новый компьютер или просто переустановить систему, вам понадобится выбрать редакцию. У этой ОС есть четыре главные редакции и ещё пара побочных. Разбираемся, чем они отличаются и кому подходят.
Выбор разрядности системы
Прежде чем выбирать редакцию Windows, нужно определить разрядность системы. Microsoft предоставляет 32-разрядную версию Windows 10 для старых процессоров и 64-разрядную — для новых.
Грубо говоря, если ваш компьютер был создан после 2007 года, он скорее всего оснащён 64-разрядным процессором. Полное руководство по определению разрядности процессора вы можете посмотреть здесь.
Выбор подходящей редакции
Windows 10 Home
Начальная редакция Windows 10, предустановленная на большинстве компьютеров и ноутбуков, которые можно найти в продаже. Эта версия не имеет продвинутых инструментов для обеспечения безопасности бизнес-данных, как в старших редакциях, но они не особенно-то и нужны домашним пользователям.
В Home Edition есть все универсальные приложения от Microsoft, такие как «Календарь», «Почта», «Карты», «Фильмы» и «Фотографии».
Основной недостаток Windows 10 Home Edition — наличие рекламных приложений, которые время от времени автоматически устанавливаются в ваше меню «Пуск». Впрочем, при желании их можно удалить.
Лицензия на Домашнюю версию Windows 10 стоит 9 499 рублей.
Кому выбрать: Windows 10 Home Edition подойдёт большинству обычных пользователей. Да, в ней нет встроенных инструментов для шифрования, но при желании вы можете установить самостоятельно сторонние программы.
Windows 10 Home в Microsoft Store →
Windows 10 Pro
Windows 10 Pro — более продвинутая редакция ОС от Microsoft. Она содержит все те же инструменты и приложения, что и Home Edition, плюс несколько дополнительных функций:
- Инструмент Microsoft Hyper‑V. Используется для запуска операционных систем семейств Windows и Linux в виртуальных машинах. Полезен для разработчиков и системных администраторов, которые занимаются тестированием ПО. Обычные пользователи предпочтут применять для экспериментов более понятный VirtualBox.
- Центр обновления Windows Update for Business. Предоставляет некоторые дополнительные обновления вдобавок к тем, что доступны в редакции Home. Кроме того, позволяет откладывать установку обновлений.
- Средства безопасности Device Guard и Secure Boot. Device Guard предназначен для защиты от атак нулевого дня и полиморфных вирусов. Secure Boot защищает от буткитов, которые могут запуститься вместе с системой во время включения компьютера.
- BitLocker. Инструмент для шифрования данных. При желании можно зашифровать хоть всю систему целиком. Полезно для тех, кто хранит на компьютере важные рабочие файлы и опасается, что они окажутся не в тех руках.
- Управление групповыми политиками. Используется для работы с настройками множества компьютеров через локальную сеть. Необходимо системным администраторам.
Лицензия на Профессиональную версию Windows 10 стоит 14 199 рублей.
Кому выбрать: Windows 10 Pro ориентирована на малые предприятия. Но и обычные пользователи могут приобрести эту редакцию, если нуждаются в продвинутых инструментах безопасности и шифрования.
Windows 10 Pro в Microsoft Store →
Windows 10 Enterprise
Windows 10 Enterprise рассчитана на корпоративное применение. Она включает в себя тот же набор инструментов, что и Windows Pro. Но, помимо этого, редакция Enterprise предоставляет доступ к обновлениям Long-Term Service Branch (LTSB). Это означает, что на ваш компьютер будут устанавливаться только проверенные и самые стабильные обновления, к тому же вы сможете откладывать их получение.
В Windows 10 Enterprise отсутствуют универсальные приложения вроде «Почты», «Календаря», «Карт» и других. Кроме того, на устройства с такой операционной системой не устанавливаются рекламные приложения.
Цена на Windows 10 Enterprise зависит от количества копий, которые вы желаете приобрести. Сначала вам придётся установить на свои компьютеры Windows 10 Pro, а уж потом обновить её до Windows 10 Enterprise. Найти сертифицированных поставщиков и уточнить цены можно на сайте Microsoft или по телефону в Центре лицензирования Microsoft.
Кому выбрать: Windows 10 Enterprise разработана специально для средних и крупных предприятий и организаций. Для обычных пользователей её возможностей будет многовато.
Windows 10 Enterprise на сайте Microsoft →
Windows 10 Education
Это редакция Windows 10 для образовательных учреждений. В общем и целом она похожа на Windows 10 Enterprise, но в ней отсутствует возможность присоединиться к каналу обновлений LTSB. Упор в этой редакции Windows делается на предоставление инструментов для студентов и преподавателей.
Здесь есть приложение для настройки учебных компьютеров и инструмент для проведения тестов и экзаменов. Кроме того, пользователи Windows 10 Education получают доступ к образовательному разделу магазина Microsoft Store.
Версия доступна только через академическое лицензирование. Вам придётся сначала установить Windows 10 Home или Pro, а затем обновиться до Education.
Кому выбрать: владельцам академических учреждений. Ориентация на образовательные приложения обычным пользователям точно ни к чему.
Windows 10 Education на сайте Microsoft →
Windows 10 S
Строго говоря, Windows 10 S — это не редакция, а особый режим для Windows 10 Home или Pro, который вы можете включить, если у вас вдруг возникнет такое желание. Он доступен также в редакциях Enterprise и Education.
В Windows 10 S ограничен набор доступных приложений. Вы можете использовать только те варианты, которые устанавливаются из Microsoft Store. Просматривать страницы в интернете здесь можно только через браузер Edge. Благодаря таким ограничениям Windows 10 S значительно легче и быстрее полноценных версий ОС, но вам придётся работать только с теми инструментами, что предлагает в своём магазине Microsoft.
Этот режим чаще всего применяется на планшетах и ноутбуках-трансформерах.
Кому выбрать: Windows 10 S используют те, на чьих устройствах она уже установлена. Конечно, вы можете установить её где захотите, но приготовьтесь столкнуться с рядом ограничений.
Windows 10 S на сайте Microsoft →
Windows 10 IoT Core
Windows 10 IoT Core (IoT означает Internet of Things, «Интернет вещей») предназначена для установки на разнообразные устройства и гаджеты. Хотите запрограммировать какого-нибудь робота, собранного вами, переоборудовать своё старое радио, обеспечив ему доступ в интернет, установить Windows на свой медиацентр или собственноручно создать устройство на базе Arduino? Воспользуйтесь Windows 10 IoT Core. Версия подходит и для различных однопалатных компьютеров, таких как Arrow DragonBoard 410c и Raspberry Pi 3.
Кому выбрать: Windows 10 IoT Core предназначена для опытных пользователей, которые увлекаются электроникой. Кроме того, она пригодится, если вы создаёте какой-нибудь высокотехнологичный стартап.
Windows 10 IoT Core на сайте Microsoft →
Доброго времени суток! В данной статье мы рассмотрим, как можно создавать графики в WinForms C#.
В качестве платформы примера нужно взять .Net Framework 4.8. Далее в ссылки проекта необходимо добавить
ссылку на сборку System.Windows.Forms.DataVisualization.
Для этого нужно в обозревателе решений нажать правой мыши на элемент меню Ссылки и далее Добавить ссылку.
В открывшемся окне необходимо найти сборку и выделить ее галочкой. В панели элементов должен появиться новый элемент — Chart.
Обратите внимание, что проект должен быть для версии .Net Framework 4.*.
Теперь рассмотрим пример кода:
using System.Windows.Forms;
using System.Windows.Forms.DataVisualization.Charting;
namespace ChartsWinForms
{
public partial class MainForm : Form
{
public MainForm()
{
InitializeComponent();
string[] daysOfWeek = { "Понедельник", "Вторник", "Среда", "Четверг", "Пятница", "Суббота", "Воскресенье" };
int[] numberOfVisitors = { 1200, 1450, 1504, 1790, 2450, 1900, 3050 };
// Установим палитру
chart.Palette = ChartColorPalette.SeaGreen;
// Заголовок графика
chart.Titles.Add("Посетители");
// Добавляем последовательность
for (int i = 0; i < daysOfWeek.Length; i++)
{
Series series = chart.Series.Add(daysOfWeek[i]);
// Добавляем точку
series.Points.Add(numberOfVisitors[i]);
}
}
}
}
Таким образом, вот так просто можно создавать графики в WinForms C#.
-
Создано 16.03.2023 13:36:01
-
Михаил Русаков
Копирование материалов разрешается только с указанием автора (Михаил Русаков) и индексируемой прямой ссылкой на сайт (http://myrusakov.ru)!
Добавляйтесь ко мне в друзья ВКонтакте: http://vk.com/myrusakov.
Если Вы хотите дать оценку мне и моей работе, то напишите её в моей группе: http://vk.com/rusakovmy.
Если Вы не хотите пропустить новые материалы на сайте,
то Вы можете подписаться на обновления: Подписаться на обновления
Если у Вас остались какие-либо вопросы, либо у Вас есть желание высказаться по поводу этой статьи, то Вы можете оставить свой комментарий внизу страницы.
Если Вам понравился сайт, то разместите ссылку на него (у себя на сайте, на форуме, в контакте):
-
Кнопка:
Она выглядит вот так:
-
Текстовая ссылка:
Она выглядит вот так: Как создать свой сайт
- BB-код ссылки для форумов (например, можете поставить её в подписи):
In this Article, We will see How to use the Chart control in Windows Form Application. As we know that Charts and Graphs makes data easier to understand and interpret. Chart is used to present the data in visual form.
Let’s Begin:
1. Open Visual Studio (I am using Visual Studio 2012) and Create new Windows Form Application (.NET Framework 4).
2. Drop Chart control from Toolbox present in the Data tab.
3. Go to Chart properties -> Click on Series.
Change the Name of Series. Here, I set Name as Salary. We can also change the ChartType as well as appearance from the Series Collection Editor.
Go to Form1.cs Code and add these line of code:
using System;
using
System.Windows.Forms;
namespace DemoChart
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
fillChart();
}
//fillChart method
private void fillChart()
{
//AddXY value in chart1 in series named as Salary
chart1.Series[«Salary»].Points.AddXY(«Ajay», «10000»);
chart1.Series[«Salary»].Points.AddXY(«Ramesh», «8000»);
chart1.Series[«Salary»].Points.AddXY(«Ankit», «7000»);
chart1.Series[«Salary»].Points.AddXY(«Gurmeet», «10000»);
chart1.Series[«Salary»].Points.AddXY(«Suresh», «8500»);
//chart title
chart1.Titles.Add(«Salary
Chart»);
}
}
}
Preview:
Displaying Data in Chart control from the Database in Windows Form Application:
1. Create a Database (named as Sample). Add a Table tbl_EmpSalary. The following is the table schema for creating tbl_EmpSalary.
Follow above steps. Add these lines of Code in Form1.cs Code:
using System;
using
System.Windows.Forms;
using System.Data;
using
System.Data.SqlClient;
namespace DemoChart
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
fillChart();
}
//fillChart method
private void fillChart()
{
SqlConnection con =
new SqlConnection(«Data Source=.;Initial Catalog=Sample;Integrated
Security=true;»);
DataSet ds = new DataSet();
con.Open();
SqlDataAdapter adapt
= new SqlDataAdapter(«Select Name,Salary from tbl_EmpSalary», con);
adapt.Fill(ds);
chart1.DataSource = ds;
//set the member of the chart data source used to data
bind to the X-values of the series
chart1.Series[«Salary»].XValueMember = «Name»;
//set the member columns of the chart data source used
to data bind to the X-values of the series
chart1.Series[«Salary»].YValueMembers = «Salary»;
chart1.Titles.Add(«Salary
Chart»);
con.Close();
}
}
}
Final Preview:
Hope you like it. Thanks.
[Download Source Code via Google Drive]
Reports are one of those things that everyone has done at some point in time using a variety of methods to include, Excel, XML, CSV, HTML, etc.… A lot of times, while the data is one thing to present, there are times when we need to just present a snapshot of information, usually in the form of a chart of some kind. This is where we usually will dig into Excel and its COM object to take the data and create a quick chart to show the data. But doing this can be slow as working with COM objects are notoriously slow (they are much faster with PowerShell V5), so another approach might be better instead. Enter the .Net Chart Controls which gives us a way to take the data that we have and quickly create a chart such as a pie chart or a line chart and present the data with little to no effort on the system.
What Kind of Charts are Available?
There are a little over 30 possible charts at your disposal ranging from a pie chart to a bar chart or even a bubble chart if you wanted one.
Some of these charts like the Pie and Doughnut have a lot in common and you can use the same type of approach with the data to quickly present information while working with a Line chart might require a little more work to ensure the data is presented accurately and also provides support for multiple “Series” of data which allows for you to provide a comparison between different points of time for your data (useful in column or bar charts). For a better look at each chart type and the expectations associate with each chart (such as number of series allowed), the following link has the information to look at: https://msdn.microsoft.com/en-us/library/dd489233.aspx
What is a Series of Data?
A series of data can be looked at as different captures of data that will be applied to a chart. One example is that you can track the current capacity (Series1) of a hard drive as well as its current drive usage (Series2) over the course of several months and see how the current drive usage changes during the course of the time. Given, the capacity may not change at all if it is a physical drive, but may change if the drive is a virtual drive or SAN attached. Something like this would make for a good line chart.
Another example would be to track the memory (or CPU) utilization of several processes. Here you would take a reading at the beginning (Series1) and then wait maybe a minute or so and take another reading (Series2). From these two samples, you can then display the results as a Bar chart or a Column chart to get an idea of the differences in values, if there happen to be differences.
Where do I begin?
Glad you asked. If you are running PowerShell V3+ then you are good to go and have everything already installed, but if you happen to be running PowerShell 2.0, then odds are you might need to download and install the required bits for the Microsoft Chart Controls for Microsoft .NET Framework 3.5 here.
Let’s Build a Pie Chart!
Building a Pie chart is pretty simply as we only require a single series of data which will consist of a label for the data and its value. In this case we are going to chart out our processes by their WorkingSet (WS) property to see what our top 10 memory hogs are.
$Processes = Get-Process | Sort-Object WS -Descending | Select-Object -First 10
Now we need to do a few other things before we start diving into the world of chart controls. First off I am going to define a couple of helper functions that will assist in some areas.
Edit (10/02/2016): Using a hashtable originally was probably a bad idea when you consider multiple same named processes (or anything that is used more than once with the same name) as it one will just overwrite the next meaning the last one will win. I have since taken out the ability to create the hashtable and used a different approach.
#region Helper Functions Function Invoke-SaveDialog { $FileTypes = [enum]::GetNames('System.Windows.Forms.DataVisualization.Charting.ChartImageFormat')| ForEach { $_.Insert(0,'*.') } $SaveFileDlg = New-Object System.Windows.Forms.SaveFileDialog $SaveFileDlg.DefaultExt='PNG' $SaveFileDlg.Filter="Image Files ($($FileTypes))|$($FileTypes)|All Files (*.*)|*.*" $return = $SaveFileDlg.ShowDialog() If ($Return -eq 'OK') { [pscustomobject]@{ FileName = $SaveFileDlg.FileName Extension = $SaveFileDlg.FileName -replace '.*\.(.*)','$1' } } } #endregion Helper Functions
Next up is loading the required types to work with the chart controls as well as the windows forms.
Add-Type -AssemblyName System.Windows.Forms Add-Type -AssemblyName System.Windows.Forms.DataVisualization
If you are still using the old way ([void][Reflection.Assembly]::LoadWithPartialName(“System.Windows.Forms.DataVisualization”)) then you should look at using Add-Type instead.
Next up is to set create our Chart, ChartArea and Series objects as well as making it easier to find all of our available charts by saving the Enum to a variable.
$Chart = New-object System.Windows.Forms.DataVisualization.Charting.Chart $ChartArea = New-Object System.Windows.Forms.DataVisualization.Charting.ChartArea $Series = New-Object -TypeName System.Windows.Forms.DataVisualization.Charting.Series $ChartTypes = [System.Windows.Forms.DataVisualization.Charting.SeriesChartType]
Now picking a chart is as simple as using $ChartTypes:
$Series.ChartType = $ChartTypes::Pie
With this, we have defined our series as being a Pie chart (default is a line chart). What is interesting here is that we are not defining our chart type where you would have expected it to be at (in the $Chart) but instead define it within the Series object. Now we do end up placing the Series object within the chart and then the Chart within the ChartArea. Note:I don’t actually need a ChartArea with a Pie chart, but am including this for the sake of covering all of the pieces of the chart build.
$Chart.Series.Add($Series) $Chart.ChartAreas.Add($ChartArea)
You can almost visually see how these all stack within one another.
I want to ensure that the Name (X axis) is the Name of the process and that the WS (Y axis) is the WS property which holds the data value. This way, when we apply it to the series, the pie chart control will understand how to present the data.
Note that I am using the DataBindXY method to load my data. The first item in the method parameter has to be the X value which is my label and the Y axis is the corresponding data. Because I am using PowerShell V4+, I can get away with just specifying the property name and it will automatically unroll the values of each property.
$Chart.Series['Series1'].Points.DataBindXY($Process.Name, $Process.WS)
The ‘Series1’ is a default name for the series (you can name it something else if you wish) and any subsequent series added will be Series2,3,4 and so forth if left at the default names.
With the data added for our pie chart, I can now work to make some adjustments to the size of the chart as well as its position and background color.
$Chart.Width = 700 $Chart.Height = 400 $Chart.Left = 10 $Chart.Top = 10 $Chart.BackColor = [System.Drawing.Color]::White $Chart.BorderColor = 'Black' $Chart.BorderDashStyle = 'Solid'
All good charts should have a title, right? How else would we know what the chart might be about if a title is not there to tell us what is going on. With that in mind, we will add a title that gives a brief description about what is being displayed.
$ChartTitle = New-Object System.Windows.Forms.DataVisualization.Charting.Title $ChartTitle.Text = 'Top 5 Processes by Working Set Memory' $Font = New-Object System.Drawing.Font @('Microsoft Sans Serif','12', [System.Drawing.FontStyle]::Bold) $ChartTitle.Font =$Font $Chart.Titles.Add($ChartTitle)
Typically, if I want to add a legend along with a pie chart, I will avoid having anything on the actual chart itself and leave the description for each piece to be in the legend. This is just a personal preference, but if you want, you can certainly have both. With that in mind, I will show two alternative approaches for the chart display with and without the legend.
Using a Legend
As I am using a legend here, I want to avoid any data from being displayed on the chart itself, so I will make sure to disable the pie chart styles.
$Chart.Series[‘Series1’][‘PieLabelStyle’] = ‘Disabled’
The next step is to set up my legend so it displays useful information.
$Legend = New-Object System.Windows.Forms.DataVisualization.Charting.Legend $Legend.IsEquallySpacedItems = $True $Legend.BorderColor = 'Black' $Chart.Legends.Add($Legend) $chart.Series["Series1"].LegendText = "#VALX (#VALY)"
And now I have my configurations completed for including a legend with my chart. Note that the VALX will display the values of the X axis while the VALY displays the Y value. So in this case I will have the Process name as VALX and the Working Set (WS) memory as VALY in the parentheses.
Avoiding a Legend
Ok, so adding a legend wasn’t really in the cards and we just want to show the chart, but at the still time have the items labeled so we know what the pieces of the pie mean. Simple enough, we will just add some more configurations to add the data point labels.
$Chart.Series['Series1']['PieLineColor'] = 'Black' $Chart.Series['Series1']['PieLabelStyle'] = 'Outside' $Chart.Series['Series1'].Label = "#VALX (#VALY)"
Now we are set! All that is really left to do is display the results of our work. But before we do that, we need to define a WinForm object that will host the chart object and properly display our work.
#region Windows Form to Display Chart $AnchorAll = [System.Windows.Forms.AnchorStyles]::Bottom -bor [System.Windows.Forms.AnchorStyles]::Right -bor [System.Windows.Forms.AnchorStyles]::Top -bor [System.Windows.Forms.AnchorStyles]::Left $Form = New-Object Windows.Forms.Form $Form.Width = 740 $Form.Height = 490 $Form.controls.add($Chart) $Chart.Anchor = $AnchorAll # add a save button $SaveButton = New-Object Windows.Forms.Button $SaveButton.Text = "Save" $SaveButton.Top = 420 $SaveButton.Left = 600 $SaveButton.Anchor = [System.Windows.Forms.AnchorStyles]::Bottom -bor [System.Windows.Forms.AnchorStyles]::Right # [enum]::GetNames('System.Windows.Forms.DataVisualization.Charting.ChartImageFormat') $SaveButton.add_click({ $Result = Invoke-SaveDialog If ($Result) { $Chart.SaveImage($Result.FileName, $Result.Extension) } }) $Form.controls.add($SaveButton) $Form.Add_Shown({$Form.Activate()}) [void]$Form.ShowDialog() #endregion Windows Form to Display Chart
The result is a chart that we can display to people with the added bonus of being able to save it via a save button.
With Legend
Without Legend
A 3D Touch
If you want to give this a little better look by making the chart 3D, then you can add the following code to your chart configuration to make it a little more eye popping. And yes, we finally managed to sneak in some use of the $ChartArea in this demo.
$ChartArea.Area3DStyle.Enable3D=$True $ChartArea.Area3DStyle.Inclination = 50
And just like that, instant 3D chart!
Saving a File
But what if I wanted to save a file instead? That’s fine, we can completely skip the process of creating the WinForm and instead make use of the builtin SaveImage method and supplying the file name as well as the extension of the file to save the image as a specific file type.
We can find the supported values here:
[enum]::GetValues([System.Windows.Forms.DataVisualization.Charting.ChartImageFormat])
Now we can save the chart using the code below:
$Chart.SaveImage('C:\temp\chart.jpeg', 'jpeg')
Where is My Cool Function at?
Yea, so about that function. I decided instead of just building a function to display a pie chart, that I would instead work on and build a module that would allow you to use a variety of charts instead! Stay tuned to https://github.com/proxb/PoshCharts (look at the Dev branch) and you will soon see a working module that not only does pie charts like shown today, but others such as a bar or line chart! Being that this is still in development, I don’t really have any help put together…yet. But as soon as this is more polished I will be updating this blog post (and posting another blog) so you can check it out! And as always, if anyone wants to dive in and help with this, then fork the repo and submit some Pull Requests and I will work to get them merged.
“
В этом уроке поговорим о том, как можно визуализировать информацию с помощью графиков. Для этого будем использовать приложение WPF и элементы Windows Forms.
Для успешного освоения материала рекомендуем вам изучить следующие понятия:
DB (Database), БД. Организованная структура, предназначенная для хранения, изменения и обработки взаимосвязанной информации, преимущественно больших объемов
Framework. Программная платформа, определяющая структуру программной системы; программное обеспечение, облегчающее разработку и объединение разных компонентов большого программного проекта
Windows Presentation Foundation. Аналог WinForms, система для построения клиентских приложений Windows с визуально привлекательными возможностями взаимодействия с пользователем, графическая (презентационная) подсистема в составе .NET Framework (начиная с версии 3.0), использующая язык XAML
Демонстрация работы с графиками в Windows Forms
На данном занятии будет разработано простое приложение Windows Forms для визуализации расходов пользователей. Пользователи распределяют затраты по разным категориям и хранят их в общей базе данных. Итогом работы приложения будет служить работающая форма, в которой для каждого пользователя можно построить диаграммы различных типов для визуализации их расходов по категориям. Основные шаги построения приложения:
- Разработка интерфейса приложения
- Настройка взаимодействия с базой данных
- Реализация обработки данных
Важно
В рамках примера используется готовая база данных с информацией о пользователях, их платежах и категориях расходов
Разработка интерфейса приложения
1. Устанавливаем структуру формы
Важно
Интерфейс приложения будет состоять из двух основных частей: области построения и области настройки параметров просмотра
2. Добавляем элементы настройки параметров просмотра
Важно
Элементами настройки параметров просмотра будут являться выпадающие списки, позволяющие выбрать пользователя и тип диаграммы
3. Подключаем библиотеки для просмотра диаграмм
Важно
Диаграмма будет визуализироваться с помощью элемента Chart из WindowsForms. Воспользоваться данным элементом можно после подключения библиотеки System.Windows.Forms.DataVisualization, расположенного во вкладке Assemblies (сборки)
4. Добавляем элементы управления диаграммой
Важно
Диаграмма будет располагаться внутри элемента WindowsFormsHost. Данный элемент добавляется из окна ToolBox простым перетаскиванием
5. Добавляем пространство имен для работы с элементом Chart
6. Добавляем дополнительные параметры просмотра
Важно
Дополнительными параметрами являются имя диаграммы, а также легенда
Настройка взаимодействия с базой данных
1. Реализуем взаимодействие с базой данных
Важно
Взаимодействие реализуется путем добавления элемента «ADO.NET Entity Data Model»
2. Настраиваем свойства подключения базы данных
3. Добавляем подключение к базе данных
Реализация обработки данных
1. Создаем область построения графиков
Важно
Сперва создается поле для контекста EntityFramework с инициализацией. Затем создается область построения диаграммы ChartArea и добавляется в соответствующую коллекцию в конструкторе MainWindow
2. Добавляем наборы данных
Важно
Для каждого набора данных (например, данные линии на графике) необходимо добавлять в коллекцию Series. В данном случае есть одна серия данных для отображения сумм платежей по категориям. Объект Series создается с указанием названия и необходимости отображения на диаграмме
3. Загружаем данные из базы
Важно
Данные о пользователях загружаются в выпадающий список. Также загружаются типы диаграммы из перечисления SeriesChartType
4. Реализуем адаптивное изменение интерфейса
Важно
При выборе другого значения в ComboBox будет вызываться метод UpdateChart()
5. Получаем выбранные значения в выпадающих списках
Важно
Значения получаются как currentUser и currentType
6. Обрабатываем данные диаграммы
Важно
Приведенный код описывает получение серии данных диаграммы из соответствующей коллекции Series, установку типа диаграммы и очистку предыдущих данных
7. Обрабатываем список категорий
Важно
Список категорий получается из базы данных. Далее, в цикле foreach для каждой категории значение точки диаграммы добавляется в Points. Координата X будет названием категории, а координата Y будет суммой платежа для выбранного пользователя в текущей категории
Результат работы программы
“
Вы познакомились с тем, как использовать основные элементы Windows Forms в приложении WPF. Теперь давайте перейдем от теории к практике!
Для закрепления полученных знаний пройдите тест
Для взаимодействия с базами данных используется технология
Для размещение элемента управления Windows Forms на странице WPF используется
WindowsFormsIntegration является
К сожалению, вы ответили неправильно
Прочитайте лекцию и посмотрите видео еще раз
Но можно лучше. Прочитайте лекцию и посмотрите видео еще раз
Вы отлично справились. Теперь можете ознакомиться с другими компетенциями