Ejemplo n.º 1
0
        private ReportSettings readSettings()
        {
            var result = new ReportSettings
            {
                DataSource       = (DataSource)Enum.Parse(typeof(DataSource), (string)_menuDataSource.SelectedItem),
                ApplyFilter      = _buttonApplyFilter.Checked,
                LabelDataElement = (DataElement)Enum.Parse(typeof(DataElement), (string)_menuLabelDataElement.SelectedItem),
                ChartType        = (SeriesChartType)Enum.Parse(typeof(SeriesChartType), (string)_menuChartType.SelectedItem),
                ColumnFields     = readFields(_tabCols),
                ColumnFieldsSort = readEnum <SortOrder>(_tabCols, _sortIconsOrder),
                SeriesFields     = readFields(_tabRows),
                SeriesFieldsSort = readEnum <SortOrder>(_tabRows, _sortIconsOrder),
                SummaryFields    = readFields(_tabSummSort),
                SummarySort      = readEnum <SortOrder>(_tabSummSort, _sortIconsOrder),
                SummaryFunctions = _tabSumm.Icons
                                   .Select(icn => _aggregatesOrder[_aggregateIconsOrder.IndexOf(icn)])
                                   .ToList(),
                ShowArgumentTotal = _buttonArgumentTotals.Checked,
                ShowSeriesTotal   = _buttonSeriesTotal.Checked,
                ExplainTotal      = _buttonExplainTotal.Checked
            };

            return(result);
        }
