コード例 #1
0
        public override View GetSampleContent(Context context)
        {
            var chart = new SfChart(context);;

            chart.SetBackgroundColor(Color.White);
            chart.Legend.Visibility = Visibility.Visible;

            var datas = new ObservableArrayList();

            datas.Add(new ChartDataPoint("2010", 8000));
            datas.Add(new ChartDataPoint("2011", 8100));
            datas.Add(new ChartDataPoint("2012", 8250));
            datas.Add(new ChartDataPoint("2013", 8600));
            datas.Add(new ChartDataPoint("2014", 8700));

            var doughnutSeries = new DoughnutSeries
            {
                ExplodeIndex       = 3,
                DataSource         = datas,
                DataMarkerPosition = CircularSeriesDataMarkerPosition.OutsideExtended,
            };

            doughnutSeries.DataMarker.ShowLabel = true;
            doughnutSeries.ConnectorType        = ConnectorType.Bezier;

            chart.Series.Add(doughnutSeries);
            return(chart);
        }
コード例 #2
0
       public override View GetSampleContent(Context context)
        {
            var chart = new SfChart(context);;
            chart.SetBackgroundColor(Color.White);

            chart.PrimaryAxis = new CategoryAxis {PlotOffset = 50};
            chart.SecondaryAxis = new NumericalAxis();

            var bubble = new BubbleSeries();
           
            bubble.ColorModel.ColorPalette = ChartColorPalette.Metro;
            bubble.DataMarker.ShowLabel = true;
            bubble.DataMarker.UseSeriesPalette = false;
            bubble.DataMarker.LabelStyle.TextColor = Color.White;

            var datas = new ObservableArrayList();
            datas.Add(new ChartDataPoint("2010", 45, 30));
            datas.Add(new ChartDataPoint("2011", 86, 20));
            datas.Add(new ChartDataPoint("2012", 23, 15));
            datas.Add(new ChartDataPoint("2013", 43, 25));
            datas.Add(new ChartDataPoint("2014", 54, 20));

            bubble.DataSource = datas;
            chart.Series.Add(bubble);
            return chart;
        }
コード例 #3
0
        public override View GetSampleContent(Context context)
        {
            var chart = new SfChart(context);;

            chart.SetBackgroundColor(Color.White);

            chart.PrimaryAxis = new CategoryAxis {
                PlotOffset = 50
            };
            chart.SecondaryAxis = new NumericalAxis();

            var bubble = new BubbleSeries();

            bubble.ColorModel.ColorPalette         = ChartColorPalette.Metro;
            bubble.DataMarker.ShowLabel            = true;
            bubble.DataMarker.UseSeriesPalette     = false;
            bubble.DataMarker.LabelStyle.TextColor = Color.White;

            var datas = new ObservableArrayList();

            datas.Add(new ChartDataPoint("2010", 45, 30));
            datas.Add(new ChartDataPoint("2011", 86, 20));
            datas.Add(new ChartDataPoint("2012", 23, 15));
            datas.Add(new ChartDataPoint("2013", 43, 25));
            datas.Add(new ChartDataPoint("2014", 54, 20));

            bubble.DataSource = datas;
            chart.Series.Add(bubble);
            return(chart);
        }
コード例 #4
0
 public static ObservableArrayList GetData1()
 {
     var datas = new ObservableArrayList();
     datas.Add(new ChartDataPoint("2010", 45));
     datas.Add(new ChartDataPoint("2011", 89));
     datas.Add(new ChartDataPoint("2012", 23));
     datas.Add(new ChartDataPoint("2013", 43));
     datas.Add(new ChartDataPoint("2014", 54));
     return datas;
 }
コード例 #5
0
 public static ObservableArrayList GetLineData()
 {
     var datas = new ObservableArrayList();
     datas.Add(new ChartDataPoint("2010", 45.68));
     datas.Add(new ChartDataPoint("2011", 89.25));
     datas.Add(new ChartDataPoint("2012", 23.73));
     datas.Add(new ChartDataPoint("2013", 43.5));
     datas.Add(new ChartDataPoint("2014", 54.92));
     return datas;
 }
コード例 #6
0
 private void LoadData()
 {
     for (var i = 0; i < 2; i++)
     {
         data.Add(new ChartDataPoint(calendar.Time, random.Next(0, 100)));
         calendar.Add(CalendarField.Millisecond, 500);
         count++;
     }
     count = data.Size();
 }
コード例 #7
0
 public static ObservableArrayList GetCategoryData()
 {
     var datas = new ObservableArrayList();
     datas.Add(new ChartDataPoint("Bentley", 54));
     datas.Add(new ChartDataPoint("Audi", 24));
     datas.Add(new ChartDataPoint("BMW", 53));
     datas.Add(new ChartDataPoint("Jaguar", 63));
     datas.Add(new ChartDataPoint("Skoda", 35));
     return datas;
 }
