SciChart® the market leader in Fast WPF Charts, WPF 3D Charts, and now iOS Charting & Android Chart Components

0
0

A useful addition to the OhlcDataSeries would be an Append(datetime,value) method that would automatically determine whether to update the latest open, high, low, close or add a new bar based based on the values passed in, the current bar time/values and the BarTimeFrame property.

Thanks again

Paul

  • You must to post comments
0
0

Hi Paul,

Thanks for the suggestion, we appreciate feedback from our customers which help to make our API/user experience better! We will consider if this can be done to improve usability of stock charts in future iterations.

For now, you can implement such a method using Update/Insert/Append existing API in this way:

        private void AddOrUpdatePoint(DateTime date, double value)
        {
            if (_dataSeries.XValues.IndexOf(date) >= 0)
            {
                _dataSeries.Update(date, value);
            }
            else
            {
                _dataSeries.Append(date, value);
            }
        }

Thanks,
Yuriy

  • David Whatley
    That is incorrect. This is in reference to the ohlcDataSeries. It is not a single value, though a new single value would be what is passed in. Then it would have to figure out the correct action: Add a new bar, setting ohlc values to that value. Or update the existing bar, changing the h and l values if appropriate and setting the c value to that.
  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.