Candlestick spacing using OhlcSeriesDescriptor

4 posts, 0 answers
  1. psyko
    psyko avatar
    5 posts
    Member since:
    Feb 2016

    Posted 19 Nov 2016 Link to this post

    Hi,

    Can you explain how to set the spacing in between candlesticks? 

    here is my XAML code 

     

                               <local:CustomSeriesDescriptorSelector.OhlcDescriptor>
                                    <telerik:OhlcSeriesDescriptor 
                                                CategoryPath="Date" 
                                                OpenPath="Open" 
                                                HighPath="High" 
                                                LowPath="Low" 
                                                ClosePath="Close"
                                                ItemsSourcePath="OhlcData">
                                        <telerik:OhlcSeriesDescriptor.Style>
                                            <Style TargetType="telerik:CandlestickSeries">
                                                <Setter Property="ShowLabels" Value="True" />
                                                <Setter Property="LegendSettings">
                                                    <Setter.Value>
                                                        <telerik:SeriesLegendSettings Title="ohlc data" />
                                                    </Setter.Value>
                                                </Setter>
                                            </Style>
                                        </telerik:OhlcSeriesDescriptor.Style>
                                    </telerik:OhlcSeriesDescriptor>
                                </local:CustomSeriesDescriptorSelector.OhlcDescriptor>

    Attached the screen of what it looks like. My objective is that the candles do not overlap.

  2. Martin
    Admin
    Martin avatar
    1132 posts

    Posted 23 Nov 2016 Link to this post

    Hello,

    To increase the spacing between the candlesticks you will need to positioned them at coordinates on the horizontal axis that are far one from another. Currently, the chart is very small in size and there are many candlesticks with coordinates close to each other. This is why the overlapping appears. Event if you make the candlesticks few pixels wide, they will still overlap.

    I suggest you try the chart's pan and zoom behavior. This way you can zoom in the area with points of interest and see it more clear.

    Regards,
    Martin
    Telerik by Progress
    Telerik UI for WPF is ready for Visual Studio 2017 RC! Learn more.
  3. psyko
    psyko avatar
    5 posts
    Member since:
    Feb 2016

    Posted 23 Nov 2016 Link to this post

    Zooming in is not an option. My user should be able to zoom but should not be forced to, so I hope we misunderstand each other at one point.

    To express differently my need, how can I have the width of each candle beeing auto set such as the candles do not overlap.

    To say it differently again, can your control automatically allow a width to each candles such as to respect the fact that candle width has to be below (chart width / number of candles.

    Rgds

     

     

     

  4. psyko
    psyko avatar
    5 posts
    Member since:
    Feb 2016

    Posted 26 Nov 2016 Link to this post

    I understood my problem.

     

    I was using the demo you provded which plotted 2 types of data, one using a month category and one using a day category, with the major unit of the x axis set as month. 

     

    I changed it to days and now its fine.

     

     

Back to Top