当前位置: 首页>>代码示例>>C#>>正文


C# SFChart.AddChartBehavior方法代码示例

本文整理汇总了C#中SFChart.AddChartBehavior方法的典型用法代码示例。如果您正苦于以下问题:C# SFChart.AddChartBehavior方法的具体用法?C# SFChart.AddChartBehavior怎么用?C# SFChart.AddChartBehavior使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在SFChart的用法示例。


在下文中一共展示了SFChart.AddChartBehavior方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: ZoomingandPanning

		public ZoomingandPanning ()
		{
			chart 					= new SFChart ();
			SFCategoryAxis primary 	= new SFCategoryAxis ();
			primary.LabelPlacement	= SFChartLabelPlacement.BetweenTicks;
			chart.PrimaryAxis 		= primary;
			chart.PrimaryAxis.Title.Text    = new NSString ("Company");
			chart.SecondaryAxis 			= new SFNumericalAxis ();
			chart.SecondaryAxis.Title.Text  = new NSString ("Sales");

			ChartZoomPanDataSource dataModel 	= new ChartZoomPanDataSource ();
			chart.DataSource 					= dataModel as SFChartDataSource;

			label 					= new UILabel ();
			label.Text 				= "Pinch to zoom or double tap and drag to select a region to zoom in";
			label.Font				= UIFont.FromName("Helvetica", 12f);
			label.TextAlignment 	= UITextAlignment.Center;
			label.LineBreakMode 	= UILineBreakMode.WordWrap;
			label.Lines 			= 2; 
			label.BackgroundColor   = UIColor.Black.ColorWithAlpha (0.7f);
			label.TextColor 		= UIColor.White;

			chart.AddChartBehavior (new SFChartZoomPanBehavior() {EnableSelectionZooming = true});
			this.AddSubview (chart);
			this.AddSubview (label);
			this.control = this;

		}
开发者ID:IanLeatherbury,项目名称:tryfsharpforms,代码行数:28,代码来源:ChartZooming.cs

示例2: Trackball

		public Trackball ()
		{
			chart 					        = new SFChart ();
			SFNumericalAxis primaryAxis     = new SFNumericalAxis ();
			chart.PrimaryAxis 				= primaryAxis;
			SFNumericalAxis secondaryAxis 	= new SFNumericalAxis ();
			chart.SecondaryAxis 			= secondaryAxis;
			ChartTrackballDataSource dataModel 	= new ChartTrackballDataSource ();
			chart.DataSource 				= dataModel as SFChartDataSource;

			label 					= new UILabel ();
			label.Text 				= "Press and hold to enable trackball";
			label.Font				= UIFont.FromName("Helvetica", 12f);
			label.TextAlignment 	= UITextAlignment.Center;
			label.LineBreakMode 	= UILineBreakMode.WordWrap;
			label.Lines 			= 2; 
			label.BackgroundColor   = UIColor.Black.ColorWithAlpha (0.7f);
			label.TextColor 		= UIColor.White;


			chart.AddChartBehavior (new SFChartTrackballBehavior());
			this.AddSubview (chart);
			this.AddSubview (label);
			this.control = this;
		}
开发者ID:IanLeatherbury,项目名称:tryfsharpforms,代码行数:25,代码来源:Trackball.cs

示例3: AutoScrolling

		public AutoScrolling ()
		{

			chart 							= new SFChart ();
			SFNumericalAxis primaryAxis 	= new SFNumericalAxis ();
			primaryAxis.AutoScrollingDelta 	= 10;
			chart.PrimaryAxis				= primaryAxis;
			SFNumericalAxis secondaryAxis 	= new SFNumericalAxis ();
			secondaryAxis.Minimum 			= NSObject.FromObject(0);
			secondaryAxis.Maximum 			= NSObject.FromObject(9);
			chart.SecondaryAxis				= secondaryAxis;
			dataModel 						= new AutoScrollingDataSource ();
			chart.DataSource 				= dataModel as SFChartDataSource;

			label 							= new UILabel ();
			label.Text 						= "In this demo, a data point is being added for every 500 milliseconds. The Chart is then automatically scrolled to display the fixed range of data points at the end. You can also pan to view previous data points. In this sample the delta value is 10";
			label.Font						= UIFont.FromName("Helvetica", 12f);
			label.TextAlignment 			= UITextAlignment.Center;
			label.LineBreakMode 			= UILineBreakMode.WordWrap;
			label.Lines 					= 6; 
			label.BackgroundColor   		= UIColor.Black.ColorWithAlpha (0.7f);
			label.TextColor 				= UIColor.White;

			chart.AddChartBehavior (new SFChartZoomPanBehavior());

			this.AddSubview (chart);
			this.AddSubview (label);
			this.control = this;
			random = new Random ();
			UpdateData ();
		}
