public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            chart.BindingX = "Name";
            chart.Series.Add(new Series(chart, "Sales, Sales", "Sales"));
            chart.Series.Add(new Series(chart, "Expenses, Expenses", "Expenses"));
            chart.ItemsSource = SalesData.GetSalesDataList();

            chart.AxisX.Title                      = "Country";
            chart.AxisX.LineWidth                  = 2;
            chart.AxisX.MinorTickWidth             = 1;
            chart.AxisX.MajorTickWidth             = 0;
            chart.AxisX.IsHandleXFAxisLabelLoading = true;

            chart.AxisY.LineWidth        = 2;
            chart.AxisY.MinorGridVisible = true;
            chart.AxisY.MinorGridWidth   = 0.5;
            chart.AxisY.MinorGridDashes  = new double[] { 4, 4 };
            chart.AxisY.MinorTickWidth   = 1;
            chart.AxisY.MajorTickWidth   = 2;
            chart.AxisY.MajorGridWidth   = 1;
            chart.AxisY.MajorGridColor   = UIColor.FromWhiteAlpha(0.8f, 1.0f);
            chart.AxisY.MajorGridFill    = UIColor.FromWhiteAlpha(0.6f, 0.2f);
            chart.AxisY.MajorUnit        = 1000;
            chart.AxisY.Max = 10000;
            chart.AxisY.IsHandleXFAxisLabelLoading = true;

            chart.HandleLabelLoading += delegate(FlexChart sender, XuniRenderEngine renderEngine, int axisIndex, XuniLabelLoadingEventArgs eventArgs)
            {
                if (axisIndex == (int)AxisType.Y)
                {
                    if (eventArgs.Value <= 3000)
                    {
                        renderEngine.SetTextFill(UIColor.Red);
                    }
                    else if (eventArgs.Value <= 10000 && eventArgs.Value > 6000)
                    {
                        renderEngine.SetTextFill(UIColor.Green);
                    }
                    else
                    {
                        renderEngine.SetTextFill(UIColor.Black);
                    }
                    eventArgs.Label = "$" + (eventArgs.Value / 1000).ToString() + "K";

                    return(false);
                }
                else if (axisIndex == (int)AxisType.X)
                {
                    UIImage img = new UIImage("Images/" + eventArgs.Label);
                    img.Draw(new CoreGraphics.CGRect(eventArgs.Region.Left, eventArgs.Region.Top, eventArgs.Region.Width, eventArgs.Region.Height));
                    eventArgs.Label = "";

                    return(true);
                }

                return(false);
            };
        }
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            chart.BindingX = "Name";
            chart.Series.Add(new Series(chart, "Expenses", "Total Expenses"));


            chart.ItemsSource            = SalesData.GetSalesDataList();
            chart.ChartType              = ChartType.Bar;
            chart.IsAnimated             = false;
            chart.Tooltip.IsVisible      = false;
            chart.AxisX.MajorGridVisible = true;
            chart.AxisY.LabelsVisible    = false;
            chart.AxisY.MajorGridVisible = false;
            chart.AxisY.MinorGridVisible = false;
            chart.AxisY.MajorTickWidth   = 0;
            chart.Palette = XuniPalettes.Organic;

            chart.DataLabel.Content                  = "{x} {y}";
            chart.DataLabel.DataLabelFormat          = "F2";
            chart.DataLabel.Position                 = ChartDataLabelPosition.Left;
            chart.DataLabel.DataLabelFontColor       = UIColor.Red;
            chart.DataLabel.DataLabelBackgroundColor = UIColor.White;
            chart.DataLabel.DataLabelBorderColor     = UIColor.Blue;
            chart.DataLabel.DataLabelBorderWidth     = 1;
            chart.DataLabel.DataLabelFont            = UIFont.SystemFontOfSize(15);


            modeSelector.SelectedSegment = 1;
        }
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            this.chart.BindingX = "Name";
            this.chart.Series.Add(new Xuni.iOS.FlexChart.Series(this.chart, "Sales, Sales", "Sales")
            {
                Color       = UIColor.Purple,
                BorderColor = UIColor.Green,
                BorderWidth = 2
            });
            this.chart.Series.Add(new Xuni.iOS.FlexChart.Series(this.chart, "Expenses, Expenses", "Expenses")
            {
                Color       = UIColor.Red,
                BorderColor = new UIColor(0.502f, 0, 0, 1),
                BorderWidth = 2
            });
            this.chart.Series.Add(new Xuni.iOS.FlexChart.Series(this.chart, "Downloads, Downloads", "Downloads")
            {
                ChartType         = Xuni.iOS.FlexChart.ChartType.LineSymbols,
                Color             = new UIColor(1, 0.416f, 1, 1),
                BorderWidth       = 10,
                SymbolColor       = UIColor.Yellow,
                SymbolBorderColor = UIColor.Yellow,
                SymbolBorderWidth = 5
            });
            this.chart.ItemsSource = SalesData.GetSalesDataList();
        }
