Пример #1
0
        private void SetGraphicsAchievementsSources()
        {
            var data = AchievementsDatabase.GetCountBySources();

            //let create a mapper so LiveCharts know how to plot our CustomerViewModel class
            var customerVmMapper = Mappers.Xy <CustomerForSingle>()
                                   .X((value, index) => index)
                                   .Y(value => value.Values);

            //lets save the mapper globally
            Charting.For <CustomerForSingle>(customerVmMapper);

            SeriesCollection StatsGraphicAchievementsSeries = new SeriesCollection();

            StatsGraphicAchievementsSeries.Add(new ColumnSeries
            {
                Title  = "",
                Values = data.SeriesUnlocked
            });
            //StatsGraphicAchievementsSeries.Add(new LineSeries
            //{
            //    Title = "",
            //    Values = data.SeriesTotal
            //});

            StatsGraphicAchievementsSources.Series  = StatsGraphicAchievementsSeries;
            StatsGraphicAchievementsSourcesX.Labels = data.Labels;
        }
Пример #2
0
        private void SetGraphicsAchievementsSources()
        {
            var data = AchievementsDb.GetCountBySources();

            Application.Current.Dispatcher.BeginInvoke((Action) delegate
            {
                //let create a mapper so LiveCharts know how to plot our CustomerViewModel class
                var customerVmMapper = Mappers.Xy <CustomerForSingle>()
                                       .X((value, index) => index)
                                       .Y(value => value.Values);

                //lets save the mapper globally
                Charting.For <CustomerForSingle>(customerVmMapper);

                SeriesCollection StatsGraphicAchievementsSeries = new SeriesCollection();
                StatsGraphicAchievementsSeries.Add(new ColumnSeries
                {
                    Title  = string.Empty,
                    Values = data.SeriesUnlocked
                });

                StatsGraphicAchievementsSources.Series  = StatsGraphicAchievementsSeries;
                StatsGraphicAchievementsSourcesX.Labels = data.Labels;
            });
        }