MapDataAdapterBase CreateData()
        {
            MapItemStorage storage = new MapItemStorage();

            // Create a MapPie object.
            MapPie pie = new MapPie()
            {
                Size = 100
            };

            pie.Segments.Add(new PieSegment()
            {
                Argument = 0, Value = 10
            });
            pie.Segments.Add(new PieSegment()
            {
                Argument = 1, Value = 9
            });
            pie.Segments.Add(new PieSegment()
            {
                Argument = 2, Value = 12
            });
            storage.Items.Add(pie);

            return(storage);
        }
        private MapDataAdapterBase CreateData()
        {
            MapItemStorage storage = new MapItemStorage();

            MapPie pie = new MapPie()
            {
                Location = new GeoPoint(50, 13), Size = 100
            };

            pie.Segments.Add(CreatePieSegment("A", 100, "color1"));
            pie.Segments.Add(CreatePieSegment("B", 50, "color2"));
            pie.Segments.Add(CreatePieSegment("C", 120, "color3"));
            storage.Items.Add(pie);

            return(storage);
        }
Example #3
0
        private MapDataAdapterBase CreateData()
        {
            MapItemStorage storage = new MapItemStorage();

            // Create bubble charts and add them to the storage.
            storage.Items.Add(new MapBubble()
            {
                Argument = "A", Value = 100,
                Location = new GeoPoint(-50, -70), Size = 100
            });
            storage.Items.Add(new MapBubble()
            {
                Argument = "B", Value = 70,
                Location = new GeoPoint(-50, 0), Size = 70
            });
            storage.Items.Add(new MapBubble()
            {
                Argument = "C", Value = 120,
                Location = new GeoPoint(-50, 70), Size = 120
            });

            //Create a pie chart and add it to the storage.
            MapPie pie = new MapPie()
            {
                Location = new GeoPoint(30, 0), Size = 100
            };

            pie.Segments.Add(new PieSegment()
            {
                Argument = "A", Value = 100
            });
            pie.Segments.Add(new PieSegment()
            {
                Argument = "B", Value = 50
            });
            pie.Segments.Add(new PieSegment()
            {
                Argument = "C", Value = 120
            });
            storage.Items.Add(pie);

            return(storage);
        }
Example #4
0
        private void Form1_Load(object sender, EventArgs e)
        {
            MapItemStorage storage = new MapItemStorage();

            pie = new MapPie()
            {
                Location = new GeoPoint(51.507222, -0.1275),
                Size     = 100,
                Argument = "pie",
            };
            pie.Segments.Add(new PieSegment()
            {
                Argument = NextLetter(), Value = defaultValue
            });
            pie.Segments.Add(new PieSegment()
            {
                Argument = NextLetter(), Value = defaultValue
            });
            pie.Segments.Add(new PieSegment()
            {
                Argument = NextLetter(), Value = defaultValue
            });

            storage.Items.Add(pie);

            mapControl1.Layers.Add(new VectorItemsLayer()
            {
                Data      = storage,
                Colorizer = new KeyColorColorizer()
                {
                    ItemKeyProvider       = new ArgumentItemKeyProvider(),
                    PredefinedColorSchema = PredefinedColorSchema.Palette
                }
            });

            lbRotationDirection.DataSource = Enum.GetValues(typeof(RotationDirection));
            lbSegments.DataSource          = pie.Segments;
        }
        // Create a storage to provide data for the vector layer.
        private IMapDataAdapter CreateData()
        {
            MapItemStorage storage = new MapItemStorage();

            // Create a pie with several segments.
            MapPie pie = new MapPie();

            pie.Size = 200;
            pie.Segments.Add(new PieSegment()
            {
                Argument = "A", Value = 100
            });
            pie.Segments.Add(new PieSegment()
            {
                Argument = "B", Value = 50
            });
            pie.Segments.Add(new PieSegment()
            {
                Argument = "C", Value = 120
            });
            storage.Items.Add(pie);

            return(storage);
        }
