|
@@ -1,61 +0,0 @@
|
|
|
-using System;
|
|
|
-using System.Collections.Generic;
|
|
|
-using System.Linq;
|
|
|
-using System.Runtime.CompilerServices;
|
|
|
-using System.Text;
|
|
|
-using System.Threading.Tasks;
|
|
|
-using System.Windows;
|
|
|
-using System.Windows.Controls;
|
|
|
-using System.Windows.Data;
|
|
|
-using System.Windows.Documents;
|
|
|
-using System.Windows.Forms.DataVisualization.Charting;
|
|
|
-using System.Windows.Input;
|
|
|
-using System.Windows.Media;
|
|
|
-using System.Windows.Media.Imaging;
|
|
|
-using System.Windows.Navigation;
|
|
|
-using System.Windows.Shapes;
|
|
|
-using System.Web;
|
|
|
-
|
|
|
-namespace ROGOZ.Pages
|
|
|
-{
|
|
|
- /// <summary>
|
|
|
- /// Логика взаимодействия для Chart.xaml
|
|
|
- /// </summary>
|
|
|
- public partial class Chart : Page
|
|
|
- {
|
|
|
- private user1Entities _context = new user1Entities();
|
|
|
- List<string> listStatus = new List<string>()
|
|
|
- {
|
|
|
- "запланирована", "выполнена", "отменена", "исполняется"
|
|
|
- };
|
|
|
-
|
|
|
- public Chart()
|
|
|
- {
|
|
|
- InitializeComponent();
|
|
|
- ChartPayments.ChartAreas.Add(new ChartArea("Main"));
|
|
|
-
|
|
|
- var currentSeries = new Series("Количество")
|
|
|
- {
|
|
|
- IsValueShownAsLabel = true
|
|
|
- };
|
|
|
- ChartPayments.Series.Add(currentSeries);
|
|
|
-
|
|
|
- ComboExecutor.ItemsSource = listStatus;
|
|
|
- ComboChartTypes.ItemsSource = Enum.GetValues(typeof(SeriesChartType));
|
|
|
- }
|
|
|
-
|
|
|
- private void UpdateChart(object sender, SelectionChangedEventArgs e)
|
|
|
- {
|
|
|
- if (ComboExecutor.SelectedItem is string value &&
|
|
|
- ComboChartTypes.SelectedItem is SeriesChartType chartType)
|
|
|
- {
|
|
|
- Series currentSeries = ChartPayments.Series.FirstOrDefault();
|
|
|
- currentSeries.ChartType = chartType;
|
|
|
- currentSeries.Points.Clear();
|
|
|
-
|
|
|
- var categoriesList = _context.Task.ToList();
|
|
|
- currentSeries.Points.AddXY(value, categoriesList.Where(x=>x.Status == value).Count());
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
-}
|