public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            mView        = inflater.Inflate(Resource.Layout.ChartAllTablesDialog, container, false);
            chartSuccess = mView.FindViewById <BarChart>(Resource.Id.chartAllTablesDialog);

            dicOfDataSets = new Dictionary <string, List <BarEntry> >();

            List <StatsTables> searchedTable = (from table in listStatsTables
                                                where table.big_deviation.Contains("NO", StringComparison.OrdinalIgnoreCase)
                                                select table).ToList <StatsTables>();

            foreach (StatsTables row in searchedTable)
            {
                if (!listTableNames.Contains(row.table_name))
                {
                    listTableNames.Add(row.table_name);
                }
            }

            int counter = 0;

            foreach (string table in listTableNames)
            {
                barEntry = new List <BarEntry>();
                foreach (StatsTables item in searchedTable)
                {
                    if (table == item.table_name)
                    {
                        barEntry.Add(new BarEntry(counter, item.diff_last_trans));
                        counter++;
                    }
                }
                dicOfDataSets.Add(table, barEntry);
            }

            BarData data = new BarData();

            int[] chartColors  = { Color.ParseColor("#005571"), Color.ParseColor("#227691"), Color.ParseColor("#86B1C6"), Color.ParseColor("#BCD4E0"), Color.ParseColor("#FDB813"), Color.ParseColor("#FFC54E"), Color.ParseColor("#FFD27C"), Color.ParseColor("#FFE6B9") };
            int   counterColor = 0;

            foreach (KeyValuePair <string, List <BarEntry> > dicDataSet in dicOfDataSets)
            {
                dataSet = new BarDataSet(dicDataSet.Value, dicDataSet.Key);
                dataSet.SetColors(chartColors[counterColor]);
                data.AddDataSet(dataSet);
                counterColor++;
            }

            XAxis xAxis = chartSuccess.XAxis;

            xAxis.SetCenterAxisLabels(false);
            xAxis.SetDrawLabels(false);
            xAxis.Position = XAxis.XAxisPosition.BottomInside;
            xAxis.SetDrawGridLines(false);
            xAxis.SetAvoidFirstLastClipping(true);
            xAxis.XOffset = 10;

            Legend l = chartSuccess.Legend;

            l.VerticalAlignment   = Legend.LegendVerticalAlignment.Top;
            l.HorizontalAlignment = Legend.LegendHorizontalAlignment.Right;
            l.Orientation         = Legend.LegendOrientation.Vertical;
            l.WordWrapEnabled     = true;
            l.SetDrawInside(true);

            chartSuccess.Data = data;
            chartSuccess.AxisRight.SetDrawLabels(false);
            chartSuccess.XAxis.SetDrawLabels(false);
            chartSuccess.AnimateXY(3000, 3000);

            chartSuccess.Description.Enabled = true;
            chartSuccess.Description.Text    = "Tables without big deviation";

            chartSuccess.Invalidate();

            return(mView);
        }
        protected async override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            CalligraphyConfig.InitDefault(new CalligraphyConfig.Builder()
                                          .SetDefaultFontPath("Estedad.ttf").Build());

            SetContentView(Resource.Layout.layoutMyEventManangment);
            var font = Typeface.CreateFromAsset(Assets, "Estedad.ttf");

            FindViewById <TextView>(Resource.Id.myeventmanagmnettxtviewstatuse).Typeface = font;
            myeventmanagmnettxtviewcaption          = FindViewById <TextView>(Resource.Id.myeventmanagmnettxtviewcaption);
            myeventmanagmnettxtviewcaption.Typeface = font;

            myeventmanagmnetButtonBack          = FindViewById <Button>(Resource.Id.myeventmanagmnetButtonBack);
            myeventmanagmnetButtonBack.Typeface = font;
            myeventmanagmnetButtonBack.Click   += delegate { Finish(); };
            ImageView myeventmanagmnetimgviewback;

            myeventmanagmnetimgviewback        = FindViewById <ImageView>(Resource.Id.myeventmanagmnetimgviewback);
            myeventmanagmnetimgviewback.Click += delegate { Finish(); };

            myeventmanagmnetbuttondelete        = FindViewById <Button>(Resource.Id.myeventmanagmnetbuttondelete);
            myeventmanagmnetbuttondelete.Click += delegate {
                string ValueToast = "مطمئنی میخوای حذفش کنی؟";



                Android.App.AlertDialog.Builder alert = new Android.App.AlertDialog.Builder(this);
                alert.SetTitle("حذف رویداد");
                alert.SetMessage(ValueToast);
                alert.SetPositiveButton("بله", (senderAlert, args) =>
                {
                    //باز شدن فرگمنت ذیگر
                    StatuseDeleteFragment dlg = new StatuseDeleteFragment(this);

                    dlg.Show(this.FragmentManager, "Fragmentmanangerstatusedelete");
                });

                alert.SetNegativeButton("خیر", (senderAlert, args) =>
                {
                });

                Dialog dialog = alert.Create();
                dialog.Show();
            };
            myeventmanagmnetbuttonedit          = FindViewById <Button>(Resource.Id.myeventmanagmnetbuttonedit);
            myeventmanagmnetbuttonedit.Typeface = font;
            myeventmanagmnetbuttonedit.Click   += delegate {
                Intent oi = new Intent(this, typeof(EditMyEventActivity));
                StartActivity(oi);
            };
            myeventmanagmnetbuttondown          = FindViewById <Button>(Resource.Id.myeventmanagmnetbuttondown);
            myeventmanagmnetbuttondown.Typeface = font;
            myeventmanagmnetbuttondown.Click   += delegate
            { //ارتقا}
                Intent ine = new Intent(this, typeof(MyEventUpgradeActivity));
                StartActivity(ine);
            };

            myeventmanagmnetvpagerslider = FindViewById <ViewPager>(Resource.Id.myeventmanagmnetvpagerslider);
            //  myeventmanagmnetvpagerslider.Adapter = new ImageAdapter(this);
            var myeventmanagmnettablayoutdots = FindViewById <TabLayout>(Resource.Id.myeventmanagmnettablayoutdots);

            myeventmanagmnettablayoutdots.SetupWithViewPager(myeventmanagmnetvpagerslider, true);


            myeventmanagmnettxtviewmajor          = FindViewById <TextView>(Resource.Id.myeventmanagmnettxtviewmajor);
            myeventmanagmnettxtviewmajor.Typeface = font;
            myeventmanagmnettxtviewsport          = FindViewById <TextView>(Resource.Id.myeventmanagmnettxtviewsport);
            myeventmanagmnettxtviewsport.Typeface = font;
            string txtviewsport   = myeventmanagmnettxtviewsport.Text;
            string numberdigitone = txtviewsport.Replace("0", "٠").Replace("1", "١").Replace("2", "٢").Replace("3", "٣").Replace("4", "٤").Replace("5", "٥").Replace("6", "٦").Replace("7", "٧").Replace("8", "٨").Replace("9", "٩");

            myeventmanagmnettxtviewsport.Text = numberdigitone;



            myeventmanagmnettxtviewcaptiongroup          = FindViewById <TextView>(Resource.Id.myeventmanagmnettxtviewcaptiongroup);
            myeventmanagmnettxtviewcaptiongroup.Typeface = font;

            myeventmanagmnettxtviewplace          = FindViewById <TextView>(Resource.Id.myeventmanagmnettxtviewplace);
            myeventmanagmnettxtviewplace.Typeface = font;

            string txtviewplace   = myeventmanagmnettxtviewplace.Text;
            string numberdigittwo = txtviewplace.Replace("0", "٠").Replace("1", "١").Replace("2", "٢").Replace("3", "٣").Replace("4", "٤").Replace("5", "٥").Replace("6", "٦").Replace("7", "٧").Replace("8", "٨").Replace("9", "٩");

            myeventmanagmnettxtviewplace.Text = numberdigittwo;



            myeventmanagmnettxtviewcaptionplace          = FindViewById <TextView>(Resource.Id.myeventmanagmnettxtviewcaptionplace);
            myeventmanagmnettxtviewcaptionplace.Typeface = font;
            myeventmanagmnettxtviewdate          = FindViewById <TextView>(Resource.Id.myeventmanagmnettxtviewdate);
            myeventmanagmnettxtviewdate.Typeface = font;
            string txtviewdate      = myeventmanagmnettxtviewdate.Text;
            string numberdigitthree = txtviewdate.Replace("0", "٠").Replace("1", "١").Replace("2", "٢").Replace("3", "٣").Replace("4", "٤").Replace("5", "٥").Replace("6", "٦").Replace("7", "٧").Replace("8", "٨").Replace("9", "٩");

            myeventmanagmnettxtviewdate.Text = numberdigitthree;

            myeventmanagmnettxtviewtel          = FindViewById <TextView>(Resource.Id.myeventmanagmnettxtviewtel);
            myeventmanagmnettxtviewtel.Typeface = font;
            string txtviewtel     = myeventmanagmnettxtviewtel.Text;
            string numberdigittel = txtviewtel.Replace("0", "٠").Replace("1", "١").Replace("2", "٢").Replace("3", "٣").Replace("4", "٤").Replace("5", "٥").Replace("6", "٦").Replace("7", "٧").Replace("8", "٨").Replace("9", "٩");

            myeventmanagmnettxtviewtel.Text = numberdigittel;


            myeventmanagmnettxtviewcaptiontime          = FindViewById <TextView>(Resource.Id.myeventmanagmnettxtviewcaptiontime);
            myeventmanagmnettxtviewcaptiontime.Typeface = font;
            myeventmanagmnettxtviewprice          = FindViewById <TextView>(Resource.Id.myeventmanagmnettxtviewprice);
            myeventmanagmnettxtviewprice.Typeface = font;
            string txtviewprice    = myeventmanagmnettxtviewprice.Text;
            string numberdigittfor = txtviewprice.Replace("0", "٠").Replace("1", "١").Replace("2", "٢").Replace("3", "٣").Replace("4", "٤").Replace("5", "٥").Replace("6", "٦").Replace("7", "٧").Replace("8", "٨").Replace("9", "٩");

            myeventmanagmnettxtviewprice.Text = numberdigittfor;


            myeventmanagmnettxtviewaddress          = FindViewById <TextView>(Resource.Id.myeventmanagmnettxtviewaddress);
            myeventmanagmnettxtviewaddress.Typeface = font;
            string tviewaddress     = myeventmanagmnettxtviewaddress.Text;
            string numberdigittfive = tviewaddress.Replace("0", "٠").Replace("1", "١").Replace("2", "٢").Replace("3", "٣").Replace("4", "٤").Replace("5", "٥").Replace("6", "٦").Replace("7", "٧").Replace("8", "٨").Replace("9", "٩");

            myeventmanagmnettxtviewaddress.Text = numberdigittfive;


            myeventmanagmnettxtviewcaptioncost          = FindViewById <TextView>(Resource.Id.myeventmanagmnettxtviewcaptioncost);
            myeventmanagmnettxtviewcaptioncost.Typeface = font;
            myeventmanagmnettxtviewdescription          = FindViewById <TextView>(Resource.Id.myeventmanagmnettxtviewdescription);
            myeventmanagmnettxtviewdescription.Typeface = font;

            string txtviewdescription = myeventmanagmnettxtviewdescription.Text;
            string numberdigittsix    = txtviewdescription.Replace("0", "٠").Replace("1", "١").Replace("2", "٢").Replace("3", "٣").Replace("4", "٤").Replace("5", "٥").Replace("6", "٦").Replace("7", "٧").Replace("8", "٨").Replace("9", "٩");

            myeventmanagmnettxtviewdescription.Text = numberdigittsix;

            myeventmanagmnettxtviewurl          = FindViewById <TextView>(Resource.Id.myeventmanagmnettxtviewurl);
            myeventmanagmnettxtviewurl.Typeface = font;
            string ttxtviewurl       = myeventmanagmnettxtviewurl.Text;
            string numberdigittseven = ttxtviewurl.Replace("0", "٠").Replace("1", "١").Replace("2", "٢").Replace("3", "٣").Replace("4", "٤").Replace("5", "٥").Replace("6", "٦").Replace("7", "٧").Replace("8", "٨").Replace("9", "٩");

            myeventmanagmnettxtviewurl.Text = numberdigittseven;



            myeventmanagmnettxtviewcaptiondescription          = FindViewById <TextView>(Resource.Id.myeventmanagmnettxtviewcaptiondescription);
            myeventmanagmnettxtviewcaptiondescription.Typeface = font;
            //TextView myeventmanagmnettxtviewcaptioncontact = FindViewById<TextView>(Resource.Id.myeventmanagmnettxtviewcaptioncontact);
            //myeventmanagmnettxtviewcaptioncontact.Typeface = font;
            myeventmanagmnetchart = FindViewById <BarChart>(Resource.Id.myeventmanagmnetchart);
            BarData data = new BarData(getXAxisValues(), getDataSet());

            myeventmanagmnetchart.Data = (data);
            myeventmanagmnetchart.SetDescription("EventooChart");
            myeventmanagmnetchart.AnimateXY(2000, 2000);
            myeventmanagmnetchart.Invalidate();
        }
