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

CandleStick Chart creation

5 Answers 66 Views
Chart (Obsolete)
This is a migrated thread and some comments may be shown as answers.
Michael
Top achievements
Rank 1
Michael asked on 30 May 2008, 03:52 PM
Does anyone have any sample code to create a candlestick chart through code.  I've got the date in a datatable and i'm trying to configure the chart.  

ChartSeries s = new ChartSeries();
            s.Type = ChartSeriesType.CandleStick;
            s.DataLabelsColumn = "Date";
            s.DataYColumn = "Open";
            s.DataYColumn2 = "High";
            s.DataYColumn3 = "Low";
            s.DataYColumn4 = "Close";
            
this.chart1.Series.Add(s);

5 Answers, 1 is accepted

Sort by
0
Ves
Telerik team
answered on 02 Jun 2008, 12:57 PM
Hi Michael,

I am afraid this is a bug in RadChart -- the control throws an exception when databinding a candlestick series. Our developers are already aware of this. Please, accept our apologies for the inconvenience caused.

Kind regards,
Ves
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
MikeK
Top achievements
Rank 1
answered on 12 Nov 2008, 10:14 PM
Does this control work with a SQL Datasource or does the bug prevent this from binding?

Do you have an example of this available? I think bound the control correctly but I'm getting an error:  CandleStick series requires all Y values to be set.
0
Giuseppe
Telerik team
answered on 14 Nov 2008, 02:03 PM
Hello MikeK,

You can databind a candlestick by creating a chart series, setting the Type property and setting the respective DataYColumn - DataYColumn4 property values in the following order: Open-Close-Max-Min:

<telerik:RadChart ID="RadChart1" runat="Server" AutoLayout="true" DataSourceID="SqlDataSource1"
    <Series> 
        <telerik:ChartSeries Type="CandleStick" DataYColumn="Open" DataYColumn2="Close" DataYColumn3="Max" 
            DataYColumn4="Min"
        </telerik:ChartSeries> 
    </Series> 
</telerik:RadChart> 
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:NorthwindConnectionString %>" 
    SelectCommand="SELECT [Open], [Close], [Max], [Min] FROM [CandlestickData]"></asp:SqlDataSource> 



Sincerely yours,
Manuel
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Gergo
Top achievements
Rank 1
answered on 30 May 2013, 09:02 PM
Ok It works in aspx but still not work in C#. The error is the same:
"CandleStick series requires all Y values to be set."

The last post was in 2008 and I've still get this error in 2013?!?!


Please help me!
0
Ves
Telerik team
answered on 05 Jun 2013, 06:20 AM
Hey Sergo,

Find attached a small example, showing programmatically created CandleStick series with SqlDataSource (using Northwind).

Best regards,
Ves
Telerik
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Tags
Chart (Obsolete)
Asked by
Michael
Top achievements
Rank 1
Answers by
Ves
Telerik team
MikeK
Top achievements
Rank 1
Giuseppe
Telerik team
Gergo
Top achievements
Rank 1
Share this question
or