Pre loader

Overlapping Candlesticks

Welcome to the SciChart Forums!

  • Please read our Question Asking Guidelines for how to format a good question
  • Some reputation is required to post answers. Get up-voted to avoid the spam filter!
  • We welcome community answers and upvotes. Every Q&A improves SciChart for everyone

WPF Forums | JavaScript Forums | Android Forums | iOS Forums


A little recap: I’m building a Trading Chart Application that displays historical and live market data. I’m using SciCharts v1.7.1 (there’s a problem that I have already reported with v2 that prevents from using it for now).

There are a few issues/questions that I have about SciCharts:

  1. When displaying few bars on the chart (look at attachments ‘SciChart-XStudy.png’ & ‘SciChart-XStudy2.png’) there is some overlapping among the candlesticks. At the beginning I was using CategoryDateTimeAxis but it does not work for me because traders at my company need the empty spaces when there is no activity on the market (CategoryDateTimeAxis skips does spaces), so I’m using DateTimeAxis now. I thought about using Gaps but this is only supported for Line and Column charts. Finally I tried playing with DataPointWidth but I could not get the results that I wanted. What suggestions do you have about this? Is this a known issue or am I setting up something incorrectly? In the screenshots I attached you can compare SciCharts (left) with XStudy (right), which is the application I’m trying to replicate.

  2. As you can appreciate in attachment ‘Volume_No_Labels.png’ the MayorGridLines and labels are not being drawn for my Volume Chart even though I have it set to TRUE. Is there some way to set the scale manually or is it done automatically? I could probably do some calculation on my side to help with this, but I have no idea how to set up the scale for minor and mayor grid lines. Any suggestion?

Appreciate the help, thanks!

  • You must to post comments

Hi there,

You should use CateforyDateTimeAxis for this purpose, for it treats all points to be equidistant despite their X data value. To show a gap, you just need to append double.NaN values on that dates. Also take a look at this post dedicated to CategoryDateTimeAxis usage, you may find useful info there.

Regarding the second, the MajorGridLines aren’t show, because your visible range seems to match the first line occurrence. There are properties which controls interval between grid lines, such as MaxAutoTicks, AutoTicks, MinorsPerMajor, MinorDelta, MajorDelta. To set up your own interval, you need to set AutoTicks to “False” and apply certain value to MajorDelta.

Hope this helps! Don’t hesitate to ask if you have any more questions!

Best regards,

  • Diego Guerrero
    Hi Yuriy! I followed your advise about switching to CategoryDateTimeAxis + inserting Double.NaN and that solved the issue of having gaps in my charts. Now, I have a couple of questions about this solution: 1. Before making the switch of axis I was using:
    OhlcDataSeries<DateTime, int>
    as my type of DataSeries, but I had to switch to doubles (or floats) to use your suggestion. My question is: is there a way of achieving this behaviour using int? What do I have to append to the DataSeries to achieve this? 2. Am I incurring into a performance penalty for using double instead of int? Is float a viable alternative to double? On a regular basis, the charting application that I am building usually has 20+ live charts opened at the same time, so performance is a big priority for me. Look forward to your input on this subject. Thanks, Diego
  • Yuriy Zadereckiy
    Hi Diego, You shouldn't get any negative performance impact from switching to using doubles. The only thing is that Double is 64 bits type, so it takes much space than Int. Alternatively, you could try using Float instead, it should work the same way. Please, feel free to ask if you have more questions! Best regards, Yuriy
  • Diego Guerrero
    Thanks for the reply Yuriy. Just for the sake of asking, is it possible to do data gaps with integers? Or is it just limited to floats and doubles? Thanks, Diego
  • Yuriy Zadereckiy
    Hi there, Current implementation demands special value to recognize there has to be a data gap, and double.NaN/float.NaN are such values. Some internal calculations need values to be cast to doubles, and there isn't any integer value which can be cast to double.NaN. Best regards, Yuriy
  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.