public override void ViewDidLoad() { base.ViewDidLoad (); TKChart chart = new TKChart (this.ExampleBounds); chart.AutoresizingMask = UIViewAutoresizing.FlexibleWidth | UIViewAutoresizing.FlexibleHeight; this.View.AddSubview (chart); Random r = new Random (); for (int i = 0; i < 2; i++) { List<TKChartDataPoint> list = new List<TKChartDataPoint> (); for (int j = 0; j < 20; j++) { list.Add(new TKChartDataPoint (new NSNumber (r.Next() % 1450), new NSNumber (r.Next () % 150))); } TKChartScatterSeries series = new TKChartScatterSeries (list.ToArray()); series.Title = string.Format ("Series: {0}", list); if (2 == i) { series.SelectionMode = TKChartSeriesSelectionMode.DataPoint; } else { series.SelectionMode = TKChartSeriesSelectionMode.Series; } series.Style.PaletteMode = TKChartSeriesStylePaletteMode.UseItemIndex; series.MarginForHitDetection = 300; chart.AddSeries (series); } chart.EndUpdates (); chart.XAxis.AllowZoom = true; chart.YAxis.AllowZoom = true; }
void snippet3() { // >> chart-scatter-selection-cs var series = new TKChartScatterSeries(scatterPoints.ToArray()); series.Selection = TKChartSeriesSelection.DataPoint; series.MarginForHitDetection = 30.0f; chart.AddSeries(series); // << chart-scatter-selection-cs }
void snippet2() { // >> chart-scatter-visual-cs var series = new TKChartScatterSeries(scatterPoints.ToArray()); var paletteItem = new TKChartPaletteItem(); paletteItem.Fill = new TKSolidFill(UIColor.Red); series.Style.Palette = new TKChartPalette(); series.Style.Palette.AddPaletteItem(paletteItem); chart.AddSeries(series); // << chart-scatter-visual-cs }
public void setupScatterSeries() { chart.RemoveAllData (); Random r = new Random (); List<TKChartDataPoint> list = new List<TKChartDataPoint> (); for (int i = 0; i < 100; i++) { list.Add (new TKChartDataPoint(new NSNumber(r.Next() % 1450), new NSNumber(r.Next() % 150))); } TKChartScatterSeries scatterSeries = new TKChartScatterSeries (list.ToArray()); scatterSeries.Selection = TKChartSeriesSelection.Series; chart.AddSeries (scatterSeries); }
public override void ViewDidLoad() { base.ViewDidLoad(); TKChart chart = new TKChart(this.View.Bounds); chart.AutoresizingMask = UIViewAutoresizing.FlexibleWidth | UIViewAutoresizing.FlexibleHeight; this.View.AddSubview(chart); Random r = new Random(); for (int i = 0; i < 2; i++) { // >> chart-scatter-cs List <TKChartDataPoint> list = new List <TKChartDataPoint> (); for (int j = 0; j < 20; j++) { list.Add(new TKChartDataPoint(new NSNumber(r.Next() % 1450), new NSNumber(r.Next() % 150))); } TKChartScatterSeries series = new TKChartScatterSeries(list.ToArray()); // << chart-scatter-cs series.Title = string.Format("Series: {0}", i + 1); if (2 == i) { series.SelectionMode = TKChartSeriesSelectionMode.DataPoint; } else { series.SelectionMode = TKChartSeriesSelectionMode.Series; } series.Style.PaletteMode = TKChartSeriesStylePaletteMode.UseItemIndex; series.MarginForHitDetection = 300; chart.AddSeries(series); } chart.XAxis.AllowZoom = true; chart.YAxis.AllowZoom = true; }
public void setupScatterSeries(object sender, EventArgs e) { chart.RemoveAllData (); Random r = new Random (); List<TKChartDataPoint> list = new List<TKChartDataPoint> (); for (int i = 0; i < 100; i++) { list.Add (new TKChartDataPoint(new NSNumber(r.Next() % 1450), new NSNumber(r.Next() % 150))); } TKChartScatterSeries scatterSeries = new TKChartScatterSeries (list.ToArray()); scatterSeries.SelectionMode = TKChartSeriesSelectionMode.Series; chart.AddSeries (scatterSeries); }