public override Android.Views.View GetSampleContent(Android.Content.Context context) { LinearLayout layout = new LinearLayout(context); layout.Orientation = Orientation.Vertical; TextView textView = new TextView(context); textView.TextSize = 16; textView.SetPadding(10, 20, 0, 0); textView.SetHeight(70); textView.Text = "Top Population Countries With Bubbles"; layout.AddView(textView); textView.Gravity = Android.Views.GravityFlags.Top; maps = new SfMaps(context); ShapeFileLayer layer = new ShapeFileLayer(); layer.ShowItems = true; layer.Uri = "world1.shp"; layer.DataSource = GetDataSource(); layer.ShapeIdPath = "Country"; layer.ShapeIdTableField = "NAME"; layer.ShapeSettings = new ShapeSetting(); layer.ShapeSettings.ShapeValuePath = "ShortName"; layer.ShapeSettings.ShapeFill = Color.ParseColor("#A9D9F7"); BubbleMarkerSetting marker = new BubbleMarkerSetting() { FillColor = Color.ParseColor("#ffa500"), MinSize = 15, MaxSize = 25, ValuePath = "Population" }; layer.BubbleMarkerSetting = marker; maps.Layers.Add(layer); layout.AddView(maps); return(layout); }
public override Android.Views.View GetSampleContent (Android.Content.Context context) { LinearLayout layout= new LinearLayout(context); layout.Orientation = Orientation.Vertical; TextView textView= new TextView(context); textView.TextSize = 16; textView.SetPadding(10,20,0,0); textView.SetHeight(70); textView.Text ="Top Population Countries With Bubbles"; layout.AddView(textView); textView.Gravity = Android.Views.GravityFlags.Top; maps = new SfMaps (context); ShapeFileLayer layer = new ShapeFileLayer (); layer.ShowItems = true; layer.Uri ="world1.shp"; layer.DataSource = GetDataSource(); layer.ShapeIdPath = "Country"; layer.ShapeIdTableField = "NAME"; layer.ShapeSettings = new ShapeSetting (); layer.ShapeSettings.ShapeValuePath= "ShortName"; layer.ShapeSettings.ShapeFill = Color.ParseColor ("#A9D9F7"); BubbleMarkerSetting marker = new BubbleMarkerSetting () { FillColor = Color.ParseColor ("#ffa500"), MinSize=15,MaxSize=25, ValuePath="Population" }; layer.BubbleMarkerSetting = marker; maps.Layers.Add (layer); layout.AddView (maps); return layout; }
public BubbleVisualization() { maps = new SfMaps(); ShapeFileLayer layer = new ShapeFileLayer(); maps.BackgroundColor = Color.White; layer.Uri = "world1.shp"; layer.ItemsSource = GetDataSource(); layer.ShapeIDPath = "Country"; layer.ShapeIDTableField = "NAME"; layer.ShapeSettings = new ShapeSetting(); layer.ShowMapItems = true; layer.ShapeSettings.ShapeValuePath = "Code"; layer.ShapeSettings.ShapeFill = Color.FromHex("#A9D9F7"); BubbleMarkerSetting marker = new BubbleMarkerSetting() { Fill = Color.FromHex("#ffa500"), ValuePath = "Population", MinSize = 15, MaxSize = 25 }; layer.BubbleMarkerSettings = marker; maps.Layers.Add(layer); this.ContentView = maps; }
public override Android.Views.View GetSampleContent(Android.Content.Context context) { handler = new Handler(); LinearLayout layout = new LinearLayout(context); layout.Orientation = Orientation.Vertical; TextView textView = new TextView(context); textView.TextSize = 16; textView.SetPadding(10, 20, 0, 0); textView.SetHeight(90); textView.Text = "Top Population Countries With Bubbles"; layout.AddView(textView); textView.Gravity = Android.Views.GravityFlags.Top; maps = new SfMaps(context); ShapeFileLayer layer = new ShapeFileLayer(); layer.ShowItems = true; layer.Uri = "world1.shp"; layer.DataSource = GetDataSource(); layer.ShapeIdPath = "Country"; layer.ShapeIdTableField = "NAME"; layer.ShapeSettings = new ShapeSetting(); layer.ShapeSettings.ShapeValuePath = "ShortName"; layer.ShapeSettings.ShapeFill = Color.ParseColor("#A9D9F7"); BubbleMarkerSetting marker = new BubbleMarkerSetting() { FillColor = Color.ParseColor("#ffa500"), MinSize = 15, MaxSize = 25, ValuePath = "Population" }; layer.BubbleMarkerSetting = marker; maps.Layers.Add(layer); SfBusyIndicator sfBusyIndicator = new SfBusyIndicator(context); sfBusyIndicator.IsBusy = true; sfBusyIndicator.AnimationType = AnimationTypes.SlicedCircle; sfBusyIndicator.ViewBoxWidth = 50; sfBusyIndicator.ViewBoxHeight = 50; sfBusyIndicator.TextColor = Color.ParseColor("#779772"); layout.AddView(sfBusyIndicator); Java.Lang.Runnable run = new Java.Lang.Runnable(() => { layout.RemoveView(sfBusyIndicator); layout.AddView(maps); }); handler.PostDelayed(run, 100); return(layout); }
public BubbleVisualization () { maps = new SfMaps (); ShapeFileLayer layer = new ShapeFileLayer (); maps.BackgroundColor = Color.White; layer.Uri ="world1.shp"; layer.ItemsSource = GetDataSource(); layer.ShapeIDPath = "Country"; layer.ShapeIDTableField = "NAME"; layer.ShapeSettings = new ShapeSetting (); layer.ShapeSettings.ShapeValuePath= "Country"; layer.ShapeSettings.ShapeFill = Color.FromHex ("#A9D9F7"); BubbleMarkerSetting marker = new BubbleMarkerSetting () { Fill = Color.FromHex ("#ffa500"), MinSize=25,MaxSize=75 }; layer.BubbleMarkerSettings = marker; maps.Layers.Add (layer); Content = maps; }
public override Android.Views.View GetSampleContent(Android.Content.Context context) { handler = new Handler(); LinearLayout layout = new LinearLayout(context); layout.Orientation = Orientation.Vertical; TextView textView = new TextView(context); textView.TextSize = 16; textView.SetPadding(10, 20, 0, 0); textView.SetHeight(90); textView.Text = "Top 40 countries population"; layout.AddView(textView); textView.Gravity = Android.Views.GravityFlags.Top; maps = new SfMaps(context); ShapeFileLayer layer = new ShapeFileLayer(); layer.ShowItems = true; layer.Uri = "world1.shp"; layer.DataSource = GetDataSource(); layer.ShapeIdPath = "Country"; layer.ShowItems = true; layer.ShapeIdTableField = "NAME"; layer.ShapeSettings = new ShapeSetting(); layer.ShapeSettings.ShapeFill = Color.LightGray; BubbleMarkerSetting marker = new BubbleMarkerSetting(); marker.ValuePath = "Population"; marker.ColorValuePath = "Population"; BubbleCustomTooltipSetting tooltipSetting = new BubbleCustomTooltipSetting(context); tooltipSetting.ShowTooltip = true; tooltipSetting.ValuePath = "Country"; marker.TooltipSettings = tooltipSetting; RangeColorMapping rangeColorMapping = new RangeColorMapping(); rangeColorMapping.Color = Color.ParseColor("#2E769F"); rangeColorMapping.To = 1400000000; rangeColorMapping.From = 325000000; rangeColorMapping.LegendLabel = "Above 4%"; marker.ColorMapping.Add(rangeColorMapping); RangeColorMapping rangeColorMapping1 = new RangeColorMapping(); rangeColorMapping1.Color = Color.ParseColor("#D84444"); rangeColorMapping1.To = 325000000; rangeColorMapping1.From = 180000000; rangeColorMapping1.LegendLabel = "4% - 2%"; marker.ColorMapping.Add(rangeColorMapping1); RangeColorMapping rangeColorMapping2 = new RangeColorMapping(); rangeColorMapping2.Color = Color.ParseColor("#816F28"); rangeColorMapping2.To = 180000000; rangeColorMapping2.From = 100000000; rangeColorMapping2.LegendLabel = "2% - 1%"; marker.ColorMapping.Add(rangeColorMapping2); RangeColorMapping rangeColorMapping3 = new RangeColorMapping(); rangeColorMapping3.Color = Color.ParseColor("#7F38A0"); rangeColorMapping3.To = 100000000; rangeColorMapping3.From = 5000000; rangeColorMapping3.LegendLabel = "Below 1%"; marker.ColorMapping.Add(rangeColorMapping3); layer.BubbleMarkerSetting = marker; LegendSetting legendSetting = new LegendSetting(); legendSetting.ShowLegend = true; legendSetting.LegendType = LegendType.Bubbles; legendSetting.IconHeight = 15; legendSetting.IconWidth = 15; legendSetting.LegendPosition = new Point(50, 5); legendSetting.HorizontalAlignment = HorizontalAlignment.Center; layer.LegendSetting = legendSetting; maps.Layers.Add(layer); SfBusyIndicator sfBusyIndicator = new SfBusyIndicator(context); sfBusyIndicator.IsBusy = true; sfBusyIndicator.AnimationType = AnimationTypes.SlicedCircle; sfBusyIndicator.ViewBoxWidth = 50; sfBusyIndicator.ViewBoxHeight = 50; sfBusyIndicator.TextColor = Color.ParseColor("#779772"); layout.AddView(sfBusyIndicator); Java.Lang.Runnable run = new Java.Lang.Runnable(() => { layout.RemoveView(sfBusyIndicator); layout.AddView(maps); }); handler.PostDelayed(run, 100); return(layout); }
public override Android.Views.View GetSampleContent(Android.Content.Context context) { handler = new Handler(); frameLayout = new FrameLayout(context); frameLayout.LayoutParameters = new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.MatchParent); LinearLayout linearLayout = new LinearLayout(context); linearLayout.Orientation = Orientation.Vertical; linearLayout.LayoutParameters = new Android.Views.ViewGroup.LayoutParams(Android.Views.ViewGroup.LayoutParams.MatchParent, Android.Views.ViewGroup.LayoutParams.MatchParent); sampleContext = context; LinearLayout layout = new LinearLayout(context); layout.LayoutParameters = new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.MatchParent); layout.Orientation = Orientation.Horizontal; layout.SetHorizontalGravity(GravityFlags.Center); TextView textView = new TextView(context); textView.TextSize = 16; textView.SetPadding(2, 2, 2, 2); textView.SetHeight(90); textView.Gravity = Android.Views.GravityFlags.Top; textView.Text = "Top 40 countries population"; layout.AddView(textView); frameLayout.AddView(layout); maps = new SfMaps(context); maps.LayoutParameters = new Android.Views.ViewGroup.LayoutParams(Android.Views.ViewGroup.LayoutParams.MatchParent, Android.Views.ViewGroup.LayoutParams.MatchParent); ShapeFileLayer layer = new ShapeFileLayer(); layer.ShowItems = true; layer.Uri = "world1.shp"; layer.DataSource = GetDataSource(); layer.ShapeIdPath = "Country"; layer.ShowItems = true; layer.ShapeIdTableField = "NAME"; layer.ShapeSettings = new ShapeSetting(); layer.ShapeSettings.ShapeFill = Color.LightGray; BubbleMarkerSetting marker = new BubbleMarkerSetting(); marker.ValuePath = "Percent"; marker.ColorValuePath = "Percent"; RangeColorMapping rangeColorMapping = new RangeColorMapping(); rangeColorMapping.Color = Color.ParseColor("#2E769F"); rangeColorMapping.From = 4; rangeColorMapping.To = 20; rangeColorMapping.LegendLabel = "Above 4%"; marker.ColorMapping.Add(rangeColorMapping); RangeColorMapping rangeColorMapping1 = new RangeColorMapping(); rangeColorMapping1.Color = Color.ParseColor("#D84444"); rangeColorMapping1.From = 2; rangeColorMapping1.To = 4; rangeColorMapping1.LegendLabel = "4% - 2%"; marker.ColorMapping.Add(rangeColorMapping1); RangeColorMapping rangeColorMapping2 = new RangeColorMapping(); rangeColorMapping2.Color = Color.ParseColor("#816F28"); rangeColorMapping2.From = 1; rangeColorMapping2.To = 2; rangeColorMapping2.LegendLabel = "2% - 1%"; marker.ColorMapping.Add(rangeColorMapping2); RangeColorMapping rangeColorMapping3 = new RangeColorMapping(); rangeColorMapping3.Color = Color.ParseColor("#7F38A0"); rangeColorMapping3.From = 0; rangeColorMapping3.To = 1; rangeColorMapping3.LegendLabel = "Below 1%"; marker.ColorMapping.Add(rangeColorMapping3); layer.BubbleMarkerSetting = marker; LegendSetting legendSetting = new LegendSetting(); legendSetting.ShowLegend = true; legendSetting.LegendType = LegendType.Bubbles; legendSetting.LegendPosition = new Point(50, 10); legendSetting.ItemMargin = 15; layer.LegendSetting = legendSetting; maps.Layers.Add(layer); frameLayout.AddView(maps); frameLayout.SetClipChildren(false); LinearLayout linear = new LinearLayout(context); linear.Orientation = Orientation.Horizontal; linear.LayoutParameters = new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.MatchParent); linear.SetHorizontalGravity(GravityFlags.End); linear.SetVerticalGravity(GravityFlags.Bottom); TextView textView1 = new TextView(context); textView1.Text = "Source:"; textView1.SetBackgroundColor(Color.White); textView1.SetTextColor(Color.Black); textView1.SetPadding(2, 2, 2, 2); linear.AddView(textView1); TextView textView2 = new TextView(context); textView2.Text = "en.wikipedia.org"; textView2.SetTextColor(Color.DeepSkyBlue); textView2.SetPadding(0, 2, 3, 2); textView2.SetBackgroundColor(Color.White); textView2.Clickable = true; textView2.Click += TextView2_Click; linear.AddView(textView2); frameLayout.AddView(linear); SfBusyIndicator sfBusyIndicator = new SfBusyIndicator(context); sfBusyIndicator.IsBusy = true; sfBusyIndicator.AnimationType = AnimationTypes.SlicedCircle; sfBusyIndicator.ViewBoxWidth = 50; sfBusyIndicator.ViewBoxHeight = 50; sfBusyIndicator.TextColor = Color.ParseColor("#779772"); linearLayout.AddView(sfBusyIndicator); Java.Lang.Runnable run = new Java.Lang.Runnable(() => { linearLayout.RemoveView(sfBusyIndicator); linearLayout.AddView(frameLayout); }); handler.PostDelayed(run, 100); return(linearLayout); }