Пример #4
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            chart.BindingX = "Name";
            chart.Series.Add(new Series(chart, "Sales, Sales", "Sales"));
            chart.Series.Add(new Series(chart, "Expenses, Expenses", "Expenses"));
            chart.Series.Add(new Series(chart, "Downloads, Downloads", "Downloads"));
            chart.ItemsSource = SalesData.GetSalesDataList();

            chart.ChartType = ChartType.Line;

            MyMarkerView view = new MyMarkerView(chart.LineMarker);

            view.MarkerRender                  = new MyMarkerRender(view);
            chart.LineMarker.Content           = view;
            chart.LineMarker.IsVisible         = true;
            chart.LineMarker.Alignment         = XuniChartMarkerAlignment.BottomRight;
            chart.LineMarker.Lines             = XuniChartMarkerLines.Vertical;
            chart.LineMarker.Interaction       = XuniChartMarkerInteraction.Move;
            chart.LineMarker.DragContent       = true;
            chart.LineMarker.SeriesIndex       = -1;
            chart.LineMarker.VerticalLineColor = UIColor.Gray;
            chart.LineMarker.VerticalPosition  = 0;

            chart.AddSubview(view);
        }
Пример #5
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            chart.BindingX = "Name";
            chart.Series.Add(new Series(chart, "Sales, Sales", "Sales"));
            chart.Series.Add(new Series(chart, "Expenses, Expenses", "Expenses"));
            chart.Series.Add(new Series(chart, "Downloads, Downloads", "Downloads"));
            chart.ItemsSource = SalesData.GetSalesDataList();

            chart.ChartType = ChartType.Scatter;


            chart.Header              = "Sample Chart";
            chart.HeaderTextColor     = new UIColor(0.502f, 0.016f, 0.302f, 1);
            chart.HeaderFont          = UIFont.BoldSystemFontOfSize(24);
            chart.HeaderTextAlignment = HorizontalAlignment.Center;
            chart.Footer              = "2015 GrapeCity, Inc.";
            chart.FooterTextColor     = new UIColor(0.502f, 0.016f, 0.302f, 1);
            chart.FooterFont          = UIFont.SystemFontOfSize(16);
            chart.FooterTextAlignment = HorizontalAlignment.Center;

            chart.AxisX.Title            = "Country";
            chart.AxisX.TitleFont        = UIFont.BoldSystemFontOfSize(16);
            chart.AxisX.TitleFont        = UIFont.ItalicSystemFontOfSize(16);
            chart.AxisX.MajorGridVisible = true;
            chart.AxisY.Title            = "Amount";
            chart.AxisY.TitleFont        = UIFont.BoldSystemFontOfSize(16);
            chart.AxisY.TitleFont        = UIFont.ItalicSystemFontOfSize(16);
            chart.AxisY.Format           = "C0";
        }
Пример #6
0
 public override void ViewDidLoad()
 {
     base.ViewDidLoad();
     this.chart.BindingX = "Name";
     this.chart.Series.Add(new Xuni.iOS.FlexChart.Series(this.chart, "Sales, Sales", "Sales"));
     this.chart.Series.Add(new Xuni.iOS.FlexChart.Series(this.chart, "Expenses, Expenses", "Expenses"));
     this.chart.Series.Add(new Xuni.iOS.FlexChart.Series(this.chart, "Downloads, Downloads", "Downloads"));
     this.chart.ItemsSource = SalesData.GetSalesDataList();
 }
