本文整理汇总了C#中TKChart.ReloadData方法的典型用法代码示例。如果您正苦于以下问题:C# TKChart.ReloadData方法的具体用法?C# TKChart.ReloadData怎么用?C# TKChart.ReloadData使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TKChart
的用法示例。
在下文中一共展示了TKChart.ReloadData方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: 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 ();
}
示例2: ViewDidLoad
//.........这里部分代码省略.........
gdpInvestmentYAxis.MajorTickInterval = 5;
gdpInvestmentYAxis.Position = TKChartAxisPosition.Right;
gdpInvestmentYAxis.Style.LabelStyle.TextAlignment = TKChartAxisLabelAlignment.Left;
gdpInvestmentYAxis.Style.MajorTickStyle.TicksHidden = false;
gdpInvestmentYAxis.Style.LineHidden = false;
chart.AddAxis (gdpInvestmentYAxis);
TKChartNumericAxis gdpGrowthUpAnnualChangeYAxis = new TKChartNumericAxis (new NSNumber(-6), new NSNumber(4));
gdpGrowthUpAnnualChangeYAxis.MajorTickInterval = 1;
gdpGrowthUpAnnualChangeYAxis.Position = TKChartAxisPosition.Right;
gdpGrowthUpAnnualChangeYAxis.Style.LabelStyle.TextAlignment = TKChartAxisLabelAlignment.Left;
gdpGrowthUpAnnualChangeYAxis.Style.MajorTickStyle.TicksHidden = false;
gdpGrowthUpAnnualChangeYAxis.Style.LineHidden = false;
chart.AddAxis (gdpGrowthUpAnnualChangeYAxis);
TKChartNumericAxis grossNationalSavingsAnnualGrowthUpYAxis = new TKChartNumericAxis (new NSNumber(0), new NSNumber(16));
grossNationalSavingsAnnualGrowthUpYAxis.MajorTickInterval = 2;
grossNationalSavingsAnnualGrowthUpYAxis.Position = TKChartAxisPosition.Right;
grossNationalSavingsAnnualGrowthUpYAxis.Style.LabelStyle.TextAlignment = TKChartAxisLabelAlignment.Left;
grossNationalSavingsAnnualGrowthUpYAxis.Style.MajorTickStyle.TicksHidden = false;
grossNationalSavingsAnnualGrowthUpYAxis.Style.LineHidden = false;
chart.AddAxis (grossNationalSavingsAnnualGrowthUpYAxis);
NSDate date2001 = DateWithYear (2001, 12, 31);
NSDate date2002 = DateWithYear (2002, 12, 31);
NSDate date2003 = DateWithYear (2003, 12, 31);
NSDate date2004 = DateWithYear (2004, 12, 31);
NSDate date2005 = DateWithYear (2005, 12, 31);
TKChartDataPoint[] gdpInPounds = new TKChartDataPoint[] {
new TKChartDataPoint(date2001, new NSNumber(1200)),
new TKChartDataPoint(date2002, new NSNumber(1200)),
new TKChartDataPoint(date2003, new NSNumber(1225)),
new TKChartDataPoint(date2004, new NSNumber(1300)),
new TKChartDataPoint(date2005, new NSNumber(1350))
};
TKChartColumnSeries gdpInPoundsSeries = new TKChartColumnSeries (gdpInPounds);
gdpInPoundsSeries.XAxis = periodXAxis;
gdpInPoundsSeries.YAxis = gdpInPoundsYAxis;
gdpInPoundsSeries.SelectionMode = TKChartSeriesSelectionMode.Series;
chart.AddSeries (gdpInPoundsSeries);
TKChartDataPoint[] gdpGrowthUpAnnual = new TKChartDataPoint[] {
new TKChartDataPoint (date2001, new NSNumber (4)),
new TKChartDataPoint (date2002, new NSNumber (3)),
new TKChartDataPoint (date2003, new NSNumber (2)),
new TKChartDataPoint (date2004, new NSNumber (-5)),
new TKChartDataPoint (date2005, new NSNumber (1))
};
float shapeSize = UIDevice.CurrentDevice.UserInterfaceIdiom == UIUserInterfaceIdiom.Phone ? 7 : 17;
TKChartLineSeries gdpGrowthUpSeries = new TKChartLineSeries (gdpGrowthUpAnnual);
gdpGrowthUpSeries.Style.PointShape = new TKPredefinedShape (TKShapeType.Circle, new SizeF (shapeSize, shapeSize));
gdpGrowthUpSeries.XAxis = periodXAxis;
gdpGrowthUpSeries.YAxis = gdpGrowthUpAnnualChangeYAxis;
gdpGrowthUpSeries.SelectionMode = TKChartSeriesSelectionMode.DataPoint;
gdpGrowthUpSeries.Style.ShapeMode = TKChartSeriesStyleShapeMode.AlwaysShow;
chart.AddSeries (gdpGrowthUpSeries);
TKChartDataPoint[] grossAnualSavings = new TKChartDataPoint[] {
new TKChartDataPoint (date2001, new NSNumber (14)),
new TKChartDataPoint (date2002, new NSNumber (8)),
new TKChartDataPoint (date2003, new NSNumber (12)),
new TKChartDataPoint (date2004, new NSNumber (11)),
new TKChartDataPoint (date2005, new NSNumber (16))
};
TKChartLineSeries grossAnualSavingsSeries = new TKChartLineSeries (grossAnualSavings);
grossAnualSavingsSeries.Style.PointShape = new TKPredefinedShape (TKShapeType.Circle, new SizeF(shapeSize, shapeSize));
grossAnualSavingsSeries.XAxis = periodXAxis;
grossAnualSavingsSeries.YAxis = grossNationalSavingsAnnualGrowthUpYAxis;
grossAnualSavingsSeries.SelectionMode = TKChartSeriesSelectionMode.DataPoint;
grossAnualSavingsSeries.Style.ShapeMode = TKChartSeriesStyleShapeMode.AlwaysShow;
chart.AddSeries (grossAnualSavingsSeries);
TKChartDataPoint[] gdpInvestment = new TKChartDataPoint[] {
new TKChartDataPoint (date2001, new NSNumber (15)),
new TKChartDataPoint (date2002, new NSNumber (13)),
new TKChartDataPoint (date2003, new NSNumber (16)),
new TKChartDataPoint (date2004, new NSNumber (19)),
new TKChartDataPoint (date2005, new NSNumber (15))
};
TKChartLineSeries gdpInvestmentSeries = new TKChartLineSeries (gdpInvestment);
gdpInvestmentSeries.Style.PointShape = new TKPredefinedShape (TKShapeType.Circle, new SizeF(shapeSize, shapeSize));
gdpInvestmentSeries.XAxis = periodXAxis;
gdpInvestmentSeries.YAxis = gdpInvestmentYAxis;
gdpInvestmentSeries.SelectionMode = TKChartSeriesSelectionMode.DataPoint;
gdpInvestmentSeries.Style.ShapeMode = TKChartSeriesStyleShapeMode.AlwaysShow;
chart.AddSeries (gdpInvestmentSeries);
this.setStyles (gdpInPoundsSeries);
this.setStyles (grossAnualSavingsSeries);
this.setStyles (gdpGrowthUpSeries);
this.setStyles (gdpInvestmentSeries);
chart.ReloadData ();
}