/// <summary>
 /// Initializes a new instance of the <see cref="DataSeries"/> class.
 /// </summary>
 private DataSeries(int maxYSeries)
 {
     MaxYSeries = Math.Max(1, maxYSeries);
     xValues    = new HashSet <double>();
     storage    = new List <DataPointX>();
     DataRange  = DataRange.EmptyDataRange();
     MinXValue  = double.NaN;
     MaxXValue  = double.NaN;
     DataInfo   = new DataSeriesInfoCollection(MaxYSeries);
 }
Example #2
0
        /// <summary>
        /// Copies the data series information of this collection to another specified collection.
        /// </summary>
        /// <param name="sourceIndex">The index of this collection</param>
        /// <param name="destIndex">The index of <paramref name="destCollection"/>.</param>
        /// <param name="destCollection">The destination collection.</param>
        /// <exception cref="ArgumentNullException"><paramref name="destCollection"/> is null.</exception>
        /// <exception cref="IndexOutOfRangeException"><paramref name="sourceIndex"/> or <paramref name="destIndex"/> is out of range.</exception>
        public void CopyTo(int sourceIndex, int destIndex, DataSeriesInfoCollection destCollection)
        {
            if (destCollection == null)
            {
                throw new ArgumentNullException(nameof(destCollection));
            }
            // this[idx] validates index. So does c.SetInfo(...) - will throw IndexOutOfRange if needed.
            DataSeriesInfo source = this[sourceIndex];

            destCollection.SetInfo(
                destIndex, source.Name, source.Visual.Data,
                source.Visual.PrimaryText, source.Visual.SecondaryText,
                source.Visual.Border, source.Visual.BorderThickness);
        }