コード例 #8
0
       public override View GetSampleContent(Context context)
        {
            var chart = new SfChart(context);;
            chart.SetBackgroundColor(Color.White);

            chart.PrimaryAxis = new CategoryAxis { ShowMajorGridLines = false, PlotOffset = 20 };
            chart.SecondaryAxis = new NumericalAxis() { ShowMajorGridLines = false, PlotOffset = 20 };

            var datas = new ObservableArrayList();
            datas.Add(new ChartDataPoint("2005", 54));
            datas.Add(new ChartDataPoint("2006", 34));
            datas.Add(new ChartDataPoint("2007", 53));
            datas.Add(new ChartDataPoint("2008", 63));
            datas.Add(new ChartDataPoint("2009", 35));
            datas.Add(new ChartDataPoint("2010", 27));
            datas.Add(new ChartDataPoint("2011", 13));
            datas.Add(new ChartDataPoint("2012", 40));
            datas.Add(new ChartDataPoint("2013", 25));

            var scatterSeries = new ScatterSeries
            {
                DataSource = datas,
                ScatterHeight = 20,
                ScatterWidth = 20
            };
            
            scatterSeries.DataMarker.ShowLabel = true;
            chart.Series.Add(scatterSeries);

            return chart;
       }    
コード例 #9
0
        public static ObservableArrayList GetLineData()
        {
            var datas = new ObservableArrayList();

            datas.Add(new ChartDataPoint("2010", 45.68));
            datas.Add(new ChartDataPoint("2011", 89.25));
            datas.Add(new ChartDataPoint("2012", 23.73));
            datas.Add(new ChartDataPoint("2013", 43.5));
            datas.Add(new ChartDataPoint("2014", 54.92));
            return(datas);
        }
コード例 #10
0
        public static ObservableArrayList GetSeriesData3()
        {
            var datas = new ObservableArrayList();

            datas.Add(new ChartDataPoint(1, 24));
            datas.Add(new ChartDataPoint(2, 14));
            datas.Add(new ChartDataPoint(3, 33));
            datas.Add(new ChartDataPoint(4, 43));
            datas.Add(new ChartDataPoint(5, 15));
            return(datas);
        }
コード例 #11
0
        public static ObservableArrayList GetCategoryData()
        {
            var datas = new ObservableArrayList();

            datas.Add(new ChartDataPoint("Bentley", 54));
            datas.Add(new ChartDataPoint("Audi", 24));
            datas.Add(new ChartDataPoint("BMW", 53));
            datas.Add(new ChartDataPoint("Jaguar", 63));
            datas.Add(new ChartDataPoint("Skoda", 35));
            return(datas);
        }
コード例 #12
0
        public static ObservableArrayList GetSeriesData2()
        {
            var datas = new ObservableArrayList();

            datas.Add(new ChartDataPoint(1, 34));
            datas.Add(new ChartDataPoint(2, 20));
            datas.Add(new ChartDataPoint(3, 43));
            datas.Add(new ChartDataPoint(4, 53));
            datas.Add(new ChartDataPoint(5, 25));
            return(datas);
        }
コード例 #13
0
        public static ObservableArrayList GetFinancialData()
        {
            var datas = new ObservableArrayList();

            datas.Add(new ChartDataPoint("2010", 873.8, 878.85, 855.5, 860.5));
            datas.Add(new ChartDataPoint("2011", 861, 868.4, 835.2, 843.45));
            datas.Add(new ChartDataPoint("2012", 846.15, 853, 838.5, 847.5));
            datas.Add(new ChartDataPoint("2013", 846, 860.75, 841, 855));
            datas.Add(new ChartDataPoint("2014", 841, 845, 827.85, 838.65));
            return(datas);
        }
コード例 #14
0
        public static ObservableArrayList GetNumericalData()
        {
            var datas = new ObservableArrayList();

            datas.Add(new ChartDataPoint(1, 54));
            datas.Add(new ChartDataPoint(2, 24));
            datas.Add(new ChartDataPoint(3, 53));
            datas.Add(new ChartDataPoint(4, 63));
            datas.Add(new ChartDataPoint(5, 35));
            return(datas);
        }
コード例 #15
0
        public static ObservableArrayList GetData2()
        {
            var datas = new ObservableArrayList();

            datas.Add(new ChartDataPoint("2010", 54));
            datas.Add(new ChartDataPoint("2011", 24));
            datas.Add(new ChartDataPoint("2012", 53));
            datas.Add(new ChartDataPoint("2013", 63));
            datas.Add(new ChartDataPoint("2014", 35));
            return(datas);
        }
コード例 #16
0
        public static ObservableArrayList GetTriangularData()
        {
            var datas = new ObservableArrayList();

            datas.Add(new ChartDataPoint("Bentley", 800));
            datas.Add(new ChartDataPoint("Audi", 810));
            datas.Add(new ChartDataPoint("BMW", 825));
            datas.Add(new ChartDataPoint("Jaguar", 860));
            datas.Add(new ChartDataPoint("Skoda", 875));
            return(datas);
        }
