コード例 #1
0
        private void DesignCakeGraph()
        {
            ResultsPlot.Title         = string.Format("Distribution of {0} values over total analyzed photos", CurrentFilterText);
            ResultsPlot.TitleFontSize = 20;
            ResultsPlot.TitleFont     = "Segoe UI";
            ResultsPlot.TitleColor    = OxyColor.FromRgb(ColorsHelper.RedMainGreen, ColorsHelper.GreenMainGreen, ColorsHelper.BlueMainGreen);
            ResultsPlot.PlotMargins   = new OxyThickness(15);
            ResultsPlot.Series.Clear();
            ResultsPlot.Axes.Clear();
            int numberOfPictures = _resultSet.GetNumberOfAnalyzedPictures();
            var regrouppedProp   = GrouppedProperties.GroupBy(i => i.ExifCode);

            foreach (var exifGroup in regrouppedProp)
            {
                PieSeries series = new PieSeries();
                foreach (GrouppedProperty property in exifGroup)
                {
                    series.Slices.Add(new PieSlice(property.Value, property.Count)
                    {
                        IsExploded = true
                    });
                }
                ResultsPlot.Series.Add(series);
            }
            ResultsPlot.InvalidatePlot(true);
        }
コード例 #2
0
        private void ForceGraphToRedisgn()
        {
            GrouppedProperties.Clear();
            Filter filter = _resultFilters.FirstOrDefault(i => i.IsChecked);

            if (filter == null)
            {
                return;
            }
            List <GrouppedProperty> propertiesToAdd = _resultSet.GetFilteredGrouppedCollection(filter.ExifCode);

            GrouppedProperties.AddRange(propertiesToAdd);
            RedeisgnGraphs();
        }
コード例 #3
0
        private void ManageCheckBoxPropertyChanged(object sender, PropertyChangedEventArgs e)
        {
            Filter filter = (Filter)sender;

            if (filter.IsChecked == false)
            {
                return;
            }
            GrouppedProperties.Clear();
            List <GrouppedProperty> propertiesToAdd = _resultSet.GetFilteredGrouppedCollection(filter.ExifCode);

            GrouppedProperties.AddRange(propertiesToAdd);
            RedeisgnGraphs();
        }
コード例 #4
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);
        }
コード例 #5
0
        private void DesignLineGraph()
        {
            ResultsPlot.Series.Clear();
            ResultsPlot.Axes.Clear();
            int numberOfPictures = _resultSet.GetNumberOfAnalyzedPictures();
            var regrouppedProp   = GrouppedProperties.GroupBy(i => i.ExifCode);

            foreach (var exifGroup in regrouppedProp)
            {
                LineSeries   series       = new LineSeries();
                CategoryAxis categoryAxis = new CategoryAxis();
                categoryAxis.Position = AxisPosition.Bottom;
                int i = 0;

                foreach (GrouppedProperty property in exifGroup)
                {
                    series.Points.Add(new DataPoint(Convert.ToDouble(i), Convert.ToDouble(property.Count)));
                    categoryAxis.Labels.Add(property.Value);
                    i++;
                }
                var valueAxis = new LinearAxis
                {
                    Position               = AxisPosition.Left,
                    MinimumPadding         = 0,
                    MaximumPadding         = 2.5,
                    AbsoluteMinimum        = 0,
                    Minimum                = 0,
                    Maximum                = numberOfPictures,
                    Unit                   = "Photos",
                    MinimumMajorStep       = 1,
                    MinimumMinorStep       = 1,
                    MajorGridlineThickness = 1
                };
                ResultsPlot.Series.Add(series);
                ResultsPlot.Axes.Add(categoryAxis);
                ResultsPlot.Axes.Add(valueAxis);
            }
            ResultsPlot.InvalidatePlot(true);
        }