Ejemplo n.º 2
0
        private void populateData(
            List <string> arguments,
            List <string> series,
            List <List <object[]> > seriesValues,
            IList <object[]> argumentTotals,
            IList <object[]> seriesTotals,
            ReportSettings settings)
        {
            _chart = createChart();

            var colorTransformation = new ColorSchemeTransformation(null);

            var originalPalette = ChartPalettes.OriginalByName[_chart.Palette];
            var palette         = ChartPalettes.ByName[_chart.Palette];

            for (int i = 0; i < palette.Length; i++)
            {
                palette[i] = colorTransformation.TransformColor(originalPalette[i]);
            }

            var summaryFields = settings.SummaryFields;

            var metadata = ChartTypeMetadata.ByType[settings.ChartType];

            if (metadata.CanDisplayMultipleSeries)
            {
                _chart.Legends.Add(createLegend());
            }

            ChartArea area = null;

            Series[]        seriesList             = null;
            string[]        seriesSummaryLegend    = null;
            List <string>[] argumentSummaryLegends = null;

            for (int k = 0; k < summaryFields.Count; k++)
            {
                string summaryFieldAlias    = _fields.ByName[summaryFields[k]].Alias;
                string summaryFunctionAlias = Aggregates.Alias[settings.SummaryFunctions[k]];

                if (k == 0 || !metadata.CanDisplayMultipleSeries)
                {
                    area = createArea();
                    _chart.ChartAreas.Add(area);

                    if (metadata.SwitchValueAxes)
                    {
                        area.AxisX.IsReversed = true;
                    }

                    if (metadata.IsPieChart)
                    {
                        area.Area3DStyle.Enable3D    = true;
                        area.Area3DStyle.Inclination = 30;
                    }

                    seriesSummaryLegend = new string[series.Count];

                    argumentSummaryLegends = new List <string> [arguments.Count];
                    for (int i = 0; i < arguments.Count; i++)
                    {
                        argumentSummaryLegends[i] = new List <string>();
                    }

                    if (metadata.CanDisplayMultipleSeries)
                    {
                        seriesList = new Series[series.Count * summaryFields.Count];
                    }
                    else
                    {
                        seriesList = new Series[1];
                    }

                    for (int j = 0; j < seriesList.Length; j++)
                    {
                        var chartSeries = new Series
                        {
                            ChartType = settings.ChartType,
                            ChartArea = area.Name,

                            LabelForeColor = SystemColors.WindowText,
                            BorderColor    = SystemColors.ActiveBorder,
                            MarkerColor    = SystemColors.ActiveBorder
                        };

                        chartSeries.Font = chartSeries.Font.ByDpi();

                        if (settings.LabelDataElement == DataElement.None)
                        {
                            chartSeries.IsValueShownAsLabel = false;
                        }
                        else
                        {
                            chartSeries.LabelFormat = @"0.##";
                            chartSeries.EmptyPointStyle.LabelFormat = @"#";
                            chartSeries.IsValueShownAsLabel         = true;
                        }

                        seriesList[j] = chartSeries;

                        if (metadata.IsPieChart)
                        {
                            chartSeries[@"PieLabelStyle"] = @"Outside";
                            chartSeries[@"PieLineColor"]  = @"Gray";
                        }

                        chartSeries[@"PyramidValueType"] = @"Surface";

                        _chart.Series.Add(chartSeries);

                        chartSeries.IsVisibleInLegend = settings.ShowSeriesTotal && metadata.CanDisplayMultipleSeries;
                    }
                }


                if (metadata.CanDisplayMultipleSeries && metadata.SupportStackedGroups)
                {
                    for (int j = 0; j < series.Count; j++)
                    {
                        var chartSeries = seriesList[k * series.Count + j];
                        chartSeries[@"StackedGroupName"] = summaryFieldAlias;
                    }
                }

                for (int i = 0; i < arguments.Count; i++)
                {
                    for (int j = 0; j < series.Count; j++)
                    {
                        Series chartSeries;
                        if (metadata.CanDisplayMultipleSeries)
                        {
                            chartSeries = seriesList[k * series.Count + j];
                        }
                        else
                        {
                            chartSeries = seriesList[0];
                        }

                        var yValue = seriesValues[j][i][k];

                        chartSeries.Points.AddXY(arguments[i], yValue);

                        var point = chartSeries.Points[chartSeries.Points.Count - 1];

                        if (yValue == null || Convert.ToSingle(yValue) < 0.009f)
                        {
                            point.IsEmpty = true;
                        }
                        else if (settings.LabelDataElement == DataElement.SummaryField)
                        {
                            point.Label = $"{yValue:0.##}: {summaryFieldAlias}";
                        }
                        else if (settings.LabelDataElement == DataElement.Series)
                        {
                            point.Label = $"{yValue:0.##}: {series[j]}";
                        }
                        else if (settings.LabelDataElement == DataElement.Argument)
                        {
                            point.Label = $"{yValue:0.##}: {arguments[i]}";
                        }
                        else if (settings.LabelDataElement == DataElement.SeriesAndArgument)
                        {
                            point.Label = $"{yValue:0.##}: {arguments[i]}, {series[j]}";
                        }
                        else if (settings.LabelDataElement == DataElement.Values)
                        {
                            point.Label = $"{yValue:0.##}";
                        }
                        else
                        {
                            point.Label = null;
                        }

                        if (series.Count > 1)
                        {
                            point.Color = palette[j % palette.Length];
                        }
                        else if (!metadata.RequireAxes)
                        {
                            point.Color = palette[i % palette.Length];
                        }
                        else if (summaryFields.Count > 1)
                        {
                            point.Color = palette[k % palette.Length];
                        }
                    }
                }

                if (settings.ShowSeriesTotal)
                {
                    for (int j = 0; j < series.Count; j++)
                    {
                        string legend;

                        bool   seriesSet = settings.SeriesFields.Count > 1 || settings.SeriesFields[0] != string.Empty;
                        string seriesName;
                        if (seriesSet)
                        {
                            seriesName = series[j];
                        }
                        else
                        {
                            seriesName = $"{summaryFunctionAlias} {summaryFieldAlias}";
                        }

                        if (settings.ExplainTotal && seriesSet)
                        {
                            legend = $"{seriesName}: {seriesTotals[j][k]}, {summaryFunctionAlias} {summaryFieldAlias}";
                        }
                        else
                        {
                            legend = $"{seriesName}: {seriesTotals[j][k]}";
                        }

                        if (metadata.CanDisplayMultipleSeries)
                        {
                            seriesList[k * series.Count + j].LegendText = legend;
                        }
                        else
                        {
                            seriesSummaryLegend[j] = legend;
                        }
                    }
                }

                if (settings.ShowArgumentTotal)
                {
                    for (int i = 0; i < arguments.Count; i++)
                    {
                        string legend;

                        if (settings.ExplainTotal)
                        {
                            legend = $"{arguments[i]}: {argumentTotals[i][k]}, {summaryFunctionAlias} {summaryFieldAlias}";
                        }
                        else
                        {
                            legend = $"{arguments[i]}: {argumentTotals[i][k]}";
                        }

                        argumentSummaryLegends[i].Add(legend);
                    }
                }

                if ((settings.ShowSeriesTotal || settings.ShowArgumentTotal) && !metadata.CanDisplayMultipleSeries)
                {
                    var legend = createLegend();

                    legend.DockedToChartArea       = area.Name;
                    legend.IsDockedInsideChartArea = false;

                    if (settings.ShowSeriesTotal)
                    {
                        for (int j = 0; j < seriesSummaryLegend.Length; j++)
                        {
                            string seriesLegend = seriesSummaryLegend[j];
                            legend.CustomItems.Add(palette[j % palette.Length], seriesLegend);
                        }
                    }

                    if (settings.ShowArgumentTotal)
                    {
                        for (int i = 0; i < argumentSummaryLegends.Length; i++)
                        {
                            var argumentLegend = argumentSummaryLegends[i];
                            legend.CustomItems.Add(SystemColors.ActiveBorder, argumentLegend[0]);
                        }
                    }

                    _chart.Legends.Add(legend);
                }
            }

            if (metadata.CanDisplayMultipleSeries && settings.ShowArgumentTotal)
            {
                var argumentSummaries = argumentSummaryLegends
                                        .Select(legends => string.Join("\r\n", legends))
                                        .ToArray();

                for (int k = 0; k < summaryFields.Count; k++)
                {
                    for (int j = 0; j < series.Count; j++)
                    {
                        var chartSeries = _chart.Series[k * series.Count + j];

                        for (int i = 0; i < chartSeries.Points.Count; i++)
                        {
                            chartSeries.Points[i].AxisLabel = argumentSummaries[i];
                        }
                    }
                }
            }

            setupScrollbar(metadata);
        }
