public DataMarker() { chart = new SFChart(); chart.Title.Text = new NSString("Unemployment Rate"); SFCategoryAxis primary = new SFCategoryAxis(); primary.ShowMajorGridLines = false; chart.PrimaryAxis = primary; chart.SecondaryAxis = new SFNumericalAxis(); chart.SecondaryAxis.ShowMajorGridLines = false; chart.SecondaryAxis.Maximum = new NSNumber(100); ChartViewModel dataModel = new ChartViewModel(); SFBarSeries series = new SFBarSeries(); series.ItemsSource = dataModel.DataMarkerData; series.XBindingPath = "XValue"; series.YBindingPath = "YValue"; series.DataMarker.LabelStyle.LabelPosition = SFChartDataMarkerLabelPosition.Outer; //series.Color = UIColor.FromRGB(233.0f / 255.0f, 88.0f / 255.0f, 83.0f / 255.0f); series.DataMarker.ShowLabel = true; chart.Series.Add(series); chart.Delegate = new ChartDataMarkerDelegate(); chart.ColorModel.Palette = SFChartColorPalette.Natural; this.AddSubview(chart); }
public override SFSeries GetSeries(SFChart chart, nint index) { SFBarSeries series = new SFBarSeries(); series.DataMarker.ShowLabel = true; return(series); }
public Bar() { SFChart chart = new SFChart(); chart.ColorModel.Palette = SFChartColorPalette.Natural; SFCategoryAxis primaryAxis = new SFCategoryAxis(); primaryAxis.EdgeLabelsDrawingMode = SFChartAxisEdgeLabelsDrawingMode.Shift; primaryAxis.ShowMajorGridLines = false; primaryAxis.Title.Text = new NSString("Food"); chart.PrimaryAxis = primaryAxis; chart.SecondaryAxis = new SFNumericalAxis() { EdgeLabelsDrawingMode = SFChartAxisEdgeLabelsDrawingMode.Shift, ShowMajorGridLines = false, Visible = false }; chart.Delegate = new DataMarkerFormatter(); ChartViewModel dataModel = new ChartViewModel(); chart.Title.Text = new NSString("UK Trade in Food Groups - 2015"); SFBarSeries series1 = new SFBarSeries(); series1.ItemsSource = dataModel.BarData1; series1.XBindingPath = "XValue"; series1.YBindingPath = "YValue"; series1.EnableTooltip = true; series1.DataMarker.ShowLabel = true; series1.DataMarker.LabelStyle.Font = UIFont.BoldSystemFontOfSize(10); series1.DataMarker.LabelStyle.LabelPosition = SFChartDataMarkerLabelPosition.Inner; series1.Label = "Imports"; series1.EnableAnimation = true; chart.Series.Add(series1); SFBarSeries series2 = new SFBarSeries(); series2.ItemsSource = dataModel.BarData2; series2.XBindingPath = "XValue"; series2.YBindingPath = "YValue"; series2.EnableTooltip = true; series2.DataMarker.ShowLabel = true; series2.DataMarker.LabelStyle.Font = UIFont.BoldSystemFontOfSize(10); series2.Label = "Exports"; series2.EnableAnimation = true; series2.DataMarker.LabelStyle.LabelPosition = SFChartDataMarkerLabelPosition.Inner; chart.Series.Add(series2); chart.Legend.Visible = true; chart.Legend.ToggleSeriesVisibility = true; chart.Legend.IconWidth = 14; chart.Legend.IconHeight = 14; chart.Legend.DockPosition = SFChartLegendPosition.Bottom; this.AddSubview(chart); }
public Bar() { SFChart chart = new SFChart(); chart.ColorModel.Palette = SFChartColorPalette.Natural; SFCategoryAxis primaryAxis = new SFCategoryAxis(); chart.PrimaryAxis = primaryAxis; chart.SecondaryAxis = new SFNumericalAxis() { Minimum = new NSNumber(3), Maximum = new NSNumber(12), Interval = new NSNumber(1), EdgeLabelsDrawingMode = SFChartAxisEdgeLabelsDrawingMode.Shift }; chart.PrimaryAxis.Title.Text = new NSString("Years"); chart.SecondaryAxis.Title.Text = new NSString("Percentage"); ChartViewModel dataModel = new ChartViewModel(); chart.Title.Text = new NSString("Unemployment Rate (%)"); SFBarSeries series1 = new SFBarSeries(); series1.ItemsSource = dataModel.BarData1; series1.XBindingPath = "XValue"; series1.YBindingPath = "YValue"; series1.EnableTooltip = true; series1.DataMarker.ShowLabel = true; series1.DataMarker.LabelStyle.Font = UIFont.BoldSystemFontOfSize(10); series1.Label = "India"; series1.EnableAnimation = true; chart.Series.Add(series1); SFBarSeries series2 = new SFBarSeries(); series2.ItemsSource = dataModel.BarData2; series2.XBindingPath = "XValue"; series2.YBindingPath = "YValue"; series2.EnableTooltip = true; series2.DataMarker.ShowLabel = true; series2.DataMarker.LabelStyle.Font = UIFont.BoldSystemFontOfSize(10); series2.Label = "US"; series2.EnableAnimation = true; chart.Series.Add(series2); 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); }
public override SFSeries GetSeries(SFChart chart, nint index) { var series = new SFBarSeries { EnableTooltip = true }; series.DataMarker.ShowLabel = true; series.DataMarker.LabelStyle.Font = UIFont.BoldSystemFontOfSize(10); series.LegendIcon = SFChartLegendIcon.Rectangle; series.EnableAnimation = true; series.EnableDataPointSelection = true; series.Label = index == 1 ? new NSString("Servicio de Campo") : new NSString("Programado"); return(series); }
public CategoryAxis() { SFChart chart = new SFChart(); chart.Title.Text = new NSString("Internet Users - 2016"); SFCategoryAxis categoryAxis = new SFCategoryAxis(); categoryAxis.LabelPlacement = SFChartLabelPlacement.BetweenTicks; categoryAxis.ShowMajorGridLines = false; chart.PrimaryAxis = categoryAxis; chart.PrimaryAxis.Interval = new NSNumber(1); chart.PrimaryAxis.Title.Text = new NSString("Country"); chart.SecondaryAxis = new SFNumericalAxis(); chart.SecondaryAxis.Minimum = new NSNumber(0); chart.SecondaryAxis.Maximum = new NSNumber(750); chart.SecondaryAxis.Interval = new NSNumber(10); chart.SecondaryAxis.Visible = false; chart.SecondaryAxis.ShowMajorGridLines = false; chart.SecondaryAxis.ShowMinorGridLines = false; chart.Delegate = new DataMarkerFormatter(); ChartViewModel dataModel = new ChartViewModel(); SFBarSeries series = new SFBarSeries(); series.ItemsSource = dataModel.CategoryData; series.XBindingPath = "XValue"; series.YBindingPath = "YValue"; series.EnableTooltip = true; series.EnableAnimation = true; series.ColorModel.Palette = SFChartColorPalette.Natural; series.DataMarker.ShowLabel = true; series.DataMarker.LabelStyle.LabelPosition = SFChartDataMarkerLabelPosition.Outer; series.DataMarker.LabelStyle.Font = UIFont.SystemFontOfSize(12f); chart.Series.Add(series); this.AddSubview(chart); }
public override SFSeries GetSeries (SFChart chart, nint index) { SFBarSeries series = new SFBarSeries (); series.DataMarker.ShowLabel = true; return series; }