Ejemplo n.º 1
0
 private void DataUpdated()
 {
     // Replace the datasource with a new one
     _dataSource = new ChartDataSource <T> (_data, ChartSeries(),
                                            o => {
         // Get the value for the specified property key and convert it to an NSObject
         return(o.GetPropertyValue(_xValueKey).ConvertToNSObject());
     },
                                            o => {
         return(o.GetPropertyValue(_yValueKey).ConvertToNSObject());
     });
     _chart.DataSource = _dataSource;
     // Need to redraw to see the changes
     _chart.RedrawChart();
 }
        public override void ViewDidLoad()
        {
            base.ViewDidLoad ();

            // Set up chart
            ShinobiChart chart = new ShinobiChart (View.Bounds, SChartAxisType.Number, SChartAxisType.Number) {
                DataSource = new LabelledDatapointsDataSource(),
                Delegate = new LabelledDatapointsDelegate(),
                AutoresizingMask = ~UIViewAutoresizing.None,
            };
            View.AddSubview (chart);

            chart.YAxis.RangePaddingLow = new NSNumber(0.5);
            chart.YAxis.RangePaddingHigh = new NSNumber(0.5);
            chart.RedrawChart ();
        }
        public void RenderData(CodeFrequencyData data)
        {
            _dataSource = new CodeFrequencyDataSource(data);

            // If we haven't got a chart, then create one
            if (_lineChart == null)
            {
                this.createChart();
            }
            // Set the chart's datasource
            _lineChart.DataSource = _dataSource;
            // Redraw the chart
            _lineChart.RedrawChart();
            // Get rid of the activity indicator
            HideIndicator();
        }
        public void RenderData(PunchCardData data)
        {
            _dataSource = new PunchCardViewDataSource(data);

            // If we haven't got a chart, then create one
            if (_bubbleChart == null)
            {
                this.CreateChart();
            }
            // Set it for the chart
            _bubbleChart.DataSource = _dataSource;
            // Redraw the chart
            _bubbleChart.RedrawChart();
            // disable interaction - in order to allow paging of the container view
            _bubbleChart.UserInteractionEnabled = false;
            // Get rid of the activity indicator
            HideIndicator();
        }
Ejemplo n.º 5
0
        public void RenderData(WeeklyCommitData data)
        {
            _dataSource = new WeeklyCommitViewDatasource(data);

            // If we haven't got a chart, then create one
            if (_columnChart == null)
            {
                this.CreateChart();
            }

            // Assign it to this chart
            _columnChart.DataSource = _dataSource;

            // And then redraw the chart
            _columnChart.RedrawChart();

            // Get rid of the activity indicator
            HideIndicator();
        }
Ejemplo n.º 6
0
        public void RenderData(LanguageFrequencyData data)
        {
            _dataSource = new LanguageFrequencyDatasource(data);

            // If we haven't got a chart, then create one
            if (_chart == null)
            {
                this.CreateChart();
            }

            // Assign it to this chart
            _chart.DataSource = _dataSource;

            // And then redraw the chart
            _chart.RedrawChart();
            _chart.Legend.Hidden = false;

            // Get rid of the activity indicator
            HideIndicator();
        }
		public override void ViewDidLoad ()
		{
			base.ViewDidLoad ();

			// Create the chart
			chart = new ShinobiChart (new RectangleF(20, 20, View.Bounds.Width - 40, View.Bounds.Height - 40)) {
				Title = "Streaming",
				AutoresizingMask = ~UIViewAutoresizing.None,

				// Use a number axis for the x axis
				XAxis = new SChartNumberAxis(),

				// Use a number axis for the y axis
				YAxis = new SChartNumberAxis(),

				DataSource = new AppendDataDataSource()
			};

			// Add the chart to the view controller
			View.AddSubview (chart);

			// Setup a timer to increment the data
			Timer timer = new Timer ();
			timer.Interval = 10;
			timer.Elapsed += (s, e) => {
				// Take care to update on the main thread
				BeginInvokeOnMainThread (() => {
					// Update our data
					(chart.DataSource as AppendDataDataSource).AdvanceData();

					//Refresh the chart
					chart.RemoveFromStart(1, 0);
					chart.AppendToEnd(1, 0);
					chart.RedrawChart();
				});
			};
			timer.Start ();
		}