public void OffsetPointAt(IDataSeries series, int index, double offset)
        {
            double yValue = ((double)series.YValues[index]);

            yValue += offset;
            series.YValues[index] = yValue;

            series.InvalidateParentSurface(RangeMode.None);
        }
        private void UpdateSpectrogramHeatmapSeries(XyDataSeries <double, double> series)
        {
            // Compute the new spectrogram frame
            for (int x = 99; x >= 0; x--)
            {
                for (int y = 0; y < 1024; y++)
                {
                    _spectrogramBuffer[x, y] = (x == 99) ? series.YValues[y] : _pastFrame[x + 1, y];
                }
            }

            // Preserve the past frame, as current spectrogram is computed based on last + Xy fft values
            Array.Copy(_spectrogramBuffer, _pastFrame, _spectrogramBuffer.Length);

            // Forces Heatmap to redraw after updating values
            _uniformHeatmapDataSeries.InvalidateParentSurface(RangeMode.None);
        }
        public TradeOverlayExampleViewModel()
        {
            // Create some data to show on the chart
            _chartDataSeries            = new XyDataSeries <DateTime, double>();
            _chartDataSeries.SeriesName = "CL FUT JUN15 2013";

            // Get some price data, trades
            List <Trade>     trades;
            List <NewsEvent> newsEvents;
            var priceData = DataManager.Instance.GetRandomTrades(out trades, out newsEvents);

            // Buffer above and append all in one go to avoid multiple recalculations of series range
            _chartDataSeries.Append(priceData.TimeData, priceData.CloseData);

            // Create annotations
            TradeAnnotations = CreateAnnotations(trades, newsEvents);

            _chartDataSeries.InvalidateParentSurface(RangeMode.ZoomToFit);
        }