コード例 #17
0
        private static ObservableArrayList GetBalanceGroupByMonthPerAccount(Account account)
        {
            var transactions = SilverCoinsManager.GetTransactions()
                               .Where(x => x.Type != "Transfer" &&
                                      x.CreatedDate >= DateTime.Today.AddYears(-1) &&
                                      x.Account == account.Id)
                               .OrderBy(x => x.CreatedDate)
                               .ToList();

            List <ResultLine> resultList = transactions.GroupBy(x => x.CreatedDate.Month)
                                           .Select(r => new ResultLine
            {
                Name  = r.First().CreatedDate.ToString("MMM"),
                Value = r.Sum(x => (x.Type == "Income" ? x.Amount : -x.Amount))
            })
                                           .ToList();

            ObservableArrayList list    = new ObservableArrayList();
            decimal             balance = 0;

            foreach (var item in resultList)
            {
                balance += item.Value;
                list.Add(new ChartDataPoint(item.Name, Convert.ToDouble(balance)));
            }

            return(list);
        }
コード例 #18
0
        internal static List <ObservableArrayList> BarChartData(Account account)
        {
            var transactions = SilverCoinsManager.GetTransactions()
                               .Where(x => x.Type != "Transfer" && x.CreatedDate >= DateTime.Today.AddYears(-1))
                               .OrderBy(x => x.CreatedDate)
                               .ToList();

            if (account.Id != 0)
            {
                transactions = transactions.Where(x => x.Account == account.Id).ToList();
            }

            List <ResultLine> resultListIncome  = GetDataForTransactionsGroupByMonth(transactions.Where(x => x.Type == "Income").ToList());
            List <ResultLine> resultListExpense = GetDataForTransactionsGroupByMonth(transactions.Where(x => x.Type == "Expense").ToList());

            ObservableArrayList listIncome  = new ObservableArrayList();
            ObservableArrayList listExpense = new ObservableArrayList();

            foreach (var item in resultListIncome)
            {
                listIncome.Add(new ChartDataPoint(item.Name, Convert.ToDouble(item.Value)));
            }

            foreach (var item in resultListExpense)
            {
                listExpense.Add(new ChartDataPoint(item.Name, Convert.ToDouble(item.Value)));
            }

            List <ObservableArrayList> dataModel = new List <ObservableArrayList>();

            dataModel.Add(listIncome);
            dataModel.Add(listExpense);

            return(dataModel);
        }
コード例 #19
0
        internal static ObservableArrayList PieChartData(Account account)
        {
            List <Transaction> transactions = new List <Transaction>();

            if (account.Id != 0)
            {
                transactions = SilverCoinsManager.GetTransactions().Where(x => x.Type != "Transfer" && x.Account == account.Id).ToList();
            }
            else
            {
                transactions = SilverCoinsManager.GetTransactions().Where(x => x.Type != "Transfer").ToList();
            }

            List <ResultLine> resultList = transactions.GroupBy(x => x.Category)
                                           .Select(r => new ResultLine
            {
                Name  = SilverCoinsManager.GetCategory(r.First().Category).Name,
                Value = r.Sum(s => s.Amount)
            })
                                           .ToList();

            ObservableArrayList list = new ObservableArrayList();

            foreach (var item in resultList)
            {
                list.Add(new ChartDataPoint(item.Name, Convert.ToDouble(item.Value)));
            }

            return(list);
        }
コード例 #20
0
        private void LoadData()
        {
            for (var i = 0; i < 180; i++)
            {
                data.Add(new ChartDataPoint(i, Math.Sin(wave1 * (Math.PI / 180.0))));
                wave1++;
            }

            for (var i = 0; i < 180; i++)
            {
                data2.Add(new ChartDataPoint(i, Math.Sin(wave2 * (Math.PI / 180.0))));
                wave2++;
            }

            wave1 = data.Size();
        }
コード例 #21
0
 public GraphModel(double[] Xi, double[] Yi)
 {
     Data = new ObservableArrayList();
     for (int i = 0; i < Xi.Length; i++)
     {
         Data.Add(new ChartDataPoint(Xi[i], Yi[i]));
     }
 }
コード例 #22
0
 public static ObservableArrayList GetAreaData()
 {
     var datas = new ObservableArrayList();
     datas.Add(new ChartDataPoint("2010", 45));
     datas.Add(new ChartDataPoint("2011", 56));
     datas.Add(new ChartDataPoint("2012", 23));
     datas.Add(new ChartDataPoint("2013", 43));
     datas.Add(new ChartDataPoint("2014", Double.NaN));
     datas.Add(new ChartDataPoint("2015", 54));
     datas.Add(new ChartDataPoint("2016", 43));
     datas.Add(new ChartDataPoint("2017", 23));
     datas.Add(new ChartDataPoint("2018", 34));
     return datas;
 }
