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);
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
0
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
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.
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
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:
Sincerely yours,
Manuel
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.
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!
"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
Hey Sergo,
Find attached a small example, showing programmatically created CandleStick series with SqlDataSource (using Northwind).
Best regards,
Ves
Telerik
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.