private void AddTrack(Track track)
        {
            var tracksUI = FindViewById <LinearLayout>(Resource.Id.linearLayoutTracks);

            var trackUI = new LinearLayout(BaseContext)
            {
                Orientation = Orientation.Horizontal
            };
            var barsUI = new LinearLayout(BaseContext)
            {
                Orientation = Orientation.Horizontal
            };
            var trackLabel = new Button(BaseContext)
            {
                Text = track.Name
            };

            trackLabel.SetMinimumHeight(100);
            trackLabel.SetMinimumWidth(200);
            trackUI.AddView(trackLabel);
            trackUI.AddView(barsUI);
            tracksUI.AddView(trackUI);

            for (var i = 0; i < NumberOfBarsPerTrack; i++)
            {
                var bar = new Bar(track);
                track.Bars.Add(bar);
                var barUI = new BarView(BaseContext, bar, i);
                barsUI.AddView(barUI);
            }
        }
        //private IEnumerable<Data> CreatePieData()
        //{
        //    List<Data> PieData = new List<Data>(4);
        //    PieData.Add(new Data("Google", 82.35));
        //    PieData.Add(new Data("Yahoo!", 6.69));
        //    PieData.Add(new Data("Baidu", 5.12));
        //    PieData.Add(new Data("Others", 4.71));

        //    return PieData;
        //}

        public void ShowDetailView(int chartType, int dataType, string name)
        {
            if (chartType == 1) //饼图
            {
                var tvx = new StatisticsViewModel(chartType, dataType, name);
                var tmp = new PieView();
                tmp.SetContext(tvx, name);
                tmp.ShowDialog();
            }
            if (chartType == 2) //柱状图
            {
                var tvx = new StatisticsViewModel(chartType, dataType, name);
                var tmp = new BarView();
                tmp.SetContext(tvx, name);
                tmp.ShowDialog();
            }
        }
Beispiel #3
0
            public Row(Context ctx)
            {
                YAxisTextView = new TextView(ctx)
                {
                    TextSize = 10,
                };
                YAxisTextView.SetTextColor(DarkGrayColor);

                BarView = new BarView(ctx)
                {
                    PivotX = 0f,
                };

                ValueTextView = new TextView(ctx)
                {
                    TextSize = 10,
                };
                ValueTextView.SetTextColor(DarkBlueColor);

                IsZoomed = false;
            }
Beispiel #4
0
            public Row (Context ctx)
            {
                YAxisTextView = new TextView (ctx) {
                    TextSize = 10,
                };
                YAxisTextView.SetTextColor (DarkGrayColor);

                BarView = new BarView (ctx) {
                    PivotX = 0f,
                };

                ValueTextView = new TextView (ctx) {
                    TextSize = 10,
                };
                ValueTextView.SetTextColor (DarkBlueColor);

                IsZoomed = false;
            }