コード例 #23
0
        public override View GetSampleContent(Context context)
        {
            var chart = new SfChart(context);;

            chart.SetBackgroundColor(Color.White);
            chart.Title.Text        = "Products Growth - 2015";
            chart.Legend.Visibility = Visibility.Visible;

            if (context.Resources.DisplayMetrics.HeightPixels > context.Resources.DisplayMetrics.WidthPixels)
            {
                int padding = (context.Resources.DisplayMetrics.HeightPixels -
                               context.Resources.DisplayMetrics.WidthPixels) / 2;
                chart.SetPadding(0, padding / 2, 0, padding);
                chart.Legend.DockPosition = ChartDock.Bottom;
            }
            else
            {
                int padding = (context.Resources.DisplayMetrics.WidthPixels -
                               context.Resources.DisplayMetrics.HeightPixels) / 2;
                chart.SetPadding(padding, 0, padding, 0);
                chart.Legend.ItemMarginRight = padding / 6;
                chart.Legend.DockPosition    = ChartDock.Right;
            }

            var datas = new ObservableArrayList();

            datas.Add(new ChartDataPoint("Product A", 14));
            datas.Add(new ChartDataPoint("Product B", 54));
            datas.Add(new ChartDataPoint("Product C", 23));
            datas.Add(new ChartDataPoint("Product D", 53));

            var doughnutSeries = new DoughnutSeries
            {
                DataSource = datas,
                StartAngle = 180,
                EndAngle   = 360
            };

            doughnutSeries.DataMarker.ShowLabel    = true;
            doughnutSeries.DataMarker.LabelContent = LabelContent.Percentage;
            doughnutSeries.DataMarkerPosition      = CircularSeriesDataMarkerPosition.Outside;
            chart.Series.Add(doughnutSeries);
            return(chart);
        }
コード例 #24
0
        public static ObservableArrayList GetAreaData()
        {
            var datas = new ObservableArrayList();

            datas.Add(new ChartDataPoint("2010", 45));
            datas.Add(new ChartDataPoint("2011", 56));
            datas.Add(new ChartDataPoint("2012", 23));
            datas.Add(new ChartDataPoint("2013", 43));
            datas.Add(new ChartDataPoint("2014", Double.NaN));
            datas.Add(new ChartDataPoint("2015", 54));
            datas.Add(new ChartDataPoint("2016", 43));
            datas.Add(new ChartDataPoint("2017", 23));
            datas.Add(new ChartDataPoint("2018", 34));
            return(datas);
        }
コード例 #25
0
 public static ObservableArrayList GetNumericalData()
 {
     var datas = new ObservableArrayList();
     datas.Add(new ChartDataPoint(1, 54));
     datas.Add(new ChartDataPoint(2, 24));
     datas.Add(new ChartDataPoint(3, 53));
     datas.Add(new ChartDataPoint(4, 63));
     datas.Add(new ChartDataPoint(5, 35));
     return datas;
 }
コード例 #26
0
        public override View GetSampleContent(Context context)
        {
            var chart = new SfChart(context);
            chart.SetBackgroundColor(Color.White);
            chart.Title.Text = "Products Growth - 2015";
            chart.Legend.Visibility = Visibility.Visible;

            if (context.Resources.DisplayMetrics.HeightPixels > context.Resources.DisplayMetrics.WidthPixels)
            {
                int padding = (context.Resources.DisplayMetrics.HeightPixels -
                        context.Resources.DisplayMetrics.WidthPixels) / 2;
                chart.SetPadding(0, padding / 2, 0, padding);
                chart.Legend.DockPosition = ChartDock.Bottom;
            }
            else
            {
                int padding = (context.Resources.DisplayMetrics.WidthPixels -
                        context.Resources.DisplayMetrics.HeightPixels) / 2;
                chart.SetPadding(padding, 0, padding, 0);
                chart.Legend.ItemMarginRight = padding / 6;
                chart.Legend.DockPosition = ChartDock.Right;
            }

            var datas = new ObservableArrayList();
            datas.Add(new ChartDataPoint("Product A", 14));
            datas.Add(new ChartDataPoint("Product B", 54));
            datas.Add(new ChartDataPoint("Product C", 23));
            datas.Add(new ChartDataPoint("Product D", 53));
            
            var pieSeries = new PieSeries
            {
                DataSource = datas,
                StartAngle = 180,
                EndAngle = 360,
            };
            pieSeries.DataMarker.ShowLabel = true;
            pieSeries.DataMarker.LabelContent = LabelContent.Percentage;
            pieSeries.DataMarkerPosition = CircularSeriesDataMarkerPosition.Outside;
            chart.Series.Add(pieSeries);
            return chart;
        }
