Ejemplo n.º 1
0
        public static void Draw(this IChart chart, IEnumerable <RefPair <DateTimeOffset, IDictionary <IChartElement, object> > > values)
        {
            var data = chart.CreateData();

            foreach (var pair in values)
            {
                var item = data.Group(pair.First);

                foreach (var p in pair.Second)
                {
                    item.Add(p.Key, p.Value);
                }
            }

            chart.Draw(data);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// To draw the candle.
        /// </summary>
        /// <param name="chart">Chart.</param>
        /// <param name="element">The chart element representing a candle.</param>
        /// <param name="candle">Candle.</param>
        public static void Draw(this IChart chart, IChartCandleElement element, Candle candle)
        {
            if (element == null)
            {
                throw new ArgumentNullException(nameof(element));
            }

            if (candle == null)
            {
                throw new ArgumentNullException(nameof(candle));
            }

            var data = chart.CreateData();

            data
            .Group(candle.OpenTime)
            .Add(element, candle);

            chart.Draw(data);
        }