Esempio n. 1
0
        /// <summary>
        /// Set the color of specific plot components
        /// </summary>
        /// <param name="figureBackground">Color for area beneath the axis ticks and labels and around the data area</param>
        /// <param name="dataBackground">Color for area inside the data frame but beneath the grid and plottables</param>
        /// <param name="grid">Color for grid lines</param>
        /// <param name="tick">Color for axis tick marks and frame lines</param>
        /// <param name="axisLabel">Color for axis labels and tick labels</param>
        /// <param name="titleLabel">Color for the top axis label (XAxis2's title)</param>
        public void Style(
            Color?figureBackground = null,
            Color?dataBackground   = null,
            Color?grid             = null,
            Color?tick             = null,
            Color?axisLabel        = null,
            Color?titleLabel       = null)
        {
            settings.FigureBackground.Color = figureBackground ?? settings.FigureBackground.Color;
            settings.DataBackground.Color   = dataBackground ?? settings.DataBackground.Color;

            foreach (var axis in settings.Axes)
            {
                axis.Label(color: axisLabel);
                axis.TickLabelStyle(color: tick);
                axis.MajorGrid(color: grid);
                axis.MinorGrid(color: grid);
                if (tick.HasValue)
                {
                    axis.TickMarkColor(color: tick.Value);
                }
                axis.Line(color: tick);
            }

            XAxis2.Label(color: titleLabel);
        }