Пример #7
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            var chart = FindViewById <Com.Grapecity.Xuni.Flexchart.FlexChart>(Resource.Id.flexchart);

            //chart.CollectionView = new Com.Grapecity.Xuni.Core.Collection.Implementations.CollectionView(new List<int> { 1, 2, 3 });
            chart.ItemsSource = SalesData.GetSalesDataList();
        }
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();
            chart.BindingX = "Name";
            chart.Series.Add(new Series(chart, "Sales, Sales", "Sales"));
            chart.Series.Add(new Series(chart, "Expenses, Expenses", "Expenses"));
            chart.Series.Add(new Series(chart, "Downloads, Downloads", "Downloads"));
            chart.ItemsSource = SalesData.GetSalesDataList();

            chart.SelectionMode = SelectionMode.Series;
            chart.ChartType     = ChartType.LineSymbols;
        }
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            chart.BindingX = "Name";

            chart.Series.Add(new Series(chart, "Sales, Downloads", "Sales"));
            chart.Series.Add(new Series(chart, "Expenses, Downloads", "Expenses"));

            chart.ChartType = ChartType.Bubble;
            chart.LoadAnimation.AnimationMode = AnimationMode.Series;

            chart.ItemsSource = SalesData.GetSalesDataList();
        }
Пример #10
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            picker.Model = new ChartTypesModel(this);

            chart.BindingX = "Name";
            chart.Series.Add(new Series(chart, "Sales, Sales", "Sales"));
            chart.Series.Add(new Series(chart, "Expenses, Expenses", "Expenses"));
            chart.Series.Add(new Series(chart, "Downloads, Downloads", "Downloads"));
            chart.ItemsSource = SalesData.GetSalesDataList();

            chart.LoadAnimation.AnimationMode = AnimationMode.Point;
            chart.Palette = XuniPalettes.Modern;
        }
Пример #11
0
 void chart_PlotElementLoading(object sender, ChartPlotElementEventArgs e)
 {
     // only customize expenses series
     if (e.DataPoint.SeriesName.Equals("Expenses"))
     {
         // get sales value at point index
         SalesData data = e.DataPoint.DataObject as SalesData;
         // color expenses that are greater than sales as RED
         if (data != null && data.Expenses >= data.Sales)
         {
             e.RenderEngine.SetFill(Android.Graphics.Color.Red.ToArgb());
         }
     }
     e.DefaultRender.Execute();
 }
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();


            picker.Model = new ThemeModel(this);
            picker.ShowSelectionIndicator = true;
            picker.Hidden = false;

            this.chart.BindingX = "Name";
            this.chart.Series.Add(new Xuni.iOS.FlexChart.Series(this.chart, "Sales, Sales", "Sales"));
            this.chart.Series.Add(new Xuni.iOS.FlexChart.Series(this.chart, "Expenses, Expenses", "Expenses"));
            this.chart.Series.Add(new Xuni.iOS.FlexChart.Series(this.chart, "Downloads, Downloads", "Downloads"));
            this.chart.ItemsSource = SalesData.GetSalesDataList();
        }
Пример #13
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();
            picker.Model = new ChartTypesModel(this);

            chart.BindingX = "Name";

            chart.Series.Add(new Series(chart, "Sales, Sales", "Sales"));
            chart.Series.Add(new Series(chart, "Expenses, Expenses", "Expenses"));
            chart.Series.Add(new Series(chart, "Downloads, Downloads", "Downloads"));

            chart.ItemsSource = SalesData.GetSalesDataList();

            chart.ChartType = ChartType.Area;
            chart.Stacking  = Stacking.Stacked;
        }