Ejemplo n.º 3
0
        private void loadReport(ButtonBase button)
        {
            ReportSettings settings = null;

            if (button == _buttonManaCurveType || button == _buttonManaCurveManacost)
            {
                settings = new ReportSettings
                {
                    DataSource       = DataSource.Deck,
                    SeriesFieldsSort = new List <SortOrder> {
                        SortOrder.Ascending
                    },
                    ColumnFields = new List <string> {
                        nameof(Card.Cmc)
                    },
                    ColumnFieldsSort = new List <SortOrder> {
                        SortOrder.Ascending
                    },
                    SummaryFields = new List <string> {
                        nameof(Card.DeckCount)
                    },
                    SummaryFunctions = new List <string> {
                        Aggregates.Sum
                    },
                    ChartType         = SeriesChartType.StackedColumn,
                    LabelDataElement  = DataElement.Series,
                    ShowArgumentTotal = true
                };

                if (button == _buttonManaCurveType)
                {
                    settings.SeriesFields = new List <string> {
                        nameof(Card.Types)
                    }
                }
                ;
                else if (button == _buttonManaCurveManacost)
                {
                    settings.SeriesFields = new List <string> {
                        nameof(Card.Color)
                    }
                }
                ;
            }
            else if (button == _buttonDeckPrice || button == _buttonCollectionPrice)
            {
                settings = new ReportSettings
                {
                    ColumnFields = new List <string> {
                        nameof(Card.NameEn)
                    },
                    SummaryFunctions = new List <string> {
                        Aggregates.Sum, Aggregates.Sum
                    },
                    SummarySort = new List <SortOrder> {
                        SortOrder.Descending, SortOrder.None
                    },
                    LabelDataElement = DataElement.SummaryField,
                    ChartType        = (SeriesChartType)Enum.Parse(typeof(SeriesChartType), _menuPriceChartType.SelectedValue)
                };

                if (button == _buttonDeckPrice)
                {
                    settings.SummaryFields = getPriceSummaryFields(_deckPriceTotalFields);
                    settings.DataSource    = DataSource.Deck;
                }
                else if (button == _buttonCollectionPrice)
                {
                    settings.SummaryFields = getPriceSummaryFields(_collectionPriceTotalFields);
                    settings.DataSource    = DataSource.Collection;
                }
                else
                {
                    throw new Exception("Logical error");
                }

                if (!ChartTypeMetadata.ByType[settings.ChartType].CanDisplayMultipleSeries)
                {
                    settings.SummaryFields.RemoveAt(1);
                    settings.SummarySort.RemoveAt(1);
                    settings.SummaryFunctions.RemoveAt(1);

                    settings.LabelDataElement = DataElement.Argument;
                }
            }
            else if (button == _buttonDeckColors || button == _buttonCollectionColors)
            {
                settings = new ReportSettings
                {
                    SeriesFields = new List <string> {
                        nameof(Card.Types)
                    },
                    SeriesFieldsSort = new List <SortOrder> {
                        SortOrder.Ascending
                    },
                    ColumnFields = new List <string> {
                        nameof(Card.Color)
                    },
                    ColumnFieldsSort = new List <SortOrder> {
                        SortOrder.Ascending
                    },
                    SummaryFunctions = new List <string> {
                        Aggregates.Sum
                    },
                    ChartType         = SeriesChartType.StackedColumn,
                    LabelDataElement  = DataElement.Series,
                    ShowArgumentTotal = true
                };

                if (button == _buttonDeckColors)
                {
                    settings.SummaryFields = new List <string> {
                        nameof(Card.DeckCount)
                    };
                    settings.DataSource = DataSource.Deck;
                }
                else if (button == _buttonCollectionColors)
                {
                    settings.SummaryFields = new List <string> {
                        nameof(Card.CollectionCount)
                    };
                    settings.DataSource = DataSource.Collection;
                }
            }

            if (settings != null)
            {
                Title = button.Text;
                buildChart(settings);
            }
        }
