示例#1
0
        /// ------------------------------------------------------------------------------------
        private void WriteStageChart()
        {
            var sessionsByStage = _statsViewModel.SessionInformant.GetSessionsCategorizedByStage()
                                  .Where(r => r.Key.Id != ComponentRole.kConsentComponentRoleId);

            var barInfoList = (sessionsByStage.Select(
                                   x => new ChartBarInfo(x.Key.Name, x.Value, x.Key.Color, x.Key.TextColor))).ToList();

            ChartBarInfo.CalculateBarSizes(barInfoList);
            var text = LocalizationManager.GetString("ProgressView.ByStagesHeadingText", "By Stages");

            WriteChartForList(text, barInfoList, null, false);
        }
示例#2
0
        /// ------------------------------------------------------------------------------------
        private void WriteChartByFieldPair(string chartHeading, string primaryField,
                                           string secondaryField, IDictionary <string, Color> colors, IDictionary <string, Color> textColors)
        {
            var outerList =
                _statsViewModel.SessionInformant.GetCategorizedSessionsFromDoubleKey(primaryField, secondaryField);

            var barInfoList = (from x in outerList
                               select new ChartBarInfo(x.Key, secondaryField, x.Value, colors, textColors))
                              .OrderBy(bi => bi.FieldValue).ToList();

            ChartBarInfo.CalculateBarSizes(barInfoList);
            WriteChartForList(chartHeading, barInfoList, colors, true);
        }
示例#3
0
        /// ------------------------------------------------------------------------------------
        private string WriteBar(ChartBarInfo barInfo)
        {
            foreach (var seg in barInfo.Segments)
            {
                if (seg.TotalTime > 0)
                {
                    WriteBarSegment(seg);
                }
            }

            var text = LocalizationManager.GetString("ProgressView.SummaryTotalsTextForOneBar", "{0} sessions totaling {1} minutes");

            return(string.Format(text, barInfo.TotalSessions, barInfo.TotalTime));
        }
示例#4
0
        /// ------------------------------------------------------------------------------------
        private void WriteChartEntry(ChartBarInfo barInfo)
        {
            OpenTableRow();
            WriteTableCell("rowheading", barInfo.FieldValue);
            OpenTableCell("colorbar");
            OpenTable(null, barInfo.BarSize);
            OpenTableRow();

            var summaryText = WriteBar(barInfo);

            CloseTableRow();
            CloseTable();
            CloseTableCell();
            CloseTableRow();

            OpenTableRow();
            WriteTableCell("entrysummaryrowheading", string.Empty);
            WriteTableCell("entrysummary", summaryText);
            CloseTableRow();
        }