Пример #14
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            picker.Model = new ChartTypesModel(this);

            chart.BindingX = "Name";
            chart.Series.Add(new Series(chart, "Sales, Sales", "Sales"));
            chart.Series.Add(new Series(chart, "Expenses, Expenses", "Expenses"));
            chart.Series.Add(new Series(chart, "Downloads, Downloads", "Downloads"));
            chart.ItemsSource = SalesData.GetSalesDataList();

            chart.SelectionMode       = SelectionMode.Series;
            chart.SelectedBorderColor = UIColor.Red;
            chart.SelectedBorderWidth = 3;
            chart.SelectedDashes      = new double[] { 7.5, 2.5 };
        }
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            chart.BindingX = "Name";
            chart.Series.Add(new Series(chart, "Sales, Sales", "Sales"));
            chart.Series.Add(new Series(chart, "Expenses, Expenses", "Expenses"));
            chart.Series.Add(new Series(chart, "Downloads, Downloads", "Downloads"));

            chart.Stacking = Stacking.Stacked;
            chart.Palette  = XuniPalettes.Zen;
            chart.LoadAnimation.AnimationMode = AnimationMode.Series;
            chart.AxisY.AxisLineVisible       = false;
            chart.AxisY.MajorUnit             = 2000;

            var tooltip = new MyTooltip();

            tooltip.BackgroundColor = new UIColor(1.0f, 1.0f, 0.792f, 1.0f);
            chart.Tooltip.Content   = tooltip;

            chart.ItemsSource = SalesData.GetSalesDataList();
        }
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();
            chart.BindingX = "Name";

            chart.Series.Add(new Series(chart, "Sales, Sales", "Sales"));
            chart.ChartType   = ChartType.Line;
            chart.ItemsSource = SalesData.GetSalesDataList();

            chart.Annotations.Add(new XuniChartPolygonAnnotation(chart)
            {
                IsVisible   = true,
                Attachment  = XuniChartAnnotationAttachment.Absolute,
                Color       = UIColor.Red,
                BorderColor = new UIColor(20.0f / 255.0f, 153.0f / 255.0f, 212.0f / 255.0f, 1.0f),
                BorderWidth = 2,
                TextColor   = UIColor.Black,
                Text        = "Absolute",
                TooltipText = "Polygon Annotation\\nPaths:[{0,0},{40,40},{80,0},\\n{60,-40},{20,-40}]\\nAttachment:Absolute",
                Points      = new XuniPoint[] { new XuniPoint(60, 40), new XuniPoint(20, 80), new XuniPoint(35, 120), new XuniPoint(85, 120), new XuniPoint(100, 80) }.ToList()
            });

            chart.Annotations.Add(new XuniChartEllipseAnnotation(chart)
            {
                IsVisible   = true,
                Position    = XuniChartAnnotationPosition.Center,
                Attachment  = XuniChartAnnotationAttachment.Relative,
                Width       = 60,
                Height      = 40,
                Point       = new XuniPoint(0.8, 0.3),
                Color       = new UIColor(241.0f / 255.0f, 175.0f / 255.0f, 102.0f / 255.0f, 1.0f),
                BorderColor = new UIColor(188.0f / 255.0f, 136.0f / 255.0f, 80.0f / 255.0f, 1.0f),
                BorderWidth = 2,
                Text        = "Relative",
                TooltipText = "Ellipse Annotation\\nPoint:{0.8,0.3}\\nAttachment:Relative"
            });

            double middleY = (chart.AxisY.ActualDataMax - chart.AxisY.ActualDataMin) / 2 + chart.AxisY.ActualDataMin;

            chart.Annotations.Add(new XuniChartLineAnnotation(chart)
            {
                IsVisible  = true,
                Attachment = XuniChartAnnotationAttachment.DataCoordinate,
                Start      = new XuniPoint(0, middleY),
                End        = new XuniPoint(chart.AxisX.ActualDataMax, middleY),
                Color      = UIColor.Blue,
                LineWidth  = 3
            });

            chart.Annotations.Add(new XuniChartTextAnnotation(chart)
            {
                IsVisible  = true,
                Position   = XuniChartAnnotationPosition.Right,
                Attachment = XuniChartAnnotationAttachment.DataCoordinate,
                Width      = 80,
                Height     = 20,
                Point      = new XuniPoint(0.3, middleY + 200),
                Font       = UIFont.BoldSystemFontOfSize(12),
                Text       = "Data Coordinate"
            });

            chart.Annotations.Add(new XuniChartImageAnnotation(chart)
            {
                IsVisible   = true,
                Position    = XuniChartAnnotationPosition.Center,
                Attachment  = XuniChartAnnotationAttachment.DataIndex,
                SeriesIndex = 0,
                PointIndex  = 2,
                Width       = 50,
                Height      = 50,
                Offset      = new XuniPoint(0, 10),
                Source      = new UIImage("Images/xuni_butterfly"),
                TooltipText = "Image Annotation\nPointIndex:{2}\nAttachment:DataIndex"
            });

            chart.Annotations.Add(new XuniChartRectangleAnnotation(chart)
            {
                IsVisible   = true,
                Position    = XuniChartAnnotationPosition.Center,
                Attachment  = XuniChartAnnotationAttachment.DataIndex,
                SeriesIndex = 0,
                PointIndex  = 3,
                Width       = 100,
                Height      = 50,
                BorderWidth = 2,
                Text        = "DataIndex",
                TooltipText = "Rectangle Annotation\\nPointIndex:{6}\\nAttachment:DataIndex",
                Color       = new UIColor(169.0f / 255.0f, 230.0f / 255.0f, 25.0f / 255.0f, 1.0f),
                BorderColor = new UIColor(34.0f / 255.0f, 166.0f / 255.0f, 60.0f / 255.0f, 1.0f)
            });
        }