Example #6
0
        private void Form1_Load(object sender, System.EventArgs e)
        {
            #region #MapDotExample
            ItemStorage.Items.Add(new MapDot()
            {
                Location = new GeoPoint(-10, 10), Size = 18, Stroke = Color.Blue
            });
            #endregion #MapDotExample

            #region #MapEllipseExample
            ItemStorage.Items.Add(new MapEllipse()
            {
                Location = new GeoPoint(40, 40), Height = 300, Width = 600
            });
            #endregion #MapEllipseExample

            #region #MapLineExample
            ItemStorage.Items.Add(new MapLine {
                Point1 = new GeoPoint(-30, 20), Point2 = new GeoPoint(-35, 25), Stroke = Color.Red, StrokeWidth = 4
            });
            #endregion #MapLineExample

            #region #MapCalloutExample
            ItemStorage.Items.Add(new MapCallout()
            {
                Location = new GeoPoint(10, 10), Text = "This is a MapCallout object"
            });
            #endregion #MapCalloutExample

            #region #MapPathExample
            var path    = new MapPath();
            var segment = new MapPathSegment();
            segment.Points.AddRange(new GeoPoint[] {
                new GeoPoint(20, 20),
                new GeoPoint(20, 30),
                new GeoPoint(30, 30)
            });
            path.Segments.Add(segment);
            segment = new MapPathSegment();
            segment.Points.AddRange(new GeoPoint[] {
                new GeoPoint(30, 32),
                new GeoPoint(20, 32),
                new GeoPoint(20, 42)
            });
            path.Segments.Add(segment);
            ItemStorage.Items.Add(path);
            #endregion #MapPathExample

            #region #MapPolygonExample
            var polygon = new MapPolygon();
            polygon.Points.AddRange(new GeoPoint[] {
                new GeoPoint(70, 80),
                new GeoPoint(75, 90),
                new GeoPoint(75, 130)
            });
            ItemStorage.Items.Add(polygon);
            #endregion #MapPolygonExample

            #region #MapPolylineExample
            var polyline = new MapPolyline()
            {
                StrokeWidth = 4, Stroke = Color.Yellow
            };
            polyline.Points.AddRange(new GeoPoint[] {
                new GeoPoint(-29, 130),
                new GeoPoint(-40, 140),
                new GeoPoint(-20, 150)
            });
            ItemStorage.Items.Add(polyline);
            #endregion #MapPolylineExample

            #region #MapPushpinExample
            ItemStorage.Items.Add(new MapPushpin()
            {
                Location = new GeoPoint(70, -100), Text = "1"
            });
            #endregion #MapPushpinExample

            #region #MapRectangleExample
            ItemStorage.Items.Add(new MapRectangle()
            {
                Location = new GeoPoint(-70, -100), Width = 500, Height = 750
            });
            #endregion #MapRectangleExample

            #region #MapCustomElementExample
            var customElement = new MapCustomElement()
            {
                Location = new GeoPoint(50, 50), Text = "This is a MapCustomElement object"
            };
            var image = new Bitmap(imageFilePath);
            customElement.Image = new Bitmap(image, new Size(40, 40));
            ItemStorage.Items.Add(customElement);
            #endregion #MapCustomElementExample

            #region #MapBubbleExample
            ItemStorage.Items.Add(new MapBubble()
            {
                Location = new GeoPoint(30, 20), Value = 400, Argument = "A", Size = 100
            });
            #endregion #MapBubbleExample

            #region #MapPieExample
            var pie = new MapPie()
            {
                Location = new GeoPoint(-20, -30), Size = 100
            };
            pie.Segments.AddRange(new PieSegment[] {
                new PieSegment()
                {
                    Argument = "A", Value = 2
                },
                new PieSegment()
                {
                    Argument = "B", Value = 3
                },
                new PieSegment()
                {
                    Argument = "C", Value = 4
                }
            });
            ItemStorage.Items.Add(pie);
            #endregion #MapPieExample
        }