Esempio n. 1
0
        /// <summary>
        /// パス成功率用Dto抽出
        /// </summary>
        private PieChartDto PickChartAtPassSucceedAverage(TeamStats teamStats, string viewContainerId, string functionName)
        {
            var tmp = new[]{
                new {Label = JlgChartConst.PassSucceedAtSuccessLabel, X = 0, Y = teamStats.PassIndex.PassSucceed, Value = 0},
                new {Label = JlgChartConst.PassSucceedAtFailedLabel, X = 0, Y = (teamStats.PassIndex.PassFailed), Value = 0 },
             };

            var items = tmp.OrderByDescending(m => m.Y).ToList();

            var pieChartDto = new PieChartDto()
            {
                FunctionName = functionName,
                PieChartContainer = new PieChartContainer()
                {
                    ViewContainerId = viewContainerId,
                    ViewContainerClass = JlgChartConst.ChartCssClassName.pie_chart.ToString(),
                    DataSources = new List<PieDataSource>()
                                      {
                                          new PieDataSource(){ Label = items[0].Label, X = items[0].X, Y = items[0].Y, Value = items[0].Value },
                                          new PieDataSource(){ Label = items[1].Label, X = items[1].X, Y = items[1].Y, Value = items[1].Value },
                                      }
                },
                PieChartProperties = new ChartProperties()
                {
                    IsHtmlText = false,
                    ShadowSize = 0.5m,
                    FontSize = 10.5m,
                    Resolution = 2,
                    Colors = new List<string>() {"#00ff00", "#005500"},
                    Legend = new Legend() { position = Flotr2Const.LegendPosition.se, BackgroundColor = "#FFF", BorderColor = "#AAA" },
                    Pie = new Pie() { IsVisible = true, Explode = 0, SizeRatio = 0.9m, FillOpacity = 0.8m },
                    XAxis = new XAxis() { MinValue = 0, MaxValue = 1, IsVisibleLabels = false },
                    YAxis = new YAxis() { MinValue = 0, MaxValue = 1, IsVisibleLabels = false },
                    Grid = new Grid() { IsVisibleHorizontalLines = false, IsVisibleVerticalLines = false, BackGroundImageAddress = string.Empty, GridOutlineWidth = 0 },
                    Mouse = new Mouse() { IsTrackable = false, TrackFormatter = string.Empty },
                    Bubble = new Bubble() { IsVisible = false, BaseRadius = 0m },
                    Marker = new Marker() { IsVisible = false, FontSize = 10, IsRelative = false, LabelFormatter = string.Empty },
                }
            };

            return pieChartDto;
        }
Esempio n. 2
0
        /// <summary>
        /// 失点パターンチャートDto抽出
        /// </summary>
        private PieChartDto PickChartAtLostPattern(TeamStats teamStats, string viewContainerId, string functionName)
        {
            var tmp = new[]{
                new {Label = JlgChartConst.GoalIndexAtPkLabel, X = 0, Y = teamStats.LostIndex.AtPk, Value = 0},
                new {Label = JlgChartConst.GoalIndexAtSetPlayDirectlyLabel, X = 0, Y = teamStats.LostIndex.AtSetPlayDirectly, Value = 0 },
                new {Label = JlgChartConst.GoalIndexAtSetPlayLabel, X = 0, Y = teamStats.LostIndex.AtSetPlay, Value = 0},
                new {Label = JlgChartConst.GoalIndexAtCrossLabel, X = 0, Y = teamStats.LostIndex.AtCross, Value = 0},
                new {Label = JlgChartConst.GoalIndexAtThroughPassLabel, X = 0, Y = teamStats.LostIndex.AtThroughPass, Value = 0 },
                new {Label = JlgChartConst.GoalIndexAtShortPassLabel, X = 0, Y = teamStats.LostIndex.AtShortPass, Value = 0  },
                new {Label = JlgChartConst.GoalIndexAtLongPassLabel, X = 0, Y = teamStats.LostIndex.AtLongPass, Value = 0 },
                new {Label = JlgChartConst.GoalIndexAtDribbleLabel, X = 0, Y = teamStats.LostIndex.AtDribble, Value = 0},
                new {Label = JlgChartConst.GoalIndexAtLooseBallLabel,X = 0, Y = teamStats.LostIndex.AtLooseBall, Value = 0},
                new {Label = JlgChartConst.GoalIndexAtOtherLabel,X = 0, Y = teamStats.LostIndex.AtOther, Value = 0}
             };

            var items = tmp.OrderByDescending(m => m.Y).ToList();

            var pieChartDto = new PieChartDto()
            {
                FunctionName = functionName,
                PieChartContainer = new PieChartContainer()
                {
                    ViewContainerId = viewContainerId,

                    //Todo:コンテナ設定用CssClass
                    ViewContainerClass = JlgChartConst.ChartCssClassName.pie_chart.ToString(),
                    DataSources = new List<PieDataSource>()
                    {
                        new PieDataSource(){ Label = items[0].Label, X = items[0].X, Y = items[0].Y, Value = items[0].Value },
                        new PieDataSource(){ Label = items[1].Label, X = items[1].X, Y = items[1].Y, Value = items[1].Value },
                        new PieDataSource(){ Label = items[2].Label, X = items[2].X, Y = items[2].Y, Value = items[2].Value },
                        new PieDataSource(){ Label = items[3].Label, X = items[3].X, Y = items[3].Y, Value = items[3].Value },
                        new PieDataSource(){ Label = items[4].Label, X = items[4].X, Y = items[4].Y, Value = items[4].Value },
                        new PieDataSource(){ Label = items[5].Label, X = items[5].X, Y = items[5].Y, Value = items[5].Value },
                        new PieDataSource(){ Label = items[6].Label, X = items[6].X, Y = items[6].Y, Value = items[6].Value },
                        new PieDataSource(){ Label = items[7].Label, X = items[7].X, Y = items[7].Y, Value = items[7].Value },
                        new PieDataSource(){ Label = items[8].Label, X = items[8].X, Y = items[8].Y, Value = items[8].Value },
                        new PieDataSource(){ Label = items[9].Label, X = items[9].X, Y = items[9].Y, Value = items[9].Value },
                    }
                },
                PieChartProperties = new ChartProperties()
                {
                    IsHtmlText = false,
                    ShadowSize = 0.5m,
                    FontSize = 10.5m,
                    Resolution = 2,
                    Colors = new List<string>() { "#002b55", "#2b95ff", "#0055aa", "#80bfff", "#d5eaff", "#004080", "#55aaff", "#006ad5", "#aad5ff", "#0080ff" },
                    Legend = new Legend() { position = Flotr2Const.LegendPosition.se, BackgroundColor = "#FFF", BorderColor = "#AAA" },
                    Pie = new Pie() { IsVisible = true, Explode = 0, SizeRatio = 0.9m, FillOpacity = 0.8m },
                    XAxis = new XAxis() { MinValue = 0, MaxValue = 1, IsVisibleLabels = false },
                    YAxis = new YAxis() { MinValue = 0, MaxValue = 1, IsVisibleLabels = false },
                    Grid = new Grid() { IsVisibleHorizontalLines = false, IsVisibleVerticalLines = false, BackGroundImageAddress = string.Empty, GridOutlineWidth = 0 },
                    Mouse = new Mouse() { IsTrackable = false, TrackFormatter = string.Empty },
                    Bubble = new Bubble() { IsVisible = false, BaseRadius = 0m },
                    Marker = new Marker() { IsVisible = false, FontSize = 10, IsRelative = false, LabelFormatter = string.Empty },
                }
            };

            return pieChartDto;
        }