Ejemplo n.º 4
0
        private void loadReport(CheckBox button)
        {
            ReportSettings settings = null;
            Func <bool>    isReady  = () => _repository.IsLocalizationLoadingComplete;

            if (button == _buttonManaCurveType || button == _buttonManaCurveManacost)
            {
                settings = new ReportSettings
                {
                    DataSource       = DataSource.Deck,
                    SeriesFieldsSort = new List <SortOrder> {
                        SortOrder.Ascending
                    },
                    ColumnFields = new List <string> {
                        nameof(Card.Cmc)
                    },
                    ColumnFieldsSort = new List <SortOrder> {
                        SortOrder.Ascending
                    },
                    SummaryFields = new List <string> {
                        nameof(Card.DeckCount)
                    },
                    SummaryFunctions = new List <string> {
                        Aggregates.Sum
                    },
                    ChartType         = SeriesChartType.StackedColumn,
                    LabelDataElement  = DataElement.Series,
                    ShowArgumentTotal = true
                };

                if (button == _buttonManaCurveType)
                {
                    settings.SeriesFields = new List <string> {
                        nameof(Card.Types)
                    }
                }
                ;
                else if (button == _buttonManaCurveManacost)
                {
                    settings.SeriesFields = new List <string> {
                        nameof(Card.Color)
                    }
                }
                ;

                isReady = () => _repository.IsLoadingComplete;
            }
            else if (button == _buttonArtistsPerYear)
            {
                settings = new ReportSettings
                {
                    DataSource   = DataSource.AllCards,
                    ColumnFields = new List <string> {
                        nameof(Card.ReleaseYear)
                    },
                    ColumnFieldsSort = new List <SortOrder> {
                        SortOrder.Ascending
                    },
                    SummaryFields = new List <string> {
                        nameof(Card.Artist)
                    },
                    SummaryFunctions = new List <string> {
                        Aggregates.CountDistinct
                    },
                    ChartType        = SeriesChartType.Spline,
                    LabelDataElement = DataElement.Values,
                    ExplainTotal     = true
                };

                isReady = () => _repository.IsLoadingComplete;
            }
            else if (button == _buttonDeckPrice || button == _buttonCollectionPrice)
            {
                settings = new ReportSettings
                {
                    ColumnFields = new List <string> {
                        nameof(Card.NameEn)
                    },
                    SummaryFunctions = new List <string> {
                        Aggregates.Sum, Aggregates.Sum
                    },
                    SummarySort = new List <SortOrder> {
                        SortOrder.Descending, SortOrder.None
                    },
                    LabelDataElement = DataElement.SummaryField,
                    ChartType        = (SeriesChartType)Enum.Parse(typeof(SeriesChartType), (string)_menuPriceChartType.SelectedItem)
                };

                if (button == _buttonDeckPrice)
                {
                    settings.SummaryFields = getPriceSummaryFields(_deckPriceTotalFields);
                    settings.DataSource    = DataSource.Deck;
                }
                else if (button == _buttonCollectionPrice)
                {
                    settings.SummaryFields = getPriceSummaryFields(_collectionPriceTotalFields);
                    settings.DataSource    = DataSource.Collection;
                }
                else
                {
                    throw new Exception("Logical error");
                }

                if (!ChartTypeMetadata.ByType[settings.ChartType].CanDisplayMultipleSeries)
                {
                    settings.SummaryFields.RemoveAt(1);
                    settings.SummarySort.RemoveAt(1);
                    settings.SummaryFunctions.RemoveAt(1);

                    settings.LabelDataElement = DataElement.Argument;
                }
            }
            else if (button == _buttonDeckColors || button == _buttonCollectionColors)
            {
                settings = new ReportSettings
                {
                    SeriesFields = new List <string> {
                        nameof(Card.Types)
                    },
                    SeriesFieldsSort = new List <SortOrder> {
                        SortOrder.Ascending
                    },
                    ColumnFields = new List <string> {
                        nameof(Card.Color)
                    },
                    ColumnFieldsSort = new List <SortOrder> {
                        SortOrder.Ascending
                    },
                    SummaryFunctions = new List <string> {
                        Aggregates.Sum
                    },
                    ChartType         = SeriesChartType.StackedColumn,
                    LabelDataElement  = DataElement.Series,
                    ShowArgumentTotal = true
                };

                if (button == _buttonDeckColors)
                {
                    settings.SummaryFields = new List <string> {
                        nameof(Card.DeckCount)
                    };
                    settings.DataSource = DataSource.Deck;
                }
                else if (button == _buttonCollectionColors)
                {
                    settings.SummaryFields = new List <string> {
                        nameof(Card.CollectionCount)
                    };
                    settings.DataSource = DataSource.Collection;
                }

                isReady = () => _repository.IsLoadingComplete;
            }

            if (settings != null)
            {
                loadWhenReady(button, isReady, settings, false);
            }
        }