Пример #3
0
        private void ChartError()
        {
            mDicOfDataSets = new Dictionary <string, List <BarEntry> >();

            List <StatsTables> searchedTable = (from table in mListStatsTables
                                                where table.big_deviation.Contains("YES", StringComparison.OrdinalIgnoreCase)
                                                select table).ToList <StatsTables>();

            foreach (StatsTables row in searchedTable)
            {
                if (!mListTableNames.Contains(row.table_name))
                {
                    mListTableNames.Add(row.table_name);
                }
            }

            int counter = 0;

            foreach (string table in mListTableNames)
            {
                List <BarEntry> barEntry = new List <BarEntry>();
                foreach (StatsTables item in searchedTable)
                {
                    if (table == item.table_name)
                    {
                        barEntry.Add(new BarEntry(counter, item.diff_last_trans));
                        counter++;
                    }
                }
                mDicOfDataSets.Add(table, barEntry);
            }

            BarData data = new BarData();

            foreach (KeyValuePair <string, List <BarEntry> > dicDataSet in mDicOfDataSets)
            {
                dataSet = new BarDataSet(dicDataSet.Value, dicDataSet.Key);
                dataSet.SetColors(Color.DarkRed);
                data.AddDataSet(dataSet);
            }

            XAxis xAxis = chartError.XAxis;

            xAxis.SetCenterAxisLabels(false);
            xAxis.SetDrawLabels(false);
            xAxis.Position = XAxis.XAxisPosition.BottomInside;
            xAxis.SetDrawGridLines(false);

            chartError.Data = data;
            chartError.AxisRight.SetDrawLabels(false);
            chartError.XAxis.SetDrawLabels(false);
            chartError.AnimateXY(2000, 2000);

            chartError.Legend.Enabled = false;
            chartError.SetTouchEnabled(true);
            chartError.SetPinchZoom(false);
            chartError.DoubleTapToZoomEnabled = false;

            chartError.Description.Enabled = true;
            chartError.Description.Text    = "Tables with big deviation";

            //chartError.SetBackgroundColor(Color.WhiteSmoke);

            chartError.Invalidate();
        }
