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

CandlestickSeries and negative Values

5 Answers 54 Views
ChartView
This is a migrated thread and some comments may be shown as answers.
Janko
Top achievements
Rank 1
Janko asked on 07 May 2013, 03:46 PM

Hi Telerik Team.

The CandlestickSeries seems to have an odd behavior for negative values. The attached image shows a graph where the candlestick values should decrease linearly from left to right, but they stop at around y=0.


What is a workaround for this?


I use Telerik Version 2012.2.912.40, WPF


Code:

<telerik:RadCartesianChart>
    <telerik:RadCartesianChart.VerticalAxis>
        <telerik:LinearAxis/>
    </telerik:RadCartesianChart.VerticalAxis>
    <telerik:RadCartesianChart.HorizontalAxis>
        <telerik:CategoricalAxis/>
    </telerik:RadCartesianChart.HorizontalAxis>
    <telerik:CandlestickSeries x:Name="Series0" 
                            HighBinding="High"
                            OpenBinding="Open"
                            CloseBinding="Close"
                            LowBinding="Low"
                            CategoryBinding="X">
    </telerik:CandlestickSeries>
</telerik:RadCartesianChart>

public partial class MainWindow : Window
{
    public MainWindow()
    {
        InitializeComponent();
        this.Loaded += new RoutedEventHandler(MainWindow_Loaded);
    }
 
    void MainWindow_Loaded(object sender, RoutedEventArgs e)
    {
        var chartData = new List<MyChartDataClass>();
        for (int i = 0; i < 35; i++)
        {
            var cdc = new MyChartDataClass()
            {
                X = i,
                High = 5 - i,
                Open = 4 - i,
                Close = 3 - i,
                Low = 2 - i,
            };
            chartData.Add(cdc);
        }
        Series0.ItemsSource = chartData;
    }
}
 
public class MyChartDataClass
{
    public int X { get; set; }
    public double Close { get; set; }
    public double Low { get; set; }
    public double Open { get; set; }
    public double High { get; set; }
}

5 Answers, 1 is accepted

Sort by
0
Peshito
Telerik team
answered on 10 May 2013, 08:37 AM
Hello Janko,

CandleStick series type is used primarily to describe price movements of a security, derivative, or currency over time. Using CandleStick series with negative values is not a real case scenario therefore this behavior is not supported by RadChartView and there is no workaround for it.

Regards,
Peshito
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
Janko
Top achievements
Rank 1
answered on 13 May 2013, 01:14 PM

Hello Telerik Team.

I use CandleSticks to show the confidence Intervals of the points as error bars.

Is there any other way to show error bars?

(As far as I remember your old RadChart did not have this 'bug'.)


Regards,
Janko
0
Peshito
Telerik team
answered on 16 May 2013, 01:16 PM
Hello Janko,

You are right that RadChart behaves in a way different than RadChartView in that scenario. This is why I have forwarded this matter to our developers for further consideration and improvement for the CandleStick series in order to support negative values as well. I have also submitted a feature request for showing error bars. You can vote for it here.

Kind regards,
Peshito
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
Janko
Top achievements
Rank 1
answered on 16 May 2013, 02:12 PM

Hi Peshito/Telerik Team.

 

Thank you for your post :)

 

In my humble opinion the title/description of the feature request does not describe my problem.

;) ;)


Could you mention the negative values, e.g.:

“CandleStick series support for negative values such that they can be used as error bars in a negative value range, too.”



best Regards :)

Janko

0
Peshito
Telerik team
answered on 21 May 2013, 06:12 AM
Hi Janko,

Thank you for the suggestion.

The issue you are facing with the candle sticks not drown correctly when the values are negative has been fixed and it will be included in our next major release which is in about two weeks.

Kind regards,
Peshito
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Tags
ChartView
Asked by
Janko
Top achievements
Rank 1
Answers by
Peshito
Telerik team
Janko
Top achievements
Rank 1
Share this question
or