/// <summary>
        /// Initializes a new instance of the <see cref="VerticalSeries"/> class.
        /// </summary>
        /// <param name="value">Value for 'x' for the vertical line.</param>
        /// <param name="chartArea">Chart area to which the series belongs.</param>
        public VerticalSeries(double value, ChartArea chartArea)
        {
            Value           = value;
            ChartAreaObject = chartArea;
            ChartType       = SeriesChartType.Line;

            Points.AddXY(value, ChartAreaObject.AxisY.Minimum);
            Points.AddXY(value, ChartAreaObject.AxisY.Maximum);
        }
예제 #2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="FunctionSeries"/> class.
        /// </summary>
        /// <param name="function">Function to be represented.</param>
        /// <param name="chartArea">Chart area to which this series belongs.</param>
        public FunctionSeries(Function function, ChartArea chartArea)
        {
            Function        = function;
            ChartAreaObject = chartArea;
            ChartType       = SeriesChartType.Line;

            var delta = (ChartAreaObject.AxisX.Maximum - ChartAreaObject.AxisX.Minimum) / AmountOfIntervals;

            for (int point = 0; point <= AmountOfIntervals + 1; point++)
            {
                var x = ChartAreaObject.AxisX.Minimum + (point * delta);
                Points.AddXY(x, Function.Evaluate(x));
            }
        }