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


C# SFChart类代码示例

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


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

示例1: DateChartView

		public DateChartView ()
		{
			SFChart chart 						= new SFChart ();
			chart.Title.Text					= (NSString)"Average Sales Comparison";
			SFDateTimeAxis dateTimeAxis 		= new SFDateTimeAxis ();
			dateTimeAxis.EdgeLabelsDrawingMode  = SFChartAxisEdgeLabelsDrawingMode.Hide;
			dateTimeAxis.IntervalType 			= SFChartDateTimeIntervalType.Years;
			dateTimeAxis.Interval 				= new NSNumber(1);

			NSDateFormatter formatter			= new NSDateFormatter ();
			formatter.DateFormat				= "MM/yyyy";

			dateTimeAxis.LabelStyle.LabelFormatter	= formatter;
			dateTimeAxis.LabelRotationAngle			= -60;

			chart.PrimaryAxis 					= dateTimeAxis;
			chart.PrimaryAxis.Title.Text    	= new NSString ("Sales Across Years");

			chart.SecondaryAxis 				= new SFNumericalAxis ();
			chart.SecondaryAxis.Minimum 		= new NSNumber(0);
			chart.SecondaryAxis.Maximum 		= new NSNumber(100);
			chart.SecondaryAxis.Interval 		= new NSNumber(10);
			chart.SecondaryAxis.Title.Text 		= new NSString ("Sales Amount in Millions (USD)");

			NSNumberFormatter numberFormatter 	= new NSNumberFormatter ();
			numberFormatter.NumberStyle 		= NSNumberFormatterStyle.Currency;
			numberFormatter.MinimumFractionDigits	= 0;

			chart.SecondaryAxis.LabelStyle.LabelFormatter  = numberFormatter;

			DateTimeDataSource dataModel 	= new DateTimeDataSource ();
			chart.DataSource 				= dataModel as SFChartDataSource;
			this.control = chart;
		}
开发者ID:rickyp29,项目名称:Xamarin_iOS_Charts,代码行数:34,代码来源:DateChartView.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: GetSeries

	public override SFSeries GetSeries (SFChart chart, nint index)
	{
		SFLineSeries series = new SFLineSeries ();
		series.DataMarker.ShowLabel	= true;
		series.DataMarker.LabelStyle.Angle = 320;
		return series;
	}
开发者ID:IanLeatherbury,项目名称:tryfsharpforms,代码行数:7,代码来源:Line.cs

示例4: 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

示例5: 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

示例6: GetSeries

		public override SFSeries GetSeries (SFChart chart, nint index)
		{
			SFRangeColumnSeries series					= new SFRangeColumnSeries ();
			series.DataMarker.ShowLabel					= true;
			series.DataMarker.LabelStyle.Margin 	    = new UIEdgeInsets (3, 3, 3, 3);
			return series;
		}
开发者ID:IanLeatherbury,项目名称:tryfsharpforms,代码行数:7,代码来源:RangeColumn.cs

示例7: GetSeries

	public override SFSeries GetSeries (SFChart chart, nint index)
	{
		SFSplineSeries series		= new SFSplineSeries ();
		series.LineWidth 			= 3;
		series.DataMarker.ShowLabel	= true;
		return series;
	}
开发者ID:IanLeatherbury,项目名称:tryfsharpforms,代码行数:7,代码来源:Spline.cs

示例8: GetSeries

	public override SFSeries GetSeries (SFChart chart, nint index)
	{
		SFSplineAreaSeries series		= new SFSplineAreaSeries ();
		series.Alpha 					= 0.6f;
		series.BorderColor 				= UIColor.FromRGBA( 255.0f/255.0f ,191.0f/255.0f,0.0f/255.0f,1.0f);
		series.BorderWidth 				= 3;
		return series;
	}
开发者ID:IanLeatherbury,项目名称:tryfsharpforms,代码行数:8,代码来源:SplineArea.cs

示例9: GetSeries

	public override SFSeries GetSeries (SFChart chart, nint index)
	{
		SFStackingColumn100Series series 			= new SFStackingColumn100Series ();
		series.DataMarkerPosition				 	= SFChartDataMarkerPosition.Center;
		series.DataMarker.ShowLabel 				= true;
		series.DataMarker.LabelStyle.LabelPosition 	= SFChartDataMarkerLabelPosition.Center;
		return series;
	}
开发者ID:IanLeatherbury,项目名称:tryfsharpforms,代码行数:8,代码来源:StackingColumn100.cs

示例10: GetSeries

	public override SFSeries GetSeries (SFChart chart, nint index)
	{
		SFPieSeries series			= new SFPieSeries ();
		series.ExplodeIndex 		= 3;
		series.DataMarker.ShowLabel	= true;
		series.DataMarkerPosition 	= SFChartCircularSeriesLabelPosition.OutsideExtended;
		return series;
	}
开发者ID:IanLeatherbury,项目名称:tryfsharpforms,代码行数:8,代码来源:Pie.cs

示例11: Pyramid

		public Pyramid ()
		{
			SFChart chart 						= new SFChart ();
			chart.Legend.Visible 				= true;
			ChartPyramidDataSource dataModel	= new ChartPyramidDataSource ();
			chart.DataSource 					= dataModel as SFChartDataSource;
			this.control = chart;
		}
开发者ID:IanLeatherbury,项目名称:tryfsharpforms,代码行数:8,代码来源:Pyramid.cs

示例12: GetSeries

	public override SFSeries GetSeries (SFChart chart, nint index)
	{
		SFDoughnutSeries series				= new SFDoughnutSeries ();
		series.DataMarker.ShowLabel			= true;
		series.ExplodeOnTouch				= true;
		series.DataMarker.LabelContent		= SFChartLabelContent.Percentage;
		return series;
	}
开发者ID:rickyp29,项目名称:Xamarin_iOS_Charts,代码行数:8,代码来源:DoughnutChartView.cs

示例13: GetSeries

		public override SFSeries GetSeries (SFChart chart, nint index)
		{
			SFScatterSeries series			= new SFScatterSeries ();
			series.ScatterWidth 			= 10;
			series.ScatterHeight 			= 10;
			series.DataMarker.ShowLabel     = true;
			return series;
		}
开发者ID:IanLeatherbury,项目名称:tryfsharpforms,代码行数:8,代码来源:Scatter.cs

示例14: DoughnutChartView

		public DoughnutChartView ()
		{
			SFChart chart 						= new SFChart ();
			chart.Title.Text 					= new NSString ("Doughnut Chart Title");
			chart.Legend.Visible 				= true;
			ChartDoughnutDataSource dataModel 	= new ChartDoughnutDataSource ();
			chart.DataSource 					= dataModel as SFChartDataSource;
			this.control = chart; 
		}
开发者ID:rickyp29,项目名称:Xamarin_iOS_Charts,代码行数:9,代码来源:DoughnutChartView.cs

示例15: OHLC

		public OHLC ()
		{
			SFChart chart 					= new SFChart ();
			chart.PrimaryAxis 				= new SFCategoryAxis ();
			chart.SecondaryAxis 			= new SFNumericalAxis ();

			ChartOHLCDataSource dataModel 	= new ChartOHLCDataSource ();
			chart.DataSource 				= dataModel as SFChartDataSource;
			this.control = chart;
		}
开发者ID:IanLeatherbury,项目名称:tryfsharpforms,代码行数:10,代码来源:OHLC.cs


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