//[Export ("chart:seriesAtIndex:")]
    public override SFSeries GetSeries(SFChart chart, nint index)
    {
        SFStackingColumnSeries series = new SFStackingColumnSeries();

        series.DataMarkerPosition   = SFChartDataMarkerPosition.Center;
        series.DataMarker.ShowLabel = true;
        series.DataMarker.LabelStyle.LabelPosition = SFChartDataMarkerLabelPosition.Center;
        return(series);
    }
Example #2
0
        public StackedColumn()
        {
            SFChart chart = new SFChart();

            chart.Title.Text         = new NSString("Mobile Game Market by Country");
            chart.ColorModel.Palette = SFChartColorPalette.Natural;

            SFCategoryAxis primaryAxis = new SFCategoryAxis();

            primaryAxis.LabelPlacement          = SFChartLabelPlacement.BetweenTicks;
            primaryAxis.ShowMajorGridLines      = false;
            primaryAxis.MajorTickStyle.LineSize = 0;
            chart.PrimaryAxis              = primaryAxis;
            chart.SecondaryAxis            = new SFNumericalAxis();
            chart.SecondaryAxis.Title.Text = new NSString("Sales");
            chart.SecondaryAxis.Maximum    = new NSNumber(500);
            chart.SecondaryAxis.Minimum    = new NSNumber(0);
            chart.SecondaryAxis.Interval   = new NSNumber(100);
            chart.SecondaryAxis.AxisLineStyle.LineWidth = 0;
            chart.SecondaryAxis.MajorTickStyle.LineSize = 0;
            NSNumberFormatter formatter = new NSNumberFormatter();

            formatter.PositiveSuffix = "B";
            chart.SecondaryAxis.LabelStyle.LabelFormatter = formatter;
            ChartViewModel dataModel = new ChartViewModel();

            SFStackingColumnSeries series1 = new SFStackingColumnSeries();

            series1.ItemsSource     = dataModel.StackedColumnData1;
            series1.XBindingPath    = "XValue";
            series1.YBindingPath    = "YValue";
            series1.EnableTooltip   = true;
            series1.Label           = "UK";
            series1.EnableAnimation = true;
            chart.Series.Add(series1);

            SFStackingColumnSeries series2 = new SFStackingColumnSeries();

            series2.ItemsSource     = dataModel.StackedColumnData2;
            series2.XBindingPath    = "XValue";
            series2.YBindingPath    = "YValue";
            series2.EnableTooltip   = true;
            series2.Label           = "Germany";
            series2.EnableAnimation = true;
            chart.Series.Add(series2);

            SFStackingColumnSeries series3 = new SFStackingColumnSeries();

            series3.ItemsSource     = dataModel.StackedColumnData3;
            series3.XBindingPath    = "XValue";
            series3.YBindingPath    = "YValue";
            series3.EnableTooltip   = true;
            series3.Label           = "France";
            series3.EnableAnimation = true;
            chart.Series.Add(series3);

            SFStackingColumnSeries series4 = new SFStackingColumnSeries();

            series4.ItemsSource     = dataModel.StackedColumnData4;
            series4.XBindingPath    = "XValue";
            series4.YBindingPath    = "YValue";
            series4.EnableTooltip   = true;
            series4.Label           = "Italy";
            series4.EnableAnimation = true;
            chart.Series.Add(series4);

            chart.Legend.Visible = true;
            chart.Legend.ToggleSeriesVisibility = true;
            chart.Legend.IconWidth    = 14;
            chart.Legend.IconHeight   = 14;
            chart.Legend.DockPosition = SFChartLegendPosition.Bottom;

            this.AddSubview(chart);
        }
Example #3
0
        public StackedColumn()
        {
            SFChart chart = new SFChart();

            chart.Title.Text         = new NSString("Most Popular Search Engines");
            chart.ColorModel.Palette = SFChartColorPalette.Natural;

            SFCategoryAxis primaryAxis = new SFCategoryAxis();

            primaryAxis.LabelPlacement     = SFChartLabelPlacement.BetweenTicks;
            primaryAxis.Title.Text         = new NSString("Month");
            chart.PrimaryAxis              = primaryAxis;
            chart.SecondaryAxis            = new SFNumericalAxis();
            chart.SecondaryAxis.Title.Text = new NSString("Number of Visitor in Millions");
            chart.SecondaryAxis.Maximum    = new NSNumber(1800);
            ChartViewModel dataModel = new ChartViewModel();

            SFStackingColumnSeries series1 = new SFStackingColumnSeries();

            series1.ItemsSource     = dataModel.StackedColumnData1;
            series1.XBindingPath    = "XValue";
            series1.YBindingPath    = "YValue";
            series1.EnableTooltip   = true;
            series1.Label           = "Google";
            series1.EnableAnimation = true;
            chart.Series.Add(series1);

            SFStackingColumnSeries series2 = new SFStackingColumnSeries();

            series2.ItemsSource     = dataModel.StackedColumnData2;
            series2.XBindingPath    = "XValue";
            series2.YBindingPath    = "YValue";
            series2.EnableTooltip   = true;
            series2.Label           = "Bing";
            series2.EnableAnimation = true;
            chart.Series.Add(series2);

            SFStackingColumnSeries series3 = new SFStackingColumnSeries();

            series3.ItemsSource     = dataModel.StackedColumnData3;
            series3.XBindingPath    = "XValue";
            series3.YBindingPath    = "YValue";
            series3.EnableTooltip   = true;
            series3.Label           = "Yahoo";
            series3.EnableAnimation = true;
            chart.Series.Add(series3);

            SFStackingColumnSeries series4 = new SFStackingColumnSeries();

            series4.ItemsSource     = dataModel.StackedColumnData4;
            series4.XBindingPath    = "XValue";
            series4.YBindingPath    = "YValue";
            series4.EnableTooltip   = true;
            series4.Label           = "Ask";
            series4.EnableAnimation = true;
            chart.Series.Add(series4);

            chart.Legend.Visible = true;
            chart.Legend.ToggleSeriesVisibility = true;
            chart.Legend.IconWidth    = 14;
            chart.Legend.IconHeight   = 14;
            chart.Legend.DockPosition = SFChartLegendPosition.Bottom;
            chart.AddChartBehavior(new SFChartZoomPanBehavior());

            this.AddSubview(chart);
        }
	//[Export ("chart:seriesAtIndex:")]
	public override SFSeries GetSeries (SFChart chart, nint index)
	{
		SFStackingColumnSeries series   = new SFStackingColumnSeries ();
		series.DataMarkerPosition 		= SFChartDataMarkerPosition.Center;
		series.DataMarker.ShowLabel		= true;
		series.DataMarker.LabelStyle.LabelPosition = SFChartDataMarkerLabelPosition.Center;
		return series;
	}