Ejemplo n.º 5
0
        private void populateDataNPlot(
            List <string> arguments,
            List <string> series,
            List <List <object[]> > seriesValues,
            IList <object[]> argumentTotals,
            IList <object[]> seriesTotals,
            ReportSettings settings)
        {
            var chart = new PlotSurface2D
            {
                BackColor     = SystemColors.Control,
                ForeColor     = SystemColors.ControlText,
                PlotBackColor = SystemColors.Window,
                TitleColor    = SystemColors.ControlText,
                SmoothingMode = SmoothingMode.HighQuality,
                Font          = Font
            };

            replaceChart(chart);
            if (arguments.Count == 0)
            {
                return;
            }

            var colorTransformation = new ColorSchemeTransformation(null)
            {
                IgnoreSaturation = true,
                AsBackground     = true,
            };

            var palette = _palette
                          .Select(colorTransformation.TransformColor)
                          .ToArray();

            var summaryFields = settings.SummaryFields;

            chart.Legend = new Legend
            {
                BackgroundColor = SystemColors.Window,
                TextColor       = SystemColors.WindowText,
                BorderColor     = SystemColors.ActiveBorder
            };

            chart.Legend.Font = chart.Legend.Font.ByDpi();
            chart.Add(new Grid
            {
                VerticalGridType   = Grid.GridType.Fine,
                HorizontalGridType = Grid.GridType.None,
                MinorGridPen       = new Pen(SystemColors.GrayText)
                {
                    DashPattern = new[] { 1f, 5f }
                },
                MajorGridPen = new Pen(SystemColors.GrayText)
            });

            var seriesSummaryLegend    = new string[series.Count];
            var argumentSummaryLegends = new List <string> [arguments.Count];

            for (int i = 0; i < arguments.Count; i++)
            {
                argumentSummaryLegends[i] = new List <string>();
            }

            var seriesList = new HistogramPlot[series.Count * summaryFields.Count];

            float totalBarWidth = 0.75f;
            float barWidth      = totalBarWidth / summaryFields.Count;

            double minY = double.MaxValue;
            double maxY = double.MinValue;

            var dataLabels = new List <TextItem>();

            for (int k = 0; k < summaryFields.Count; k++)
            {
                float barOffset = (barWidth - totalBarWidth) * 0.5f + k * barWidth;

                string summaryFieldAlias    = _fields.ByName[summaryFields[k]].Alias;
                string summaryFunctionAlias = Aggregates.Alias[settings.SummaryFunctions[k]];

                var stackedYValues = new double[arguments.Count];
                minY = Math.Min(0d, minY);
                maxY = Math.Max(0d, maxY);

                for (int j = 0; j < series.Count; j++)
                {
                    int n = k * series.Count + j;

                    Color color       = palette[n % palette.Length];
                    var   chartSeries = new HistogramPlot
                    {
                        Filled         = true,
                        RectangleBrush = new RectangleBrushes.Solid(color),
                        BaseWidth      = barWidth,
                        BaseOffset     = barOffset,
                        Color          = color,
                    };

                    seriesList[n] = chartSeries;
                    chart.Add(chartSeries);
                    chartSeries.ShowInLegend = settings.ShowSeriesTotal;

                    chartSeries.Label = series[j];
                    var yValues = Enumerable.Range(0, arguments.Count)
                                  .Select(i => Convert.ToDouble(seriesValues[j][i][k] ?? 0))
                                  .ToList();

                    chartSeries.DataSource = yValues;
                    for (int i = 0; i < arguments.Count; i++)
                    {
                        stackedYValues[i] += yValues[i];
                    }

                    minY = Math.Min(minY, stackedYValues.Min());
                    maxY = Math.Max(maxY, stackedYValues.Max());

                    if (j > 0)
                    {
                        chartSeries.StackedTo(seriesList[n - 1]);
                    }

                    for (int i = 0; i < arguments.Count; i++)
                    {
                        double yValue = yValues[i];
                        if (yValue < 0.009)
                        {
                            continue;
                        }

                        string text;
                        switch (settings.LabelDataElement)
                        {
                        case DataElement.SummaryField:
                            text = $"{yValue:0.##}: {summaryFieldAlias}";
                            break;

                        case DataElement.Series:
                            text = $"{yValue:0.##}: {series[j]}";
                            break;

                        case DataElement.Argument:
                            text = $"{yValue:0.##}: {arguments[i]}";
                            break;

                        case DataElement.SeriesAndArgument:
                            text = $"{yValue:0.##}: {arguments[i]}, {series[j]}";
                            break;

                        case DataElement.Values:
                            text = $"{yValue:0.##}";
                            break;

                        default:
                            continue;
                        }

                        var labelY = stackedYValues[i] - yValue * 0.5;
                        dataLabels.Add(new TextItem(
                                           new PointD(i + barOffset - 0.5f * barWidth + 0.05, labelY),
                                           text)
                        {
                            TextColor = SystemColors.ControlText,
                        });
                    }
                }

                // if (settings.ShowSeriesTotal)
                //  for (int j = 0; j < series.Count; j++)
                //  {
                //      string legend;
                //
                //      bool seriesSet = settings.SeriesFields.Count > 1 || settings.SeriesFields[0] != string.Empty;
                //      string seriesName;
                //      if (seriesSet)
                //          seriesName = series[j];
                //      else
                //          seriesName = $"{summaryFunctionAlias} {summaryFieldAlias}";
                //
                //      if (settings.ExplainTotal && seriesSet)
                //          legend = $"{seriesName}: {seriesTotals[j][k]}, {summaryFunctionAlias} {summaryFieldAlias}";
                //      else
                //          legend = $"{seriesName}: {seriesTotals[j][k]}";
                //
                //      if (metadata.CanDisplayMultipleSeries)
                //          seriesList[k * series.Count + j].LegendText = legend;
                //      else
                //          seriesSummaryLegend[j] = legend;
                //  }
                //
                // if (settings.ShowArgumentTotal)
                //  for (int i = 0; i < arguments.Count; i++)
                //  {
                //      string legend;
                //
                //      if (settings.ExplainTotal)
                //          legend = $"{arguments[i]}: {argumentTotals[i][k]}, {summaryFunctionAlias} {summaryFieldAlias}";
                //      else
                //          legend = $"{arguments[i]}: {argumentTotals[i][k]}";
                //
                //      argumentSummaryLegends[i].Add(legend);
                //  }
            }

            int largeTickStep = getLargeTickStep(maxY);

            chart.YAxis1 = new LinearAxis
            {
                WorldMin           = minY,
                WorldMax           = maxY + 0.5,
                LargeTickStep      = largeTickStep,
                NumberOfSmallTicks = Math.Min(4, largeTickStep - 1),
                TickTextFont       = Font,
                Color         = SystemColors.WindowText,
                LabelColor    = SystemColors.WindowText,
                TickTextColor = SystemColors.WindowText,
            };
            var la = new LabelAxis
            {
                WorldMin           = -0.5,
                WorldMax           = arguments.Count - 0.5,
                TickTextFont       = Font,
                Color              = SystemColors.WindowText,
                LabelColor         = SystemColors.WindowText,
                TickTextColor      = SystemColors.WindowText,
                TickTextNextToAxis = false,
                TicksLabelAngle    = 10f
            };

            chart.XAxis1 = la;
            if (settings.ShowArgumentTotal)
            {
                var argumentSummaries = argumentSummaryLegends
                                        .Select(legends => string.Join("\n", legends))
                                        .ToArray();
                for (int i = 0; i < arguments.Count; i++)
                {
                    la.AddLabel((arguments[i] + '\n' + argumentSummaries[i]).TrimEnd(), i);
                }
            }
            else
            {
                for (int i = 0; i < arguments.Count; i++)
                {
                    la.AddLabel(arguments[i], i);
                }
            }

            foreach (TextItem label in dataLabels)
            {
                chart.Add(label);
            }
        }