コード例 #27
0
        public override View GetSampleContent(Context context)
        {
            var chart = new SfChart(context);;

            chart.SetBackgroundColor(Color.White);

            chart.PrimaryAxis = new CategoryAxis {
                LabelPlacement = LabelPlacement.BetweenTicks
            };
            chart.SecondaryAxis = new NumericalAxis()
            {
                ShowMajorGridLines = false
            };

            var datas = new ObservableArrayList();

            datas.Add(new ChartDataPoint("Jan", 35, 17));
            datas.Add(new ChartDataPoint("Feb", 42, -11));
            datas.Add(new ChartDataPoint("Mar", 25, 5));
            datas.Add(new ChartDataPoint("Apr", 32, 10));
            datas.Add(new ChartDataPoint("May", 20, 3));
            datas.Add(new ChartDataPoint("Jun", 41, 30));

            var series = new RangeColumnSeries
            {
                DataSource = datas,
            };

            series.DataMarker.ShowLabel = true;
            chart.Series.Add(series);

            return(chart);
        }
コード例 #28
0
        public override View GetSampleContent(Context context)
        {
            var chart = new SfChart(context);;
            chart.SetBackgroundColor(Color.White);

            chart.PrimaryAxis = new CategoryAxis { LabelPlacement = LabelPlacement.BetweenTicks };
            chart.SecondaryAxis = new NumericalAxis() { ShowMajorGridLines = false };

            var datas = new ObservableArrayList();
            datas.Add(new ChartDataPoint("Jan", 35, 17));
            datas.Add(new ChartDataPoint("Feb", 42, -11));
            datas.Add(new ChartDataPoint("Mar", 25, 5));
            datas.Add(new ChartDataPoint("Apr", 32, 10));
            datas.Add(new ChartDataPoint("May", 20, 3));
            datas.Add(new ChartDataPoint("Jun", 41, 30));

            var series = new RangeColumnSeries
            {
                DataSource = datas,
            };

            series.DataMarker.ShowLabel = true;
            chart.Series.Add(series);

            return chart;
        }
コード例 #29
0
        public override View GetSampleContent(Context context)
        {
            var chart = new SfChart(context);;

            chart.SetBackgroundColor(Color.White);

            chart.PrimaryAxis = new CategoryAxis {
                ShowMajorGridLines = false, PlotOffset = 20
            };
            chart.SecondaryAxis = new NumericalAxis()
            {
                ShowMajorGridLines = false, PlotOffset = 20
            };

            var datas = new ObservableArrayList();

            datas.Add(new ChartDataPoint("2005", 54));
            datas.Add(new ChartDataPoint("2006", 34));
            datas.Add(new ChartDataPoint("2007", 53));
            datas.Add(new ChartDataPoint("2008", 63));
            datas.Add(new ChartDataPoint("2009", 35));
            datas.Add(new ChartDataPoint("2010", 27));
            datas.Add(new ChartDataPoint("2011", 13));
            datas.Add(new ChartDataPoint("2012", 40));
            datas.Add(new ChartDataPoint("2013", 25));

            var scatterSeries = new ScatterSeries
            {
                DataSource    = datas,
                ScatterHeight = 20,
                ScatterWidth  = 20
            };

            scatterSeries.DataMarker.ShowLabel = true;
            chart.Series.Add(scatterSeries);

            return(chart);
        }
コード例 #30
0
        public static ObservableArrayList GetSelectionData()
        {
            var datas = new ObservableArrayList();

            datas.Add(new ChartDataPoint("Jan", 42));
            datas.Add(new ChartDataPoint("Feb", 44));
            datas.Add(new ChartDataPoint("Mar", 53));
            datas.Add(new ChartDataPoint("Apr", 64));
            datas.Add(new ChartDataPoint("May", 75));
            datas.Add(new ChartDataPoint("Jun", 83));
            return(datas);
        }
コード例 #31
0
    public MainWindow() : base(Gtk.WindowType.Toplevel)
    {
        Build();

/*		linklabel1.LinkText = "Google";
 *              linklabel1.LinkURL = "http://www.google.com";
 *              linklabel1.Pixbuf = (Gdk.Pixbuf) PictureResourceStore.LoadResource ("calendar.png");
 *              colorlabel1.Color = new Cairo.Color (1, 0, 0);
 *              colorlabel1.SmallFonts = true;*/
        ObservableArrayList lst = new ObservableArrayList();

        for (double i = 0.0; i <= 1.0; i = i + 0.1)
        {
            lst.Add(new ColorClass(new Cairo.Color(i, i, i)));
        }
        foreach (ColorClass c in lst)
        {
            System.Console.WriteLine(c);
        }
        datatreeview1.ItemsDataSource = lst;
    }
