本文整理汇总了C#中TKChart.AddSeries方法的典型用法代码示例。如果您正苦于以下问题:C# TKChart.AddSeries方法的具体用法?C# TKChart.AddSeries怎么用?C# TKChart.AddSeries使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TKChart
的用法示例。
在下文中一共展示了TKChart.AddSeries方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ViewDidLoad
public override void ViewDidLoad ()
{
this.AddOption ("Sequential animation", applySequential);
this.AddOption ("Grow animation", applyGrow);
base.ViewDidLoad ();
chart = new TKChart (this.View.Bounds);
chart.AutoresizingMask = UIViewAutoresizing.FlexibleWidth | UIViewAutoresizing.FlexibleHeight;
chart.AllowAnimations = true;
chart.Delegate = chartDelegate;
this.View.AddSubview (chart);
Random r = new Random ();
List<TKChartDataPoint> list = new List<TKChartDataPoint> ();
for (int i = 0; i < 10; i++) {
list.Add (new TKChartDataPoint(new NSNumber(i), new NSNumber(r.Next() % 100)));
}
TKChartLineSeries lineSeries = new TKChartLineSeries (list.ToArray ());
chart.AddSeries (lineSeries);
float shapeSize = UIDevice.CurrentDevice.UserInterfaceIdiom == UIUserInterfaceIdiom.Phone ? 14 : 17;
lineSeries.Style.PointShape = new TKPredefinedShape (TKShapeType.Circle, new SizeF (shapeSize, shapeSize));
lineSeries.Style.ShapeMode = TKChartSeriesStyleShapeMode.AlwaysShow;
lineSeries.SelectionMode = TKChartSeriesSelectionMode.DataPoint;
chart.AddSeries (lineSeries);
}
示例2: ViewDidLoad
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 ();
List<CustomObject> data = new List<CustomObject> ();
for (int i = 0; i < 5; i++) {
CustomObject obj = new CustomObject () {
ObjectID = i,
Value1 = r.Next (100),
Value2 = r.Next (100),
Value3 = r.Next (100)
};
data.Add (obj);
}
chart.AddSeries (new TKChartAreaSeries (data.ToArray(), "ObjectID", "Value1"));
chart.AddSeries (new TKChartAreaSeries (data.ToArray(), "ObjectID", "Value2"));
chart.AddSeries (new TKChartAreaSeries (data.ToArray(), "ObjectID", "Value3"));
TKChartStackInfo stackInfo = new TKChartStackInfo (new NSNumber (1), TKChartStackMode.Stack);
for (int i = 0; i < chart.Series.Length; i++) {
TKChartSeries series = chart.Series [i];
series.SelectionMode = TKChartSeriesSelectionMode.Series;
series.StackInfo = stackInfo;
}
chart.ReloadData ();
}
示例3: ViewDidLoad
public override void ViewDidLoad()
{
base.ViewDidLoad ();
TKChart chart = new TKChart ();
chart.Frame = this.ExampleBounds;
chart.AutoresizingMask = UIViewAutoresizing.FlexibleWidth | UIViewAutoresizing.FlexibleHeight;
chart.AllowPanDeceleration = true;
this.View.AddSubview (chart);
Random r = new Random ();
List<TKChartDataPoint> list = new List<TKChartDataPoint> ();
for (int i = 0; i < 200; i++) {
list.Add (new TKChartDataPoint(new NSNumber(r.Next() % 200), new NSNumber(r.Next() % 1000)));
}
chart.AddSeries (new TKChartScatterSeries (list.ToArray()));
list = new List<TKChartDataPoint> ();
for (int i = 0; i < 200; i++) {
list.Add (new TKChartDataPoint(new NSNumber(r.Next() % 200), new NSNumber(r.Next() % 1000)));
}
chart.AddSeries (new TKChartScatterSeries (list.ToArray()));
list = new List<TKChartDataPoint> ();
for (int i = 0; i < 200; i++) {
list.Add (new TKChartDataPoint(new NSNumber(r.Next() % 200), new NSNumber(r.Next() % 1000)));
}
chart.AddSeries (new TKChartScatterSeries (list.ToArray()));
chart.XAxis.AllowZoom = true;
chart.XAxis.AllowPan = true;
chart.YAxis.AllowZoom = true;
chart.YAxis.AllowPan = true;
}
示例4: ViewDidLoad
public override void ViewDidLoad()
{
base.ViewDidLoad ();
chart = new TKChart (this.ExampleBounds);
chart.AutoresizingMask = UIViewAutoresizing.FlexibleHeight | UIViewAutoresizing.FlexibleWidth;
chart.Delegate = new ChartDelegate (0, 3);
this.View.AddSubview (chart);
int[] values = new int[] { 58, 59, 61, 64, 66, 69, 72, 72, 69 };
int[] values1 = new int[] { 42, 44, 47, 51, 56, 61, 62, 64, 62 };
List<TKChartDataPoint> dataPoints = new List<TKChartDataPoint> ();
List<TKChartDataPoint> dataPoints1 = new List<TKChartDataPoint> ();
for (int i = 0; i < values.Length; i++) {
TKChartDataPoint point = new TKChartDataPoint (new NSNumber (i), new NSNumber (values [i]));
TKChartDataPoint point1 = new TKChartDataPoint (new NSNumber (i), new NSNumber (values1 [i]));
dataPoints.Add (point);
dataPoints1.Add (point1);
}
TKChartLineSeries lineSeries = new TKChartLineSeries (dataPoints.ToArray ());
lineSeries.SelectionMode = TKChartSeriesSelectionMode.DataPoint;
lineSeries.Style.PointShape = new TKPredefinedShape (TKShapeType.Circle, new SizeF (8, 8));
lineSeries.Style.PointLabelStyle.TextHidden = false;
lineSeries.Style.PointLabelStyle.LabelOffset = new UIOffset (0, -24);
lineSeries.Style.PointLabelStyle.Insets = new UIEdgeInsets (-1, -5, -1, -5);
lineSeries.Style.PointLabelStyle.LayoutMode = TKChartPointLabelLayoutMode.Manual;
lineSeries.Style.PointLabelStyle.Font = UIFont.SystemFontOfSize (10);
lineSeries.Style.PointLabelStyle.TextAlignment = UITextAlignment.Center;
lineSeries.Style.PointLabelStyle.TextColor = UIColor.White;
lineSeries.Style.PointLabelStyle.Fill = new TKSolidFill (new UIColor ((float)(108 / 255.0), (float)(181 / 255.0), (float)(250 / 255.0), (float)1.0));
lineSeries.Style.PointLabelStyle.ClipMode = TKChartPointLabelClipMode.Hidden;
TKChartLineSeries lineSeries1 = new TKChartLineSeries (dataPoints1.ToArray ());
lineSeries1.SelectionMode = TKChartSeriesSelectionMode.DataPoint;
lineSeries1.Style.PointShape = new TKPredefinedShape (TKShapeType.Circle, new SizeF (8, 8));
lineSeries1.Style.PointLabelStyle.TextHidden = false;
lineSeries1.Style.PointLabelStyle.LabelOffset = new UIOffset (0, -24);
lineSeries1.Style.PointLabelStyle.Insets = new UIEdgeInsets (-1, -5, -1, -5);
lineSeries1.Style.PointLabelStyle.LayoutMode = TKChartPointLabelLayoutMode.Manual;
lineSeries1.Style.PointLabelStyle.Font = UIFont.SystemFontOfSize (10);
lineSeries1.Style.PointLabelStyle.TextAlignment = UITextAlignment.Center;
lineSeries1.Style.PointLabelStyle.TextColor = UIColor.White;
lineSeries1.Style.PointLabelStyle.Fill = new TKSolidFill (new UIColor ((float)(241 / 255.0), (float)(140 / 255.0), (float)(133 / 255.0), (float)1.0));
lineSeries1.Style.PointLabelStyle.ClipMode = TKChartPointLabelClipMode.Hidden;
TKChartNumericAxis yAxis = new TKChartNumericAxis (new NSNumber (40), new NSNumber (80));
yAxis.MajorTickInterval = new NSNumber (10);
chart.YAxis = yAxis;
chart.AddSeries (lineSeries);
chart.AddSeries (lineSeries1);
}
示例5: ViewDidLoad
public override void ViewDidLoad ()
{
base.ViewDidLoad ();
chart = new TKChart (this.View.Bounds);
chart.AutoresizingMask = UIViewAutoresizing.FlexibleHeight | UIViewAutoresizing.FlexibleWidth;
chart.Delegate = chartDelegate;
this.View.AddSubview (chart);
Random r = new Random ();
List<TKChartDataPoint> dataPoints = new List<TKChartDataPoint> ();
for (int i = 0; i < 10; i++) {
TKChartDataPoint point = new TKChartDataPoint (new NSNumber (i), new NSNumber (r.Next () % 100));
dataPoints.Add (point);
}
TKChartColumnSeries columnSeries = new TKChartColumnSeries (dataPoints.ToArray ());
columnSeries.SelectionMode = TKChartSeriesSelectionMode.DataPoint;
columnSeries.Style.PointLabelStyle.TextHidden = false;
columnSeries.Style.PointLabelStyle.LayoutMode = TKChartPointLabelLayoutMode.Manual;
columnSeries.Style.PointLabelStyle.LabelOffset = new UIOffset (0, -10);
columnSeries.Style.PointLabelStyle.Insets = new UIEdgeInsets (-1, -5, -1, -5);
columnSeries.Style.PointLabelStyle.Font = UIFont.SystemFontOfSize (10);
columnSeries.Style.PointLabelStyle.TextAlignment = UITextAlignment.Center;
columnSeries.Style.PointLabelStyle.ClipMode = TKChartPointLabelClipMode.Visible;
columnSeries.Style.PointLabelStyle.TextColor = UIColor.White;
columnSeries.Style.PointLabelStyle.Fill = new TKSolidFill (new UIColor ((float)(108 / 255.0), (float)(181 / 255.0), (float)(250 / 255.0), (float)1.0));
chart.AddSeries (columnSeries);
chart.Select (new TKChartSelectionInfo (chart.Series [0], 3));
}
示例6: ViewDidLoad
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;
}
示例7: ViewDidLoad
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 ();
List<TKChartDataPoint> list = new List<TKChartDataPoint> ();
string[] categories = new []{"Apple", "Google", "Microsoft", "Samsung"};
for (int i = 0; i < categories.Length; i++) {
list.Add(new TKChartDataPoint(new NSString(categories[i]), new NSNumber(r.Next() % 100)));
}
TKChartColumnSeries series = new TKChartColumnSeries (list.ToArray());
series.SelectionMode = TKChartSeriesSelectionMode.Series;
TKChartCategoryAxis xAxis = new TKChartCategoryAxis ();
xAxis.Position = TKChartAxisPosition.Bottom;
xAxis.PlotMode = TKChartAxisPlotMode.BetweenTicks;
chart.XAxis = xAxis;
TKChartNumericAxis yAxis = new TKChartNumericAxis (new NSNumber (0), new NSNumber (100));
yAxis.Position = TKChartAxisPosition.Left;
chart.YAxis = yAxis;
chart.AddSeries (series);
}
示例8: ViewDidLoad
public override void ViewDidLoad ()
{
base.ViewDidLoad ();
TKChart chart = new TKChart (this.View.Bounds);
chart.AutoresizingMask = UIViewAutoresizing.FlexibleWidth | UIViewAutoresizing.FlexibleHeight;
this.View.AddSubview (chart);
var xAxis = new TKChartDateTimeCategoryAxis ();
var formatter = new NSDateFormatter ();
formatter.DateFormat = "d MMM";
xAxis.LabelFormatter = formatter;
xAxis.Style.MajorTickStyle.TicksOffset = -3;
xAxis.Style.MajorTickStyle.TicksHidden = false;
xAxis.Style.MajorTickStyle.TicksWidth = 1.5f;
xAxis.Style.MajorTickStyle.TicksFill = new TKSolidFill (new UIColor (203 / 255.0f, 203 / 255.0f, 203 / 255.0f, 1f));
xAxis.Style.MajorTickStyle.MaxTickClippingMode = TKChartAxisClippingMode.Visible;
xAxis.PlotMode = TKChartAxisPlotMode.BetweenTicks;
var yAxis = new TKChartNumericAxis (new NSNumber(320), new NSNumber(360));
yAxis.MajorTickInterval = 20;
var series = new TKChartCandlestickSeries(StockDataPoint.LoadStockPoints(10).ToArray());
series.GapLength = 0.6f;
series.XAxis = xAxis;
chart.YAxis = yAxis;
chart.AddSeries (series);
}
示例9: ViewDidLoad
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)));
}
chart.AddSeries (new TKChartScatterSeries (list.ToArray()));
}
chart.AddAnnotation (new TKChartGridLineAnnotation(new NSNumber(80), chart.YAxis, new TKStroke(UIColor.Red)));
chart.AddAnnotation (new TKChartGridLineAnnotation(new NSNumber(600), chart.XAxis));
chart.AddAnnotation (new TKChartBandAnnotation(new TKRange(new NSNumber(10), new NSNumber(40)), chart.YAxis, new TKSolidFill(new UIColor (1, 0, 0, 0.4f)), null));
TKChartBandAnnotation a = new TKChartBandAnnotation(new TKRange (new NSNumber(900), new NSNumber(1500)), chart.XAxis);
a.Style.Fill = new TKSolidFill (new UIColor (0, 1, 0, 0.3f));
chart.AddAnnotation (a);
}
示例10: ViewDidLoad
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++) {
List<TKChartBubbleDataPoint> list = new List<TKChartBubbleDataPoint> ();
for (int j = 0; j < 20; j++) {
list.Add (new TKChartBubbleDataPoint (new NSNumber (r.Next () % 1450), new NSNumber (r.Next () % 150), new NSNumber (r.Next () % 200)));
}
TKChartBubbleSeries series = new TKChartBubbleSeries (list.ToArray());
series.Title = string.Format("Series {0}", i+1);
series.Scale = 1.5;
series.MarginForHitDetection = 2f;
if (i == 0) {
series.SelectionMode = TKChartSeriesSelectionMode.DataPoint;
} else {
series.SelectionMode = TKChartSeriesSelectionMode.Series;
}
chart.AddSeries (series);
}
}
示例11: ViewDidLoad
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 ();
List<TKChartDataPoint> list = new List<TKChartDataPoint> ();
for (int i = 0; i < 12; i++) {
list.Add (new TKChartDataPoint (new NSNumber (i), new NSNumber (r.Next () % 2000)));
}
TKChartLineSeries series = new TKChartLineSeries (list.ToArray());
series.SelectionMode = TKChartSeriesSelectionMode.Series;
TKChartNumericAxis xAxis = new TKChartNumericAxis ();
xAxis.Range = new TKRange (new NSNumber (0), new NSNumber (11));
xAxis.Position = TKChartAxisPosition.Bottom;
xAxis.MajorTickInterval = 1;
chart.XAxis = xAxis;
TKChartNumericAxis yAxis = new TKChartNumericAxis ();
yAxis.Range = new TKRange (new NSNumber (0), new NSNumber (2000));
yAxis.Position = TKChartAxisPosition.Left;
yAxis.MajorTickInterval = 400;
chart.YAxis = yAxis;
chart.AddSeries (series);
}
示例12: ViewDidLoad
public override void ViewDidLoad ()
{
base.ViewDidLoad ();
TKChart chart = new TKChart (this.View.Bounds);
chart.AutoresizingMask = UIViewAutoresizing.FlexibleWidth | UIViewAutoresizing.FlexibleHeight;
this.View.AddSubview (chart);
string[] months = new string[]{ "Jan", "Feb", "Mar", "Apr", "May", "Jun" };
int[] values = new int[]{ 95, 40, 55, 30, 76, 34 };
List<TKChartDataPoint> list = new List<TKChartDataPoint> ();
for (int i = 0; i < months.Length; i++) {
list.Add (new TKChartDataPoint(new NSString(months[i]), new NSNumber(values[i])));
}
chart.AddSeries (new TKChartAreaSeries (list.ToArray()));
CALayer layer = new CALayer ();
layer.Bounds = new RectangleF (0, 0, 100, 100);
layer.BackgroundColor = new UIColor(1, 0, 0, 0.6f).CGColor;
layer.ShadowRadius = 10;
layer.ShadowColor = UIColor.Yellow.CGColor;
layer.ShadowOpacity = 1;
layer.CornerRadius = 10;
TKChartLayerAnnotation a = new TKChartLayerAnnotation(layer, new NSString("Mar"), new NSNumber(80), chart.Series[0]);
a.ZPosition = TKChartAnnotationZPosition.AboveSeries;
chart.AddAnnotation(a);
}
示例13: ViewDidLoad
public override void ViewDidLoad ()
{
this.AddOption ("pin at top", top);
this.AddOption ("pin at left", left);
this.AddOption ("pin at right", right);
this.AddOption ("pin at bottom", bottom);
this.AddOption ("floating", floating);
base.ViewDidLoad ();
chart = new TKChart (this.View.Bounds);
chart.AutoresizingMask = UIViewAutoresizing.FlexibleWidth | UIViewAutoresizing.FlexibleHeight;
this.View.AddSubview (chart);
Random r = new Random ();
List<TKChartDataPoint> list1 = new List<TKChartDataPoint> ();
List<TKChartDataPoint> list2 = new List<TKChartDataPoint> ();
for (int i = 0; i < 26; i++) {
list1.Add (new TKChartDataPoint(new NSNumber(i+1), new NSNumber(r.Next(100))));
list2.Add (new TKChartDataPoint (new NSNumber (i + 1), new NSNumber (r.Next (60))));
}
TKChartNumericAxis xAxis = new TKChartNumericAxis(new NSNumber (1), new NSNumber (26));
xAxis.Position = TKChartAxisPosition.Bottom;
xAxis.MajorTickInterval = 5;
chart.AddAxis (xAxis);
TKChartAreaSeries series = new TKChartAreaSeries (list1.ToArray());
series.XAxis = xAxis;
chart.AddSeries (series);
TKChartAreaSeries series1 = new TKChartAreaSeries (list2.ToArray());
series1.XAxis = xAxis;
chart.AddSeries (series1);
chart.AllowTrackball = true;
chart.Trackball.SnapMode = TKChartTrackballSnapMode.AllClosestPoints;
chart.Delegate = chartDelegate;
chart.Trackball.Tooltip.Style.TextAlignment = UITextAlignment.Left;
}
示例14: ViewDidLoad
public override void ViewDidLoad()
{
base.ViewDidLoad ();
TKChart chart = new TKChart ();
chart.Frame = this.ExampleBounds;
chart.AutoresizingMask = UIViewAutoresizing.FlexibleWidth | UIViewAutoresizing.FlexibleHeight;
chart.Delegate = new ChartDelegate ();
this.View.AddSubview (chart);
Random r = new Random ();
List<TKChartDataPoint> list1 = new List<TKChartDataPoint> ();
List<TKChartDataPoint> list2 = new List<TKChartDataPoint> ();
for (int i = 0; i < 10; i++) {
list1.Add (new TKChartDataPoint(new NSNumber(i), new NSNumber(r.Next() % 100)));
list2.Add (new TKChartDataPoint(new NSNumber(i), new NSNumber(r.Next() % 100)));
}
TKChartColumnSeries columnSeries = new TKChartColumnSeries (list1.ToArray());
columnSeries.SelectionMode = TKChartSeriesSelectionMode.Series;
chart.AddSeries (columnSeries);
TKChartAreaSeries areaSeries = new TKChartAreaSeries (list2.ToArray());
areaSeries.Style.PointShape = new TKPredefinedShape (TKShapeType.Star, new SizeF(20, 20));
areaSeries.Style.ShapeMode = TKChartSeriesStyleShapeMode.AlwaysShow;
areaSeries.SelectionMode = TKChartSeriesSelectionMode.Series;
chart.AddSeries (areaSeries);
chart.YAxis.Style.LabelStyle.Font = UIFont.SystemFontOfSize (18);
chart.YAxis.Style.LabelStyle.TextColor = UIColor.Black;
chart.XAxis.Style.LabelStyle.Font = UIFont.SystemFontOfSize (18);
chart.XAxis.Style.LabelStyle.TextColor = UIColor.Black;
chart.GridStyle.HorizontalAlternateFill = new TKSolidFill (UIColor.FromWhiteAlpha (0.9f, 0.8f));
}
示例15: ViewDidLoad
public override void ViewDidLoad()
{
base.ViewDidLoad ();
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)));
}
chart.AddSeries (new TKChartScatterSeries (list.ToArray()));
}
chart.AddAnnotation (new TKChartCrossLineAnnotation(new NSNumber(900), new NSNumber(60), chart.Series[0]));
}