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; }
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; }