This is a migrated thread and some comments may be shown as answers.

Candlestick spacing using OhlcSeriesDescriptor

3 Answers 75 Views
ChartView
This is a migrated thread and some comments may be shown as answers.
psyko
Top achievements
Rank 1
psyko asked on 19 Nov 2016, 09:35 PM

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.

3 Answers, 1 is accepted

Sort by
0
Martin Ivanov
Telerik team
answered on 23 Nov 2016, 04:19 PM
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.
0
psyko
Top achievements
Rank 1
answered on 23 Nov 2016, 05:30 PM

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

 

 

 

0
psyko
Top achievements
Rank 1
answered on 26 Nov 2016, 01:40 PM

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.

 

 

Tags
ChartView
Asked by
psyko
Top achievements
Rank 1
Answers by
Martin Ivanov
Telerik team
psyko
Top achievements
Rank 1
Share this question
or