Пример #4
0
        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            mView           = inflater.Inflate(Resource.Layout.ChartAllTablesDialog, container, false);
            mChartAllTables = mView.FindViewById <BarChart>(Resource.Id.chartAllTablesDialog);

            dicOfDataSets = new Dictionary <string, List <BarEntry> >();

            foreach (StatsTables row in listStatsTables)
            {
                if (!listTableNames.Contains(row.table_name))
                {
                    listTableNames.Add(row.table_name);
                }
            }

            int counter = 0;


            foreach (string table in listTableNames)
            {
                List <BarEntry> barEntry = new List <BarEntry>();
                foreach (StatsTables item in listStatsTables)
                {
                    if (table == item.table_name)
                    {
                        barEntry.Add(new BarEntry(counter, item.diff_last_trans));
                        counter++;
                    }
                }
                dicOfDataSets.Add(table, barEntry);
            }

            BarData data = new BarData();

            int[] chartColors  = { Color.ParseColor("#005571"), Color.ParseColor("#227691"), Color.ParseColor("#86B1C6"), Color.ParseColor("#BCD4E0"), Color.ParseColor("#FDB813"), Color.ParseColor("#FFC54E"), Color.ParseColor("#FFD27C"), Color.ParseColor("#FFE6B9") };
            int   colorCounter = 0;

            foreach (KeyValuePair <string, List <BarEntry> > dicDataSet in dicOfDataSets)
            {
                dataSet = new BarDataSet(dicDataSet.Value, dicDataSet.Key);
                dataSet.SetColors(chartColors[colorCounter]);
                data.AddDataSet(dataSet);
                colorCounter++;
            }

            LimitLine limitLine = new LimitLine(70f);

            limitLine.LineColor = Color.DarkRed;
            limitLine.Enabled   = true;

            XAxis xAxis = mChartAllTables.XAxis;

            xAxis.SetCenterAxisLabels(false);
            xAxis.SetDrawLabels(false);
            xAxis.Position = XAxis.XAxisPosition.BottomInside;
            xAxis.SetDrawGridLines(false);

            YAxis yAxis = mChartAllTables.AxisLeft;

            yAxis.SetDrawGridLines(true);
            yAxis.AddLimitLine(limitLine);

            Legend l = mChartAllTables.Legend;

            l.VerticalAlignment   = Legend.LegendVerticalAlignment.Top;
            l.HorizontalAlignment = Legend.LegendHorizontalAlignment.Right;
            l.Orientation         = Legend.LegendOrientation.Vertical;
            l.WordWrapEnabled     = true;
            l.SetDrawInside(true);

            mChartAllTables.Data = data;
            mChartAllTables.AxisRight.SetDrawLabels(false);
            mChartAllTables.XAxis.SetDrawLabels(false);
            mChartAllTables.AnimateXY(3000, 3000);

            mChartAllTables.Description.Enabled = true;
            mChartAllTables.Description.Text    = "All tables chart";

            mChartAllTables.Invalidate();

            return(mView);
        }
