//-------------------------------------------------------------------------------------------------------
        private void RedrawChart()
        {
            ChartPrimitive chartPrimitive = this.xyLineChart.Primitives.FirstOrDefault();

            if (chartPrimitive != null)
            {
                ChartPrimitiveXY chartPrimitiveXY = chartPrimitive as ChartPrimitiveXY;
                if (chartPrimitiveXY != null)
                {
                    chartPrimitiveXY.ShowPoints = this.showPointsCheckBox.IsChecked.Value;
                    chartPrimitiveXY.PointColor = Colors.Red;

                    chartPrimitive.IsDashed = this.dashCheckBox.IsChecked.Value;

                    if (this.showLinesCheckBox.IsChecked.Value)
                    {
                        chartPrimitiveXY.LineThickness = 1;
                    }
                    else
                    {
                        chartPrimitiveXY.LineThickness = 0;
                    }

                    this.xyLineChart.RedrawPlotLines();
                }
            }
        }
        //-------------------------------------------------------------------------------------------------------
        //-------------------------------------------------------------------------------------------------------
        //Нарисовать график
        private void DrawChart
        (
            double[] xValues,
            double[] yValues,
            Color color,
            string chartName,
            bool isLineVisible,
            bool isPointsVisible,
            bool isClean
        )
        {
            if (isClean)
            {
                this.xyLineChart.Reset();
            }

            ChartPrimitiveXY chartPrimitive = this.xyLineChart.CreateXY();

            chartPrimitive.LegendColor   = color;
            chartPrimitive.LineColor     = color;
            chartPrimitive.Label         = chartName;
            chartPrimitive.LineThickness = isLineVisible ? 1 : 0;
            chartPrimitive.ShowPoints    = isPointsVisible;

            for (int index = 0; index < xValues.Length; index++)
            {
                double x = xValues[index];
                double y = yValues[index];
                chartPrimitive.AddPoint(x, y);
            }
            this.xyLineChart.AddPrimitive(chartPrimitive);
            this.xyLineChart.RedrawPlotLines();
        }