|
@@ -23,37 +23,38 @@ namespace ROGOZ.Pages
|
|
|
/// </summary>
|
|
|
public partial class Chart : Page
|
|
|
{
|
|
|
- List<string> ExecutorGrades = new List<string>()
|
|
|
+ private user1Entities _context = new user1Entities();
|
|
|
+ List<string> listStatus = new List<string>()
|
|
|
{
|
|
|
- "junior", "middle", "senior"
|
|
|
+ "запланирована", "выполнена", "отменена", "исполняется"
|
|
|
};
|
|
|
- private user1Entities _context = new user1Entities();
|
|
|
+
|
|
|
public Chart()
|
|
|
{
|
|
|
InitializeComponent();
|
|
|
- ChartTasks.ChartAreas.Add(new ChartArea("Main"));
|
|
|
+ ChartPayments.ChartAreas.Add(new ChartArea("Main"));
|
|
|
|
|
|
- var currentSeries = new Series("Исполнители")
|
|
|
+ var currentSeries = new Series("Количество")
|
|
|
{
|
|
|
IsValueShownAsLabel = true
|
|
|
};
|
|
|
- ChartTasks.Series.Add(currentSeries);
|
|
|
+ ChartPayments.Series.Add(currentSeries);
|
|
|
|
|
|
- ComboExecutor.ItemsSource = ExecutorGrades;
|
|
|
+ ComboExecutor.ItemsSource = listStatus;
|
|
|
ComboChartTypes.ItemsSource = Enum.GetValues(typeof(SeriesChartType));
|
|
|
}
|
|
|
|
|
|
private void UpdateChart(object sender, SelectionChangedEventArgs e)
|
|
|
{
|
|
|
- if (ComboExecutor.SelectedItem is string grade &&
|
|
|
+ if (ComboExecutor.SelectedItem is string value &&
|
|
|
ComboChartTypes.SelectedItem is SeriesChartType chartType)
|
|
|
{
|
|
|
- Series currentSeries = ChartTasks.Series.FirstOrDefault();
|
|
|
+ Series currentSeries = ChartPayments.Series.FirstOrDefault();
|
|
|
currentSeries.ChartType = chartType;
|
|
|
currentSeries.Points.Clear();
|
|
|
|
|
|
- var categoriesList = _context.Executor.ToArray();
|
|
|
- currentSeries.Points.AddXY(grade, categoriesList.Where(x=>x.Grade == grade).Count());
|
|
|
+ var categoriesList = _context.Task.ToList();
|
|
|
+ currentSeries.Points.AddXY(value, categoriesList.Where(x=>x.Status == value).Count());
|
|
|
}
|
|
|
}
|
|
|
}
|