コード例 #32
0
        public static ObservableArrayList GetDateTimValue()
        {
            Calendar calendar = new GregorianCalendar(2014, 1, 1);
            var      datas    = new ObservableArrayList();

            datas.Add(new ChartDataPoint(calendar.Time, 10d));
            AddDate(calendar);
            datas.Add(new ChartDataPoint(calendar.Time, 23d));
            AddDate(calendar);
            datas.Add(new ChartDataPoint(calendar.Time, 22d));
            AddDate(calendar);
            datas.Add(new ChartDataPoint(calendar.Time, 32d));
            AddDate(calendar);
            datas.Add(new ChartDataPoint(calendar.Time, 31d));
            AddDate(calendar);
            datas.Add(new ChartDataPoint(calendar.Time, 12d));
            AddDate(calendar);
            datas.Add(new ChartDataPoint(calendar.Time, 26d));

            return(datas);
        }
コード例 #33
0
       public override View GetSampleContent(Context context)
        {
            var chart = new SfChart(context);;
            chart.SetBackgroundColor(Color.White);
            chart.Legend.ToggleSeriesVisibility = true;
            chart.Legend.Visibility = Visibility.Visible;

            var primary = new CategoryAxis();
            primary.Title.Text = "Years";
            primary.Title.TextColor = Color.Black;
            primary.LabelPlacement = LabelPlacement.BetweenTicks;
            chart.PrimaryAxis = primary;

            var secondaryAxis = new NumericalAxis()
            {
                Minimum = 6200,
                Maximum = 8800,
                Interval = 200,
                ShowMajorGridLines = false
            };

            secondaryAxis.Title.Text = "Revenue";
            secondaryAxis.LabelStyle.LabelFormat = "$####";
            chart.SecondaryAxis = secondaryAxis;

            var datas = new ObservableArrayList();
            datas.Add(new ChartDataPoint("2010", 8000));
            datas.Add(new ChartDataPoint("2011", 8100));
            datas.Add(new ChartDataPoint("2012", 8250));
            datas.Add(new ChartDataPoint("2013", 8600));
            datas.Add(new ChartDataPoint("2014", 8700));

            var datas1 = new ObservableArrayList();
            datas1.Add(new ChartDataPoint("2010", 6));
            datas1.Add(new ChartDataPoint("2011", 15));
            datas1.Add(new ChartDataPoint("2012", 35));
            datas1.Add(new ChartDataPoint("2013", 65));
            datas1.Add(new ChartDataPoint("2014", 75));

            chart.Series.Add(new ColumnSeries()
            {
                Label = "Revenue",
                DataSource = datas
            });

            var lineSeries = new FastLineSeries()
            {
                Label = "Customers",
                DataSource = datas1,
                StrokeWidth = 7,
                YAxis = new NumericalAxis()
                {
                    OpposedPosition = true,
                    Minimum = 0,
                    Maximum = 80,
                    Interval = 5,
                    ShowMajorGridLines = false,
                }
            };
            chart.Series.Add(lineSeries);
            lineSeries.YAxis.Title.Text = "Number of Customers";
            return chart;
        }
コード例 #34
0
ファイル: Vraag1_Activity.cs プロジェクト: BNKocak/Project4
 public DataModel()
 {
     HighTemperature = new ObservableArrayList();
     HighTemperature.Add(new ChartDataPoint("Jan", 42));
     HighTemperature.Add(new ChartDataPoint("Feb", 44));
     HighTemperature.Add(new ChartDataPoint("Mar", 53));
     HighTemperature.Add(new ChartDataPoint("Apr", 64));
     HighTemperature.Add(new ChartDataPoint("May", 75));
     HighTemperature.Add(new ChartDataPoint("Jun", 83));
     HighTemperature.Add(new ChartDataPoint("Jul", 87));
     HighTemperature.Add(new ChartDataPoint("Aug", 84));
     HighTemperature.Add(new ChartDataPoint("Sep", 78));
     HighTemperature.Add(new ChartDataPoint("Oct", 67));
     HighTemperature.Add(new ChartDataPoint("Nov", 55));
     HighTemperature.Add(new ChartDataPoint("Dec", 45));
 }
コード例 #35
0
 public static ObservableArrayList GetSelectionData()
 {
     var datas = new ObservableArrayList();
     datas.Add(new ChartDataPoint("Jan", 42));
     datas.Add(new ChartDataPoint("Feb", 44));
     datas.Add(new ChartDataPoint("Mar", 53));
     datas.Add(new ChartDataPoint("Apr", 64));
     datas.Add(new ChartDataPoint("May", 75));
     datas.Add(new ChartDataPoint("Jun", 83));
     return datas;
 }