Пример #5
0
        private void ChartAllTables()
        {
            mDicOfDataSets = new Dictionary <string, List <BarEntry> >();

            foreach (StatsTables row in mListStatsTables)
            {
                if (!mListTableNames.Contains(row.table_name))
                {
                    mListTableNames.Add(row.table_name);
                }
            }

            int counter = 0;


            foreach (string table in mListTableNames)
            {
                List <BarEntry> barEntry = new List <BarEntry>();
                foreach (StatsTables item in mListStatsTables)
                {
                    if (table == item.table_name)
                    {
                        barEntry.Add(new BarEntry(counter, item.diff_last_trans));
                        counter++;
                    }
                }
                mDicOfDataSets.Add(table, barEntry);
            }

            BarData data = new BarData();

            int[] chartColors = { Color.DarkRed, Color.DarkGreen };

            foreach (KeyValuePair <string, List <BarEntry> > dicDataSet in mDicOfDataSets)
            {
                dataSet = new BarDataSet(dicDataSet.Value, dicDataSet.Key);

                foreach (BarEntry item in dicDataSet.Value)
                {
                    if (item.GetY() > 70)
                    {
                        dataSet.SetColors(chartColors[0]);
                    }

                    else
                    {
                        dataSet.SetColors(chartColors[1]);
                    }
                }
                data.AddDataSet(dataSet);
            }

            LimitLine limitLine = new LimitLine(70f);

            limitLine.LineColor = Color.DarkRed;
            limitLine.Enabled   = true;

            XAxis xAxis = chartAllTables.XAxis;

            xAxis.SetDrawLabels(false);
            xAxis.Position = XAxis.XAxisPosition.BottomInside;
            xAxis.SetDrawGridLines(true);

            YAxis yAxis = chartAllTables.AxisLeft;

            yAxis.SetDrawGridLines(true);
            yAxis.AddLimitLine(limitLine);

            chartAllTables.Data = data;
            chartAllTables.AxisRight.SetDrawLabels(false);
            chartAllTables.AnimateXY(3000, 3000);

            chartAllTables.Legend.Enabled = false;
            chartAllTables.SetTouchEnabled(true);
            chartAllTables.SetPinchZoom(false);
            chartAllTables.DoubleTapToZoomEnabled = false;

            chartAllTables.Description.Enabled = true;
            chartAllTables.Description.Text    = "All tables chart";

            //chartAllTables.SetBackgroundColor(Color.WhiteSmoke);

            chartAllTables.Invalidate();
        }