本文整理汇总了C#中DataPoint.SetValueXY方法的典型用法代码示例。如果您正苦于以下问题:C# DataPoint.SetValueXY方法的具体用法?C# DataPoint.SetValueXY怎么用?C# DataPoint.SetValueXY使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DataPoint
的用法示例。
在下文中一共展示了DataPoint.SetValueXY方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: uxGamesRepeater_ItemDataBound
protected void uxGamesRepeater_ItemDataBound(object sender, RepeaterItemEventArgs e)
{
UserMeanGameScore mgs = (UserMeanGameScore)e.Item.DataItem;
//e.Item.FindControl("uxIndividualCharge");
if (Session["SessionId"] != null)
{
Guid sessionId = new Guid(Session["SessionId"].ToString());
GamesScoreWS.GameScoreService gsClient = new GamesScoreWS.GameScoreService();
IndividualGameResults igResults = gsClient.FetchIndividualGames(sessionId, mgs.GameId);
if (igResults.Success)
{
Chart createChart = (Chart)e.Item.FindControl("uxIndividualCharge");
createChart.Titles.Add(mgs.Game);
Series resultsSeries = createChart.Series["GameScores"];
foreach (t_GameResults gr in igResults.GameResultList)
{
DataPoint dp = new DataPoint();
decimal indexical = ((decimal)gr.Score / (decimal)gr.Total) * 100;
dp.SetValueXY(gr.Created.ToShortDateString(), indexical);
dp.ToolTip = string.Format("{0} out of {1} in {2} seconds", gr.Score, gr.Total, gr.TestDuration);
resultsSeries.Points.Add(dp);
}
}
}
}
示例2: CreateChart
public static void CreateChart(string imagePath,string name, IEnumerable<BenchResult> results, Func<BenchResult,double> selector)
{
Chart chart = new Chart();
chart.Width = 500;
chart.Height = 400;
chart.Titles.Add(name);
var area = new ChartArea("Default");
chart.ChartAreas.Add(area);
var series = new Series("Default");
chart.Series.Add(series);
area.AxisX.LabelAutoFitStyle = LabelAutoFitStyles.LabelsAngleStep90;
area.AxisX.LabelStyle.TruncatedLabels = false;
area.AxisX.Interval = 1;
series.ChartType = SeriesChartType.Column;
series.IsValueShownAsLabel = true;
series.XValueType = ChartValueType.String;
series.YValueType = ChartValueType.Int32;
foreach(var r in results.OrderBy( r => selector(r)))
{
DataPoint point = new DataPoint();
point.SetValueXY(r.Serializer.Replace("Adapter",""),(int)Math.Round(selector(r)));
point.AxisLabel = r.Serializer.Replace("Adapter", "");
series.Points.Add(point);
}
chart.SaveImage(imagePath, ChartImageFormat.Png);
}
示例3: SetDataPoint
private DataPoint SetDataPoint(decimal revenue, string day)
{
DataPoint p = new DataPoint();
p.SetValueXY(day, revenue);
return p;
}