コード例 #36
0
        //---------------------------------------------------------------------------------------------------------------------------------------------------

        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            base.OnCreateView(inflater, container, savedInstanceState);

            //Element from the layout.
            SfChart Graph = new SfChart(Plugin.CurrentActivity.CrossCurrentActivity.Current.Activity);

            //Axes settings.
            CategoryAxis  AxeX = new CategoryAxis();
            NumericalAxis AxeY = new NumericalAxis();

            Graph.PrimaryAxis   = AxeX;
            Graph.SecondaryAxis = AxeY;

            AxeX.LabelRotationAngle   = 315;
            AxeX.LabelStyle.TextColor = Android.Graphics.Color.Black;
            AxeY.LabelStyle.TextColor = Android.Graphics.Color.Black;

            AxeX.EdgeLabelsDrawingMode = EdgeLabelsDrawingMode.Shift;

            //Graph settings.
            Graph.SetBackgroundColor(Android.Graphics.Color.DarkGreen);

            ChartZoomPanBehavior Zoom = new ChartZoomPanBehavior();

            Graph.Behaviors.Add(Zoom);

            ObservableArrayList ListForData = new ObservableArrayList();

            //If the user is choosed.
            if (Classes.User.CurrentUser != -1)
            {
                //Getting parameters of currrent user from DB.
                int k = 1;
                foreach (ParametresOfUser TempParametres in DatabaseUser.GetUser(User.CurrentUser).Parameters)
                {
                    ListForData.Add(new ChartDataPoint(TempParametres.EntryDate.ToShortDateString(), TempParametres.Weight));
                }

                //Setting data to the list
                SplineSeries Seria = new SplineSeries();
                Seria.DataSource = ListForData;

                //Settings oof lables.
                Seria.DataMarker.ShowMarker  = true;
                Seria.DataMarker.ShowLabel   = true;
                Seria.DataMarker.MarkerColor = Android.Graphics.Color.Yellow;
                Seria.DataMarker.ConnectorLineStyle.ConnectorHeight        = 50;
                Seria.DataMarker.ConnectorLineStyle.ConnectorRotationAngle = 175;
                Seria.DataMarker.ConnectorLineStyle.PathEffect             = new DashPathEffect(new float[] { 3, 3 }, 3);

                //Adding graph to form.
                Graph.Series.Add(Seria);
            }

            //If the user isn't choosed.
            else
            {
                HelpclassDataValidation.MakingErrorToast(Resource.String.ErrorMessage_Unchoosed);
            }

            return(Graph);
        }
コード例 #37
0
 public static ObservableArrayList GetSeriesData2()
 {
     var datas = new ObservableArrayList();
     datas.Add(new ChartDataPoint(1, 34));
     datas.Add(new ChartDataPoint(2, 20));
     datas.Add(new ChartDataPoint(3, 43));
     datas.Add(new ChartDataPoint(4, 53));
     datas.Add(new ChartDataPoint(5, 25));
     return datas;
 }
コード例 #38
0
        public override View GetSampleContent(Context context)
        {
            var chart = new SfChart(context);;

            chart.SetBackgroundColor(Color.White);
            chart.Legend.ToggleSeriesVisibility = true;
            chart.Legend.Visibility             = Visibility.Visible;

            var primary = new CategoryAxis();

            primary.Title.Text      = "Years";
            primary.Title.TextColor = Color.Black;
            primary.LabelPlacement  = LabelPlacement.BetweenTicks;
            chart.PrimaryAxis       = primary;

            var secondaryAxis = new NumericalAxis()
            {
                Minimum            = 6200,
                Maximum            = 8800,
                Interval           = 200,
                ShowMajorGridLines = false
            };

            secondaryAxis.Title.Text             = "Revenue";
            secondaryAxis.LabelStyle.LabelFormat = "$####";
            chart.SecondaryAxis = secondaryAxis;

            var datas = new ObservableArrayList();

            datas.Add(new ChartDataPoint("2010", 8000));
            datas.Add(new ChartDataPoint("2011", 8100));
            datas.Add(new ChartDataPoint("2012", 8250));
            datas.Add(new ChartDataPoint("2013", 8600));
            datas.Add(new ChartDataPoint("2014", 8700));

            var datas1 = new ObservableArrayList();

            datas1.Add(new ChartDataPoint("2010", 6));
            datas1.Add(new ChartDataPoint("2011", 15));
            datas1.Add(new ChartDataPoint("2012", 35));
            datas1.Add(new ChartDataPoint("2013", 65));
            datas1.Add(new ChartDataPoint("2014", 75));

            chart.Series.Add(new ColumnSeries()
            {
                Label      = "Revenue",
                DataSource = datas
            });

            var lineSeries = new FastLineSeries()
            {
                Label       = "Customers",
                DataSource  = datas1,
                StrokeWidth = 7,
                YAxis       = new NumericalAxis()
                {
                    OpposedPosition    = true,
                    Minimum            = 0,
                    Maximum            = 80,
                    Interval           = 5,
                    ShowMajorGridLines = false,
                }
            };

            chart.Series.Add(lineSeries);
            lineSeries.YAxis.Title.Text = "Number of Customers";
            return(chart);
        }
コード例 #39
0
 public static ObservableArrayList GetSeriesData3()
 {
     var datas = new ObservableArrayList();
     datas.Add(new ChartDataPoint(1, 24));
     datas.Add(new ChartDataPoint(2, 14));
     datas.Add(new ChartDataPoint(3, 33));
     datas.Add(new ChartDataPoint(4, 43));
     datas.Add(new ChartDataPoint(5, 15));
     return datas;
 }
