当前位置: 首页>>代码示例>>C#>>正文


C# Chart.ToString方法代码示例

本文整理汇总了C#中Chart.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# Chart.ToString方法的具体用法?C# Chart.ToString怎么用?C# Chart.ToString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Chart的用法示例。


在下文中一共展示了Chart.ToString方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Index

        public ActionResult Index(string team)
        {
            var burndownColor = Color.SteelBlue;
            var velocityColor = Color.YellowGreen;
            var scopeColor = Color.Orange;

            var configuration = GetConfiguration(team);
            var burndown = GetBurndownData(configuration.Project, configuration.Label, configuration.HistoricalDataPath);

            var encoding = new GoogleExtendedEncoding();
            var burnChart = new BurndownChart(burndown, encoding) {
                StartDate = burndown.Min(item => item.Date),
                EndDate = configuration.EndDate ?? burndown.Max(item => item.Date),
                VelocityMax = 25
            };

            var yAxis = new ChartAxis(Axis.Y, new Tuple<int, int>(0, burnChart.ChartMax), new string[0], new int[0]);
            var xAxis = new ChartAxis(Axis.X, new Tuple<int, int>(0, 1), new[]{ burnChart.StartDate.ToShortDateString(), burnChart.EndDate.ToShortDateString() }, new[]{0, 1});
            var velocityAxis = new ChartAxis(Axis.Right, new Tuple<int, int>(0, burnChart.VelocityMax), new []{ "0", "5", "10", "15", "20", "Velocity" }, new []{ 0, 5, 10, 15, 20, 25 });

            var burnLine = burnChart.CreateBurnLine(Color.FromArgb(128, Color.Firebrick));
            var velocity = burnChart.CreateVelocitySeries(velocityColor);
            var velocityMean = burnChart.CreateVelocityMeanSeries(Color.FromArgb(128, velocityColor));
            var scope = burnChart.CreateScopeSeries(scopeColor);
            var pointsRemaining = burnChart.CreatePointsRemainingSeries(burndownColor);

            var chart = new Chart(
                string.Format("{0}: {1} points remaining. Velocity {2}. {3}",
                    configuration.Title,
                    burndown.PointsRemaining,
                    burnChart.MeanVelocity,
                    EstimateRemainingDisplay(burndown, burnChart.MeanVelocity)), 800, 300,
                new []{ xAxis, yAxis, velocityAxis },
                new [] {
                    pointsRemaining,
                    velocity,
                    scope,
                    burnLine,
                    velocityMean
                }.SelectMany(x => new [] { x.X, x.Y }),
                new []{
                    ChartMarker.NewCircle(burndownColor, 0, MarkerPoints.All, 8),
                    ChartMarker.NewCircle(Color.White, 0, MarkerPoints.All, 4)
                },
                ChartMode.XYLine, encoding, new[]{ pointsRemaining.Style, velocity.Style, scope.Style, burnLine.Style, velocityMean.Style});
            return View(new ChartView { Name = configuration.Title, DisplayMarkup = "<img src='" + chart.ToString() + "'/>" });
        }
开发者ID:neochrome,项目名称:CardWall,代码行数:47,代码来源:ChartsController.cs


注:本文中的Chart.ToString方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。