开发者ID:IanLeatherbury,项目名称:tryfsharpforms,代码行数:31,代码来源:AutoScrolling.cs

示例4: BarChartView

        public BarChartView(string ChartTitle)
        {
            List<ChartData> chartData = new ChartDataRepository ().chartDataCollection;
            SFChartZoomPanBehavior zoomPanBehavior  = new SFChartZoomPanBehavior ();
            zoomPanBehavior.EnableSelectionZooming  = true;
            chart 									= new SFChart ();
            chart.Title.Text 						= new NSString (ChartTitle);
            chart.Title.Font 					    = UIFont.SystemFontOfSize (12, UIFontWeight.Bold);
            chart.Title.TextAlignment 			    = UITextAlignment.Center;
            SFCategoryAxis primary 					= new SFCategoryAxis ();
            primary.LabelPlacement					= SFChartLabelPlacement.BetweenTicks;
            primary.Title.Text 						= new NSString ("Security");
            chart.PrimaryAxis 						= primary;
            chart.PrimaryAxis.LabelsIntersectAction = SFChartAxisLabelsIntersectAction.MultipleRows;
            chart.SecondaryAxis 					= new SFNumericalAxis ();

            if (ChartTitle == "Top 5 Gains")
            {
                chart.SecondaryAxis.Title.Text = new NSString ("Gains");
                //chart.Title.Text = new NSString ("Top 5 Gains / Losses");
            };

            if (ChartTitle == "Top 5 Losers")
            {
                chart.SecondaryAxis.Title.Text = new NSString ("Losses");
                //chart.SecondaryAxis.Maximum				= new NSNumber (50);
                chart.SecondaryAxis.Interval = new NSNumber(50);
                //chart.Title.Text = new NSString ("");
            }

            if (ChartTitle == "P&L")
            {
                chart.SecondaryAxis.Title.Text = new NSString ("Gains/Losses");
                chart.Title.Text = new NSString("P&L by Securities");
            }

            BarChartRepository dataModel			= new BarChartRepository (chartData, ChartTitle);
            chart.DataSource 						= dataModel as SFChartDataSource;
            chart.Legend.Visible 					= false;
            chart.AddChartBehavior (zoomPanBehavior);
            this.control 							= chart;
        }
开发者ID:rickyp29,项目名称:Xamarin_iOS_Finance_App,代码行数:42,代码来源:BarChartView.cs

示例5: DataPointSelection

		public DataPointSelection ()
		{
			chart 					= new SFChart ();
			SFCategoryAxis primary 	= new SFCategoryAxis ();
			primary.LabelPlacement	= SFChartLabelPlacement.BetweenTicks;
			primary.Title.Text 		= new NSString ("Month");
			chart.PrimaryAxis 		= primary;
			chart.SecondaryAxis 		 	= new SFNumericalAxis (){ ShowMajorGridLines = false };
			chart.SecondaryAxis.Title.Text 	= new NSString ("Sales");

			dataModel 				= new ChartSelectionDataSource ();
			chart.DataSource 		= dataModel as SFChartDataSource;
			chart.Delegate 			= new ChartSelectionDelegate ();
			chart.AddChartBehavior (new SFChartSelectionBehavior());
			label 					= new UILabel ();
			label.Text 				= "Month :  Mar, Sales : $ 53";
			label.Font				= UIFont.FromName("Helvetica", 13f);
			label.TextAlignment 	= UITextAlignment.Center;
			this.control = this;
			this.AddSubview (chart);
			this.AddSubview (label);
		}
开发者ID:IanLeatherbury,项目名称:tryfsharpforms,代码行数:22,代码来源:ChartSelection.cs


注:本文中的SFChart.AddChartBehavior方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。