コード例 #40
0
 public static ObservableArrayList GetTriangularData()
 {
     var datas = new ObservableArrayList();
     datas.Add(new ChartDataPoint("Bentley", 800));
     datas.Add(new ChartDataPoint("Audi", 810));
     datas.Add(new ChartDataPoint("BMW", 825));
     datas.Add(new ChartDataPoint("Jaguar", 860));
     datas.Add(new ChartDataPoint("Skoda", 875));
     return datas;
 }
コード例 #41
0
        public static ObservableArrayList GetDateTimValue()
        {
            Calendar calendar = new GregorianCalendar(2014, 1, 1);
            var datas = new ObservableArrayList();
            
            datas.Add(new ChartDataPoint(calendar.Time, 10d));
            AddDate(calendar);
            datas.Add(new ChartDataPoint(calendar.Time, 23d));
            AddDate(calendar);
            datas.Add(new ChartDataPoint(calendar.Time, 22d));
            AddDate(calendar);
            datas.Add(new ChartDataPoint(calendar.Time, 32d));
            AddDate(calendar);
            datas.Add(new ChartDataPoint(calendar.Time, 31d));
            AddDate(calendar);
            datas.Add(new ChartDataPoint(calendar.Time, 12d));
            AddDate(calendar);
            datas.Add(new ChartDataPoint(calendar.Time, 26d));

            return datas;
        }
コード例 #42
0
 public static ObservableArrayList GetStripLineData()
 {
     var datas = new ObservableArrayList();
     datas.Add(new ChartDataPoint("Jan", 33));
     datas.Add(new ChartDataPoint("Feb", 37));
     datas.Add(new ChartDataPoint("Mar", 39));
     datas.Add(new ChartDataPoint("Apr", 43));
     datas.Add(new ChartDataPoint("May", 45));
     datas.Add(new ChartDataPoint("Jun", 43));
     datas.Add(new ChartDataPoint("Jul", 41));
     datas.Add(new ChartDataPoint("Aug", 40));
     datas.Add(new ChartDataPoint("Sep", 39));
     datas.Add(new ChartDataPoint("Oct", 39));
     datas.Add(new ChartDataPoint("Nov", 34));
     datas.Add(new ChartDataPoint("Dec", 33));
     return datas;
 }
コード例 #43
0
 public static ObservableArrayList GetFinancialData()
 {
     var datas = new ObservableArrayList();
     datas.Add(new ChartDataPoint("2010", 873.8, 878.85, 855.5, 860.5));
     datas.Add(new ChartDataPoint("2011", 861, 868.4, 835.2, 843.45));
     datas.Add(new ChartDataPoint("2012", 846.15, 853, 838.5, 847.5));
     datas.Add(new ChartDataPoint("2013", 846, 860.75, 841, 855));
     datas.Add(new ChartDataPoint("2014", 841, 845, 827.85, 838.65));
     return datas;
 }        
コード例 #44
0
        public static ObservableArrayList GetStripLineData()
        {
            var datas = new ObservableArrayList();

            datas.Add(new ChartDataPoint("Jan", 33));
            datas.Add(new ChartDataPoint("Feb", 37));
            datas.Add(new ChartDataPoint("Mar", 39));
            datas.Add(new ChartDataPoint("Apr", 43));
            datas.Add(new ChartDataPoint("May", 45));
            datas.Add(new ChartDataPoint("Jun", 43));
            datas.Add(new ChartDataPoint("Jul", 41));
            datas.Add(new ChartDataPoint("Aug", 40));
            datas.Add(new ChartDataPoint("Sep", 39));
            datas.Add(new ChartDataPoint("Oct", 39));
            datas.Add(new ChartDataPoint("Nov", 34));
            datas.Add(new ChartDataPoint("Dec", 33));
            return(datas);
        }
コード例 #45
-1
       public override View GetSampleContent(Context context)
        {
            var chart = new SfChart(context);;
            chart.SetBackgroundColor(Color.White);
            chart.Legend.Visibility = Visibility.Visible;

            var datas = new ObservableArrayList();
            datas.Add(new ChartDataPoint("2010", 8000));
            datas.Add(new ChartDataPoint("2011", 8100));
            datas.Add(new ChartDataPoint("2012", 8250));
            datas.Add(new ChartDataPoint("2013", 8600));
            datas.Add(new ChartDataPoint("2014", 8700));

            var doughnutSeries = new DoughnutSeries
            {
                ExplodeIndex = 3,
                DataSource = datas,
                DataMarkerPosition = CircularSeriesDataMarkerPosition.OutsideExtended,
            };

            doughnutSeries.DataMarker.ShowLabel = true;
            doughnutSeries.ConnectorType = ConnectorType.Bezier;

            chart.Series.Add(doughnutSeries);
            return chart;
        }