Пример #17
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            // Perform any additional setup after loading the view, typically from a nib.
            XuniLicenseManager.Key = License.Key;

            FlexChart chart = new FlexChart();

            chart.Tag = 1;

            // set title/footer
            chart.Header             = "FlexChart Sales";
            chart.Footer             = "GrapeCity Xuni";
            chart.Legend.BorderWidth = 1;
            chart.Legend.BorderColor = UIColor.Gray;

            // set palette
            chart.Palette = XuniPalettes.Coral;
            // set data source
            chart.ItemsSource = SalesData.GetSalesDataList();
            // bind X axis to display category names
            chart.BindingX        = (NSString)"Date";
            chart.Legend.Position = Position.None;
            // configure default axes
            chart.AxisX.LabelAngle = 45;
            chart.AxisX.Format     = "d";
            chart.AxisY.Format     = "c0";
            chart.AxisY.Title      = "Dollars";

            // add second Y axis
            Axis y2 = new Axis(Position.Right, chart);

            y2.MajorGridVisible = false;
            y2.MinorGridVisible = false;
            y2.LabelsVisible    = true;
            y2.Title            = "Downloads";
            chart.AxesArray.Add(y2);

            // create series with binding
            Series sales     = new Series(chart, (NSString)"Sales", (NSString)"Sales");
            Series expenses  = new Series(chart, (NSString)"Expenses", (NSString)"Expenses");
            Series downloads = new Series(chart, (NSString)"Downloads", (NSString)"Downloads");

            downloads.AxisY     = y2;
            downloads.ChartType = ChartType.Line;
            chart.Series.Add(sales);
            chart.Series.Add(expenses);
            chart.Series.Add(downloads);

            // customize tooltip
            //MyTooltip t = new MyTooltip();
            //t.BackgroundColor = UIColor.Blue;
            //chart.Tooltip.Content = t;
            chart.Tooltip.IsVisible = true;
            // customize plot element
            chart.DataLabel.Content                  = (NSString)"{y}";
            chart.DataLabel.DataLabelFormat          = (NSString)"C0";
            chart.DataLabel.DataLabelBackgroundColor = UIColor.White;
            chart.DataLabel.DataLabelFontColor       = UIColor.Red;
            chart.DataLabel.DataLabelBorderColor     = UIColor.Gray;
            chart.DataLabel.DataLabelBorderWidth     = 0.1;
            chart.DataLabel.Position                 = ChartDataLabelPosition.Top;
            // configure animation
            chart.LoadAnimation.AnimationMode = AnimationMode.Point;
            View.AddSubview(chart);
        }
Пример #18
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            LicenseManager.Key = License.Key;

            // Set our view from the "main" layout resource
            SetContentView(Resource.Layout.Main);

            // get chart from view
            chart = FindViewById <FlexChart>(Resource.Id.flexchart);

            // set title/footer
            chart.Header             = "FlexChart Sales";
            chart.Footer             = "GrapeCity Xuni";
            chart.Legend.BorderWidth = 1;
            chart.Legend.BorderColor = System.Drawing.Color.Gray.ToArgb();

            // set palette
            chart.SetPalette(Palettes.Modern);

            // bind X axis to display category names
            chart.BindingX = "Date";

            // create series with binding
            ChartSeries sales     = new ChartSeries(chart, "Sales", "Sales"); // new Series(chart, legend name, binding property)
            ChartSeries expenses  = new ChartSeries(chart, "Expenses", "Expenses");
            ChartSeries downloads = new ChartSeries(chart, "Downloads", "Downloads");

            downloads.ChartType = ChartType.Line;
            chart.Series.Add(sales);
            chart.Series.Add(expenses);
            chart.Series.Add(downloads);

            // set data source
            chart.ItemsSource = SalesData.GetSalesDataList();

            // configure default axes
            chart.AxisX.LabelAngle = 45;
            chart.AxisX.Format     = "d";
            chart.AxisY.Format     = "c0";
            chart.AxisY.Title      = "Dollars";

            // add second Y axis
            ChartAxis y2 = new ChartAxis(chart, ChartPositionType.Right);

            y2.Name             = "y2";
            y2.Format           = "n0";
            y2.MajorGridVisible = false;
            y2.MinorGridVisible = false;
            y2.LabelsVisible    = true;
            y2.Title            = "Downloads";
            chart.Axes.Add(y2);

            downloads.AxisY = "y2";

            // customize tooltip
            chart.Tooltip.Content = new MyTooltip(chart, chart.Context);

            // customize plot element
            chart.PlotElementLoading += chart_PlotElementLoading;

            // configure animation
            chart.LoadAnimation.AnimationMode = AnimationMode.Point;
        }