예제 #1
0
        private void DesignBarGraph()
        {
            ResultsPlot.Series.Clear();
            ResultsPlot.Axes.Clear();
            ResultsPlot.PlotMargins = new OxyThickness(55, 15, 15, 15);
            int numberOfPictures = _resultSet.GetNumberOfAnalyzedPictures();
            var regrouppedProp   = GrouppedProperties.GroupBy(i => i.ExifCode);

            foreach (var exifGroup in regrouppedProp)
            {
                BarSeries series = new BarSeries();
                series.StrokeColor    = OxyColors.Black;
                series.LabelPlacement = LabelPlacement.Inside;
                CategoryAxis categoryAxis = new CategoryAxis();
                categoryAxis.Position = AxisPosition.Left;
                categoryAxis.Angle    = -45;
                categoryAxis.FontSize = 11;
                foreach (GrouppedProperty property in exifGroup)
                {
                    BarItem item = new BarItem();
                    item.Value = property.Count;
                    series.Items.Add(item);
                    categoryAxis.Labels.Add(property.Value);
                }
                var valueAxis = new LinearAxis
                {
                    Position         = AxisPosition.Bottom,
                    MinimumPadding   = 0,
                    MaximumPadding   = 2.5,
                    AbsoluteMinimum  = 0,
                    Maximum          = numberOfPictures,
                    Unit             = "Photos",
                    MinimumMajorStep = 1,
                    MinimumMinorStep = 1
                };
                ResultsPlot.Series.Add(series);
                ResultsPlot.Axes.Add(categoryAxis);
                ResultsPlot.Axes.Add(valueAxis);
            }
            ResultsPlot.InvalidatePlot(true);
        }
 private void OnStartAnalysis()
 {
     _resultSet.SetAnalyzedFolder(_curPath);
     StartAnalysisEnabled = false;
     if (_resultSet.GetNumberOfAnalyzedPictures() > 0)
     {
         var clear = MessageBox.Show("Do you want to clear any prevoius analized image?", "Clear resutls?", MessageBoxButtons.YesNo);
         if (clear == DialogResult.Yes)
         {
             _resultSet.ClearPreviousResults();
         }
     }
     SelectedFolder = string.Format("Analyzing {0} files on folder {1} ", _jpegFilesLocation.Count(), _curPath);
     analysisWorker.RunWorkerAsync();
 }