private static IList <DataPoint> GetDataPoints(ChartSeries series)
        {
            PieSeries pieSeries = series as PieSeries;

            if (pieSeries != null)
            {
                return((IList <DataPoint>)pieSeries.DataPoints);
            }

            CategoricalSeries categoricalSeries = series as CategoricalSeries;

            if (categoricalSeries != null)
            {
                return(categoricalSeries.DataPoints);
            }

            RangeSeries rangeSeries = series as RangeSeries;

            if (rangeSeries != null)
            {
                return(rangeSeries.DataPoints);
            }

            OhlcSeries ohlcSeries = series as OhlcSeries;

            if (ohlcSeries != null)
            {
                return(ohlcSeries.DataPoints);
            }

            ScatterPointSeries scatterPointSeries = (ScatterPointSeries)series;

            return(scatterPointSeries.DataPoints);
        }
Example #2
0
 public static RangeSeries <TKey, TValue, TCursor> Before <TKey, TValue, TCursor>(
     this RangeSeries <TKey, TValue, TCursor> series,
     TKey endKey, bool endInclusive = true)
     where TCursor : ICursor <TKey, TValue>
 {
     return(series.Range(Opt <TKey> .Missing, new Opt <TKey>(endKey), true, endInclusive));
 }
Example #3
0
 public static RangeSeries <TKey, TValue, TCursor> After <TKey, TValue, TCursor>(
     this RangeSeries <TKey, TValue, TCursor> series,
     TKey startKey, bool startInclusive = true)
     where TCursor : ICursor <TKey, TValue>
 {
     return(series.Range(new Opt <TKey>(startKey), Opt <TKey> .Missing, startInclusive, true));
 }
Example #4
0
        internal static RangeSeries <TKey, TValue, TCursor> Range <TKey, TValue, TCursor>(
            this RangeSeries <TKey, TValue, TCursor> series,
            Opt <TKey> startKey, Opt <TKey> endKey, bool startInclusive = true, bool endInclusive = true)
            where TCursor : ICursor <TKey, TValue>
        {
            // adjust range to efficiently nest range series, e.g. After(x).Before(y)

            var newStartKey = Opt <TKey> .LargerOrMissing(series.StartKey, startKey, series.Comparer);

            var newStartInclusive = newStartKey.Equals(startKey) ? startInclusive : series.StartInclusive;

            var newEndKey = Opt <TKey> .SmallerOrMissing(series.EndKey, endKey, series.Comparer);

            var newEndInclusive = newEndKey.Equals(endKey) ? endInclusive : series.EndInclusive;

            return(new RangeSeries <TKey, TValue, TCursor>(series,
                                                           newStartKey, newEndKey, newStartInclusive, newEndInclusive));
        }
 // RangeSeries<TKey, TValue, TCursor>
 public static MapValuesSeries <TKey, TValue, TResult, RangeSeries <TKey, TValue, TCursor> > Map <TKey, TValue, TResult, TCursor>(
     this RangeSeries <TKey, TValue, TCursor> series, Func <TValue, TResult> selector)
     where TCursor : ICursor <TKey, TValue>
 {
     return(new MapValuesSeries <TKey, TValue, TResult, RangeSeries <TKey, TValue, TCursor> >(series, selector));
 }