Exemplo n.º 1
0
        private void RefreshAction(object obj)
        {
            var groupPengaduan = from pengaduan in DataAccess.DataBasic.DataPengaduan
                                 from korban in pengaduan.Korban
                                 select korban;

            foreach (var pekerjaan in groupPengaduan.GroupBy(x => x.Pekerjaan))
            {
                int value = 0;
                var data  = pekerjaan.Where(x => x.Gender == Gender.L);

                if (data != null)
                {
                    value = data.Count();
                }

                SeriesCollection.Add(new PieSeries {
                    DataLabels = true, Title = pekerjaan.Key, Values = new ChartValues <double> {
                        value
                    }
                });
            }

            Labels     = EnumSource.DataPendidikan().ToArray();
            PointLabel = chartPoint =>
                         string.Format("{0} ({1:P})", chartPoint.Y, chartPoint.Participation);
        }
Exemplo n.º 2
0
        public Identitas()
        {
            ListAgama = EnumSource.DataAgama();

            ListStatusPernikahan = EnumSource.DataStatusPernikahan();
            ListPendidikan       = EnumSource.DataPendidikan();
            ListPekerjaan        = EnumSource.DataPekerjaan();
        }
Exemplo n.º 3
0
        private void RefreshAction(object obj)
        {
            SeriesCollection.Clear();
            var groupPengaduan = (from p in  DataAccess.DataBasic.DataPengaduan
                                  from korban in p.Korban select korban).GroupBy(x => x.Pendidikan);

            datgrafirk.Clear();
            int number = 0;

            foreach (var pendidikan in EnumSource.DataPendidikan())
            {
                int value = 0;
                var data  = groupPengaduan.Where(x => x.Key == pendidikan).FirstOrDefault();

                if (data != null)
                {
                    value = data.Count();
                }

                SeriesCollection.Add(new ColumnSeries
                {
                    DataLabels = true,
                    Title      = pendidikan,
                    Values     = new ChartValues <int> {
                        value
                    }
                });

                number++;
                datgrafirk.Add(new GrafikModel {
                    NilaiText = number.ToString(), Kategori = pendidikan, Series = pendidikan, Nilai = value, Title = Title
                });
            }

            //   Labels = EnumSource.DataPendidikan().ToArray();
            //new[] { "Jan", "Feb", "Mar", "Apr", "May" };
            YFormatter = value => ((int)value).ToString("N");
            // XFormatter = value => ((int)value)<=0 ? "": ((int)value).ToString("N");
        }